3dd62218661c940087af02c4b0bfcbf7b207bd5b
[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.
32  */
33
34 /**
35  * @addtogroup CAPI_CONTENT_MEDIA_IMAGE_META_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  * @brief Gets the exposure time from EXIF.
167  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
168  *
169  * @remarks The @a exposure_time should be released using free().
170  *
171  * @param[in] image The handle to the image metadata
172  * @param[out] exposure_time The value of exposure_time, getting from EXIF
173  *
174  * @return 0 on success,
175  *         otherwise a negative error value
176  *
177  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
178  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
179  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
180  *
181  */
182 int image_meta_get_exposure_time(image_meta_h image, char **exposure_time);
183
184 /**
185  * @brief Gets the fnumber from EXIF.
186  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
187  *
188  * @param[in] image The handle to the image metadata
189  * @param[out] fnumber The value of fnumber, getting from EXIF
190  *
191  * @return 0 on success,
192  *         otherwise a negative error value
193  *
194  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
195  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
196  *
197  */
198 int image_meta_get_fnumber(image_meta_h image, double *fnumber);
199
200 /**
201  * @brief Gets the iso from EXIF.
202  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
203  *
204  * @param[in] image The handle to the image metadata
205  * @param[out] iso The value of iso, getting from EXIF
206  *
207  * @return 0 on success,
208  *         otherwise a negative error value
209  *
210  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
211  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
212  *
213  */
214 int image_meta_get_iso(image_meta_h image, int *iso);
215
216 /**
217  * @brief Gets the model from EXIF.
218  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
219  *
220  * @remarks The @a model should be released using free().
221  *
222  * @param[in] image The handle to the image metadata
223  * @param[out] model The value of model, getting from EXIF
224  *
225  * @return 0 on success,
226  *         otherwise a negative error value
227  *
228  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
229  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
230  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
231  *
232  */
233 int image_meta_get_model(image_meta_h image, char **model);
234
235 /**
236  * @}
237  */
238
239
240 #ifdef __cplusplus
241 }
242 #endif /* __cplusplus */
243
244 #endif /*__TIZEN_CONTENT_MEDIA_IMAGE_H__*/