Remove unused API & update 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_IMAGE_META_H__
20 #define __TIZEN_IMAGE_META_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 2.3
45  *
46  * @remarks The destination handle must be released with 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  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
58  *
59  * @see image_meta_destroy()
60  */
61 int image_meta_clone(image_meta_h *dst, image_meta_h src);
62
63 /**
64  * @brief Destroys the image metadata.
65  * @details The function frees all resources related to the image metadata handle. This handle
66  *          no longer can be used to perform any operation. A new handle has to
67  *          be created before next usage.
68  *
69  * @since_tizen 2.3
70  *
71  * @param[in] image The image metadata handle
72  *
73  * @return @c 0 on success,
74  *         otherwise a negative error value
75  *
76  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
77  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
78  *
79  * @pre Get a copy of image_meta handle by calling image_meta_clone().
80  *
81  * @see image_meta_clone()
82  */
83 int image_meta_destroy(image_meta_h image);
84
85 /**
86  * @brief Gets the ID of an image.
87  * @since_tizen 2.3
88  *
89  * @param[in]  image    The image metadata handle
90  * @param[out] media_id The ID of an image
91  *
92  * @return @c 0 on success,
93  *         otherwise a negative error value
94  *
95  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
96  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
97  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
98  */
99 int image_meta_get_media_id(image_meta_h image, char **media_id);
100
101 /**
102  * @brief Gets the image width in pixels.
103  * @since_tizen 2.3
104  *
105  * @param[in]  image The image metadata handle
106  * @param[out] width The image width in pixels
107  *
108  * @return @c 0 on success,
109  *         otherwise a negative error value
110  *
111  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
112  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
113  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
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 2.3
120  *
121  * @param[in]  image  The image metadata handle
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  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
130  */
131 int image_meta_get_height(image_meta_h image, int *height);
132
133 /**
134  * @brief Gets the image orientation.
135  * @since_tizen 2.3
136  *
137  * @param[in]  image       The image metadata handle
138  * @param[out] orientation The image orientation
139  *
140  * @return @c 0 on success,
141  *         otherwise a negative error value
142  *
143  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
144  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
145  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
146  */
147 int image_meta_get_orientation(image_meta_h image, media_content_orientation_e *orientation);
148
149 /**
150  * @brief Gets the image creation time as time_t structure.
151  * @since_tizen 2.3
152  *
153  * @param[in]  image      The image metadata handle
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_INVALID_PARAMETER Invalid parameter
161  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
162  */
163 int image_meta_get_date_taken(image_meta_h image, char **date_taken);
164
165 /**
166  * @brief Gets the burst shot ID.
167  * @since_tizen 2.3
168  *
169  * @remarks You must release @a burst_id using free().
170  *
171  * @param[in]  image    The image metadata handle
172  * @param[out] burst_id The ID of burst shot\ n
173  *                      If @a burst_id is @c NULL, this is not burst shot.
174  *
175  * @return @c 0 on success,
176  *         otherwise a negative error value
177  *
178  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
179  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
180  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
181  */
182 int image_meta_get_burst_id(image_meta_h image, char **burst_id);
183
184 /**
185  * @brief Checks whether the media is a burst shot image.
186  * @since_tizen 2.3
187  *
188  * @param[in]  image         The image metadata handle
189  * @param[out] is_burst_shot @c true if the media is a burst shot image,
190  *                           otherwise @c false if the media is not a burst shot image
191  *
192  * @return @c 0 on success,
193  *         otherwise a negative error value
194  *
195  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
196  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
197  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
198  */
199 int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot);
200
201 /**
202  * @brief Sets an orientation of the image.
203  * @since_tizen 2.3
204  *
205  * @param[in] image       The image metadata handle
206  * @param[in] orientation The image orientation
207  *
208  * @return @c 0 on success,
209  *         otherwise a negative error value
210  *
211  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
212  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
213  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
214  *
215  * @post image_meta_update_to_db()
216  */
217 int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation);
218
219 /**
220  * @brief Updates the image to the media database.
221  *
222  * @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
223  *          database. For example, after using image_meta_set_orientation() for setting the orientation of the image, the image_meta_update_to_db() function should be called so as to update
224  *          the given image attributes in the media database.
225  *
226  * @since_tizen 2.3
227  *
228  * @privlevel public
229  * @privilege %http://tizen.org/privilege/content.write
230  *
231  * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
232  *
233  * @param[in] image The handle to the image
234  *
235  * @return @c 0 on success,
236  *         otherwise a negative error value
237  *
238  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
239  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
240  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
241  *
242  * @pre This function requires opened connection to content service by media_content_connect().
243  *
244  * @see media_content_connect()
245  * @see image_meta_set_orientation()
246  */
247 int image_meta_update_to_db(image_meta_h image);
248
249 /**
250  * @}
251  */
252
253
254 #ifdef __cplusplus
255 }
256 #endif /* __cplusplus */
257
258 #endif /*__TIZEN_IMAGE_META_H__*/