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.
35 * @addtogroup CAPI_CONTENT_MEDIA_IMAGE_META_MODULE
41 * @brief Clones the image metadata.
42 * @details The function copies the image metadata handle from a source to destination.
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.
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.
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.
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.
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.
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.
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 8.0.
167 * @brief Gets the exposure time from EXIF.
170 * @remarks The @a exposure_time should be released using free().
172 * @param[in] image The handle to the image metadata
173 * @param[out] exposure_time The value of exposure_time, getting from EXIF
175 * @return 0 on success,
176 * otherwise a negative error value
178 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
179 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
180 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
183 int image_meta_get_exposure_time(image_meta_h image, char **exposure_time) TIZEN_DEPRECATED_API;
186 * @deprecated Deprecated since 8.0.
187 * @brief Gets the fnumber from EXIF.
190 * @param[in] image The handle to the image metadata
191 * @param[out] fnumber The value of fnumber, getting from EXIF
193 * @return 0 on success,
194 * otherwise a negative error value
196 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
197 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
200 int image_meta_get_fnumber(image_meta_h image, double *fnumber) TIZEN_DEPRECATED_API;
203 * @deprecated Deprecated since 8.0.
204 * @brief Gets the iso from EXIF.
207 * @param[in] image The handle to the image metadata
208 * @param[out] iso The value of iso, getting from EXIF
210 * @return 0 on success,
211 * otherwise a negative error value
213 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
214 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
217 int image_meta_get_iso(image_meta_h image, int *iso) TIZEN_DEPRECATED_API;
220 * @deprecated Deprecated since 8.0.
221 * @brief Gets the model from EXIF.
224 * @remarks The @a model should be released using free().
226 * @param[in] image The handle to the image metadata
227 * @param[out] model The value of model, getting from EXIF
229 * @return 0 on success,
230 * otherwise a negative error value
232 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
233 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
234 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
237 int image_meta_get_model(image_meta_h image, char **model) TIZEN_DEPRECATED_API;
246 #endif /* __cplusplus */
248 #endif /*__TIZEN_CONTENT_MEDIA_IMAGE_H__*/