Just update api description
[platform/core/api/media-content.git] / include / media_image.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18
19 #ifndef __TIZEN_CONTENT_MEDIA_IMAGE_H__
20 #define __TIZEN_CONTENT_MEDIA_IMAGE_H__
21
22 #include <media_content_type.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27
28 /**
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.
32  */
33
34 /**
35  * @addtogroup CAPI_CONTENT_MEDIA_IMAGE_MODULE
36  * @{
37  */
38
39
40 /**
41  * @brief Clones the image metadata.
42  * @details The function copies the image metadata handle from a source to destination.
43  *
44  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
45  *
46  * @remarks The @a dst should be released using image_meta_destroy().
47  *
48  * @param[out] dst The destination handle to the image metadata
49  * @param[in] src The source handle to the image metadata
50  *
51  * @return @c 0 on success,
52  *         otherwise a negative error value
53  *
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
57  *
58  * @see image_meta_destroy()
59  */
60 int image_meta_clone(image_meta_h *dst, image_meta_h src);
61
62 /**
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.
67  *
68  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
69  *
70  * @param[in] image The handle to the image metadata
71  *
72  * @return @c 0 on success,
73  *         otherwise a negative error value
74  *
75  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
76  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
77  *
78  * @pre Get a copy of image_meta handle by calling image_meta_clone().
79  *
80  * @see image_meta_clone()
81  */
82 int image_meta_destroy(image_meta_h image);
83
84 /**
85  * @brief Gets the ID of an image.
86  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
87  *
88  * @remarks The @a media_id should be released using free().
89  *
90  * @param[in] image The handle to the image metadata
91  * @param[out] media_id The media ID
92  *
93  * @return @c 0 on success,
94  *         otherwise a negative error value
95  *
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
99  */
100 int image_meta_get_media_id(image_meta_h image, char **media_id);
101
102 /**
103  * @brief Gets the image width in pixels.
104  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
105  *
106  * @param[in] image The handle to the image metadata
107  * @param[out] width The image width in pixels
108  *
109  * @return @c 0 on success,
110  *         otherwise a negative error value
111  *
112  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
113  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
114  */
115 int image_meta_get_width(image_meta_h image, int *width);
116
117 /**
118  * @brief Gets the image height in pixels.
119  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
120  *
121  * @param[in] image The handle to the image metadata
122  * @param[out] height The image height in pixels
123  *
124  * @return @c 0 on success,
125  *         otherwise a negative error value
126  *
127  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
128  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
129  */
130 int image_meta_get_height(image_meta_h image, int *height);
131
132 /**
133  * @brief Gets the image orientation.
134  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
135  *
136  * @param[in] image The handle to the image metadata
137  * @param[out] orientation The image orientation
138  *
139  * @return @c 0 on success,
140  *         otherwise a negative error value
141  *
142  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
143  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
144  */
145 int image_meta_get_orientation(image_meta_h image, media_content_orientation_e *orientation);
146
147 /**
148  * @brief Gets the image creation time.
149  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
150  *
151  * @remarks The @a date_taken should be released using free().
152  *
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)
155  *
156  * @return @c 0 on success,
157  *         otherwise a negative error value
158  *
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
162  */
163 int image_meta_get_date_taken(image_meta_h image, char **date_taken);
164
165 /**
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
169  *
170  * @remarks The @a burst_id should be released using free().
171  *
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
175  *
176  * @return @c 0 on success,
177  *         otherwise a negative error value
178  *
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
182  */
183 int image_meta_get_burst_id(image_meta_h image, char **burst_id) TIZEN_DEPRECATED_API;
184
185 /**
186  * @brief Gets the exposure time from EXIF.
187  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
188  *
189  * @remarks The @a exposure_time should be released using free().
190  *
191  * @param[in] image The handle to the image metadata
192  * @param[out] exposure_time The value of exposure_time, getting from EXIF
193  *
194  * @return 0 on success,
195  *         otherwise a negative error value
196  *
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
200  *
201  */
202 int image_meta_get_exposure_time(image_meta_h image, char **exposure_time);
203
204 /**
205  * @brief Gets the fnumber from EXIF.
206  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
207  *
208  * @param[in] image The handle to the image metadata
209  * @param[out] fnumber The value of fnumber, getting from EXIF
210  *
211  * @return 0 on success,
212  *         otherwise a negative error value
213  *
214  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
215  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
216  *
217  */
218 int image_meta_get_fnumber(image_meta_h image, double *fnumber);
219
220 /**
221  * @brief Gets the iso from EXIF.
222  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
223  *
224  * @param[in] image The handle to the image metadata
225  * @param[out] iso The value of iso, getting from EXIF
226  *
227  * @return 0 on success,
228  *         otherwise a negative error value
229  *
230  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
231  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
232  *
233  */
234 int image_meta_get_iso(image_meta_h image, int *iso);
235
236 /**
237  * @brief Gets the model from EXIF.
238  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
239  *
240  * @remarks The @a model should be released using free().
241  *
242  * @param[in] image The handle to the image metadata
243  * @param[out] model The value of model, getting from EXIF
244  *
245  * @return 0 on success,
246  *         otherwise a negative error value
247  *
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
251  *
252  */
253 int image_meta_get_model(image_meta_h image, char **model);
254
255 /**
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
259  *
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
263  *
264  * @return @c 0 on success,
265  *         otherwise a negative error value
266  *
267  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
268  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
269  */
270 int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot) TIZEN_DEPRECATED_API;
271
272 /**
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
276  *
277  * @param[in] image The handle to the image metadata
278  * @param[in] orientation The image orientation
279  *
280  * @return @c 0 on success,
281  *         otherwise a negative error value
282  *
283  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
284  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
285  */
286 int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation) TIZEN_DEPRECATED_API;
287
288 /**
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.
291  *
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.
294  *
295  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
296  *
297  * @privlevel public
298  * @privilege %http://tizen.org/privilege/content.write
299  *
300  * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
301  *
302  * @param[in] image The handle to the image metadata
303  *
304  * @return @c 0 on success,
305  *         otherwise a negative error value
306  *
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
315  *
316  * @pre This function requires opened connection to content service by media_content_connect().
317  *
318  * @see media_content_connect()
319  */
320 int image_meta_update_to_db(image_meta_h image) TIZEN_DEPRECATED_API;
321
322 /**
323  * @}
324  */
325
326
327 #ifdef __cplusplus
328 }
329 #endif /* __cplusplus */
330
331 #endif /*__TIZEN_CONTENT_MEDIA_IMAGE_H__*/