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 Sets the image orientation.
122 * @param [in] image The handle to image metadata
123 * @param [in] orientation The image orientation
124 * @return 0 on success, otherwise a negative error value.
125 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
126 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
127 * @post image_meta_update_to_db()
129 int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation);
132 * @brief Updates the image to the media database.
134 * @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
135 * 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
136 * the given image attibutes in the media database.
138 * @param[in] image The handle to image
139 * @return 0 on success, otherwise a negative error value.
140 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
141 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
142 * @pre This function requires opened connection to content service by media_content_connect().
143 * @see media_content_connect()
144 * @see image_meta_set_orientation()
147 int image_meta_update_to_db(image_meta_h image);
156 #endif /* __cplusplus */
158 #endif /*__TIZEN_IMAGE_META_H__*/