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_IMAGE_META_H__
20 #define __TIZEN_IMAGE_META_H__
22 #include <media_content_type.h>
26 #endif /* __cplusplus */
30 * @addtogroup CAPI_CONTENT_MEDIA_IMAGE_MODULE
35 * @brief Clones image metadata.
36 * @details Function copies the image metadata handle from source to destination.
38 * @remark The destination handle must be released with image_meta_destroy() by you.
40 * @param [out] dst A destination handle to image metadata
41 * @param [in] src The source handle to image metadata
42 * @return 0 on success, otherwise a negative error value.
43 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
44 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
45 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
46 * @see image_meta_destroy()
48 int image_meta_clone(image_meta_h *dst, image_meta_h src);
51 * @brief Destroys image metadata.
52 * @details The function frees all resources related to the image metadata handle. This handle
53 * no longer can be used to perform any operation. A new handle has to
54 * be created before next usage.
56 * @param [in] image The handle to image metadata
57 * @return 0 on success, otherwise a negative error value.
58 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
59 * @pre Get copy of image_meta handle by calling image_meta_clone()
60 * @see image_meta_clone()
62 int image_meta_destroy(image_meta_h image);
65 * @brief Gets the ID of image.
67 * @param [in] image The handle to image metadata
68 * @param [out] media_id The ID of image
69 * @return 0 on success, otherwise a negative error value.
70 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
71 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
73 int image_meta_get_media_id(image_meta_h image, char **media_id);
76 * @brief Gets image's width in pixels.
78 * @param [in] image The handle to image metadata
79 * @param [out] width The image width in pixels
80 * @return 0 on success, otherwise a negative error value.
81 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
82 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
84 int image_meta_get_width(image_meta_h image, int *width);
87 * @brief Gets image's height in pixels.
89 * @param [in] image The handle to image metadata
90 * @param [out] height The image height in pixels
91 * @return 0 on success, otherwise a negative error value.
92 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
93 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
95 int image_meta_get_height(image_meta_h image, int *height);
98 * @brief Gets the image orientation.
100 * @param [in] image The handle to image metadata
101 * @param [out] orientation The image orientation
102 * @return 0 on success, otherwise a negative error value.
103 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
104 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
106 int image_meta_get_orientation(image_meta_h image, media_content_orientation_e *orientation);
109 * @brief Gets the date, when image was created as time_t structure.
111 * @param [in] image The handle to image metadata
112 * @param [out] date_taken The time, when image was taken (in seconds, since the Epoch)
113 * @return 0 on success, otherwise a negative error value.
114 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
115 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
117 int image_meta_get_date_taken(image_meta_h image, char **date_taken);
120 * @brief Gets the burst shot id.
122 * @remarks @a burst id must be released with free() by you.
124 * @param[in] media The handle toimage metadata
125 * @param[out] burst_id The id of burst shot. if burst_id is NULL, this is not burst shot.
126 * @return 0 on success, otherwise a negative error value.
127 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
128 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
129 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
132 int image_meta_get_burst_id(image_meta_h image, char **burst_id);
135 * @brief Checks whether the media is burst shot image.
137 * @param[in] media The handle to image metadata
138 * @param[out] is_burst_shot /@a true if the burst shot image,
139 * /@a false if not burst shot image.
140 * @return 0 on success, otherwise a negative error value.
141 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
142 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
145 int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot);
148 * @brief Sets the image orientation.
150 * @param [in] image The handle to image metadata
151 * @param [in] orientation The image orientation
152 * @return 0 on success, otherwise a negative error value.
153 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
154 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
155 * @post image_meta_update_to_db()
157 int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation);
160 * @brief Updates the image to the media database.
162 * @details The function updates the given image meta in the media database. The function should be called after any change in image attributes, to be updated to the media
163 * database. For example, after using image_meta_set_orientation() for setting the orientation of the image, image_meta_update_to_db() function should be called so as to update
164 * the given image attibutes in the media database.
166 * @param[in] image The handle to image
167 * @return 0 on success, otherwise a negative error value.
168 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
169 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
170 * @pre This function requires opened connection to content service by media_content_connect().
171 * @see media_content_connect()
172 * @see image_meta_set_orientation()
175 int image_meta_update_to_db(image_meta_h image);
184 #endif /* __cplusplus */
186 #endif /*__TIZEN_IMAGE_META_H__*/