2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #ifndef __TIZEN_CONTENT_MEDIA_IMAGE_H__
20 #define __TIZEN_CONTENT_MEDIA_IMAGE_H__
22 #include <media_content_type.h>
26 #endif /* __cplusplus */
29 * @brief This file contains the image metadata API and related functions to proceed with them.
30 * Functions include cloning and destroying the image metadata, getting image metadata such as width, height, \n
31 * orientation, date taken, title, burst shot id and updating image to DB.
35 * @addtogroup CAPI_CONTENT_MEDIA_IMAGE_MODULE
41 * @brief Clones the image metadata.
42 * @details The function copies the image metadata handle from a source to destination.
44 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
46 * @remarks The @a dst should be released using image_meta_destroy().
48 * @param[out] dst The destination handle to the image metadata
49 * @param[in] src The source handle to the image metadata
51 * @return @c 0 on success,
52 * otherwise a negative error value
54 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
55 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
56 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
58 * @see image_meta_destroy()
60 int image_meta_clone(image_meta_h *dst, image_meta_h src);
63 * @brief Destroys the image metadata.
64 * @details The function frees all resources related to the image metadata handle. This handle
65 * no longer can be used to perform any operations. A new handle has to
66 * be created before next usage.
68 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
70 * @param[in] image The handle to the image metadata
72 * @return @c 0 on success,
73 * otherwise a negative error value
75 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
76 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
78 * @pre Get a copy of image_meta handle by calling image_meta_clone().
80 * @see image_meta_clone()
82 int image_meta_destroy(image_meta_h image);
85 * @brief Gets the ID of an image.
86 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
88 * @remarks The @a media_id should be released using free().
90 * @param[in] image The handle to the image metadata
91 * @param[out] media_id The media ID
93 * @return @c 0 on success,
94 * otherwise a negative error value
96 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
97 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
98 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
100 int image_meta_get_media_id(image_meta_h image, char **media_id);
103 * @brief Gets the image width in pixels.
104 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
106 * @param[in] image The handle to the image metadata
107 * @param[out] width The image width in pixels
109 * @return @c 0 on success,
110 * otherwise a negative error value
112 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
113 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
115 int image_meta_get_width(image_meta_h image, int *width);
118 * @brief Gets the image height in pixels.
119 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
121 * @param[in] image The handle to the image metadata
122 * @param[out] height The image height in pixels
124 * @return @c 0 on success,
125 * otherwise a negative error value
127 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
128 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
130 int image_meta_get_height(image_meta_h image, int *height);
133 * @brief Gets the image orientation.
134 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
136 * @param[in] image The handle to the image metadata
137 * @param[out] orientation The image orientation
139 * @return @c 0 on success,
140 * otherwise a negative error value
142 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
143 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
145 int image_meta_get_orientation(image_meta_h image, media_content_orientation_e *orientation);
148 * @brief Gets the image creation time.
149 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
151 * @remarks The @a date_taken should be released using free().
153 * @param[in] image The handle to the image metadata
154 * @param[out] date_taken The time, when image was taken (in seconds, since the Epoch)
156 * @return @c 0 on success,
157 * otherwise a negative error value
159 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
160 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
161 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
163 int image_meta_get_date_taken(image_meta_h image, char **date_taken);
166 * @deprecated Deprecated since 4.0.
167 * @brief Gets the burst shot ID.
168 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
170 * @remarks The @a burst_id should be released using free().
172 * @param[in] image The handle to the image metadata
173 * @param[out] burst_id The ID of the burst shot\ n
174 * If @a burst_id is @c NULL, this is not burst shot
176 * @return @c 0 on success,
177 * otherwise a negative error value
179 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
180 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
181 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
183 int image_meta_get_burst_id(image_meta_h image, char **burst_id) TIZEN_DEPRECATED_API;
186 * @brief Gets the exposure time from EXIF.
187 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
189 * @remarks The @a exposure_time should be released using free().
191 * @param[in] image The handle to the image metadata
192 * @param[out] exposure_time The value of exposure_time, getting from EXIF
194 * @return 0 on success,
195 * otherwise a negative error value
197 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
198 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
199 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
202 int image_meta_get_exposure_time(image_meta_h image, char **exposure_time);
205 * @brief Gets the fnumber from EXIF.
206 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
208 * @param[in] image The handle to the image metadata
209 * @param[out] fnumber The value of fnumber, getting from EXIF
211 * @return 0 on success,
212 * otherwise a negative error value
214 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
215 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
218 int image_meta_get_fnumber(image_meta_h image, double *fnumber);
221 * @brief Gets the iso from EXIF.
222 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
224 * @param[in] image The handle to the image metadata
225 * @param[out] iso The value of iso, getting from EXIF
227 * @return 0 on success,
228 * otherwise a negative error value
230 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
231 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
234 int image_meta_get_iso(image_meta_h image, int *iso);
237 * @brief Gets the model from EXIF.
238 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
240 * @remarks The @a model should be released using free().
242 * @param[in] image The handle to the image metadata
243 * @param[out] model The value of model, getting from EXIF
245 * @return 0 on success,
246 * otherwise a negative error value
248 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
249 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
250 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
253 int image_meta_get_model(image_meta_h image, char **model);
256 * @deprecated Deprecated since 4.0.
257 * @brief Checks whether the media is a burst shot image.
258 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
260 * @param[in] image The handle to the image metadata
261 * @param[out] is_burst_shot @c true if the media is a burst shot image,
262 * otherwise @c false if the media is not a burst shot image
264 * @return @c 0 on success,
265 * otherwise a negative error value
267 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
268 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
270 int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot) TIZEN_DEPRECATED_API;
273 * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
274 * @brief Sets an orientation of the image.
275 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
277 * @param[in] image The handle to the image metadata
278 * @param[in] orientation The image orientation
280 * @return @c 0 on success,
281 * otherwise a negative error value
283 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
284 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
286 int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation) TIZEN_DEPRECATED_API;
289 * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore.
290 * @brief Updates the image to the media database.
292 * @details The function updates the given image meta in the media database. \n
293 * The function should be called after any change in image attributes, to be updated to the media database.
295 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
298 * @privilege %http://tizen.org/privilege/content.write
300 * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
302 * @param[in] image The handle to the image metadata
304 * @return @c 0 on success,
305 * otherwise a negative error value
307 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
308 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
309 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
310 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
311 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
312 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
313 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
314 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
316 * @pre This function requires opened connection to content service by media_content_connect().
318 * @see media_content_connect()
320 int image_meta_update_to_db(image_meta_h image) TIZEN_DEPRECATED_API;
329 #endif /* __cplusplus */
331 #endif /*__TIZEN_CONTENT_MEDIA_IMAGE_H__*/