1032e9ae7136781fd1c2547785c487597eff9d5f
[framework/multimedia/libmm-camcorder.git] / src / include / mm_camcorder_exifinfo.h
1 /*
2  * libmm-camcorder
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jeongmo Yang <jm80.yang@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef _MM_EXIFINFO_H_
23 #define _MM_EXIFINFO_H_
24
25 /*=======================================================================================
26 | INCLUDE FILES                                                                         |
27 ========================================================================================*/
28 #include <libexif/exif-ifd.h>
29 #include <libexif/exif-tag.h>
30 #include <libexif/exif-format.h>
31 #include <libexif/exif-data.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /*=======================================================================================
38 | STRUCTURE DEFINITIONS                                                                 |
39 ========================================================================================*/
40 /**
41  * Structure for exif data infomation.
42  */
43 typedef struct {
44         void *data;                     /**< saved exif data*/
45         unsigned int size;              /**< size of saved exif data*/
46 } mm_exif_info_t;
47
48 /*=======================================================================================
49 | GLOBAL FUNCTION PROTOTYPES                                                            |
50 ========================================================================================*/
51 /**
52  * Create exif info 
53  *  @param[in] info exif info.
54  * @return return int.
55  */
56 int mm_exif_create_exif_info(mm_exif_info_t **info);
57
58 /**
59  * Destroy exif info 
60  *  @param[in] info exif info.
61  *  @return void
62  */
63 void mm_exif_destory_exif_info(mm_exif_info_t *info);
64
65 /**
66  * get exif data information from data buffer
67  *  @param[in] info exif info.
68  *  @return return ExifData.
69  */
70 ExifData *mm_exif_get_exif_data_from_data(mm_exif_info_t *info);
71
72 /**
73  * get exif data information from exif info
74  *  @param[in] info exif info.
75  *  @param[out] Exif tag .
76  *  @return return int.
77  */
78 ExifData *mm_exif_get_exif_from_info(mm_exif_info_t *info);
79
80 /**
81  * Write exif data information into exif info
82  *  @param[in] info exif info.
83  *  @param[in] Exif tag .
84  *  @param[in] Exif tag value to be written.
85  *  @return return int.
86  */
87 int mm_exif_set_exif_to_info(mm_exif_info_t *info, ExifData *exif);
88
89 /**
90  * add one tag information into exif 
91  *  @param[in] info exif info.
92  *  @param[in] Exif tag .
93  *  @param[in] tag content category.
94  *  @param[in] tag format.
95  *  @param[in] the number of the component .
96  *  @param[in] the pointer of the tag data.
97  *  @return return int.
98  */
99 int mm_exif_set_add_entry(ExifData *exif, ExifIfd ifd, ExifTag tag,
100                           ExifFormat format, unsigned long components,
101                           const char *data);
102
103 /**
104  * Write thumbnail data into exif info.
105  * @param[in] info exif info.
106  * @param[in] thumbnail image thumbnail data.
107  * @param[in] width width of thumbnail image.
108  * @param[in] height height of thumbnail image.
109  * @param[in] length length of thumbnail image.
110  * @return return int.
111  */
112 int mm_exif_add_thumbnail_info(mm_exif_info_t *info, void *thumbnail,
113                                int width, int height, int len);
114
115 /**
116  * Write exif info into a jpeg image and then save as a jpeg file.
117  * @param[in/out] filename jpeg filename.
118  * @param[in] info exif info.
119  * @param[in] jpeg jpeg image data.
120  * @param[in] length length of jpeg image.
121  * @return return int.
122  */
123 int mm_exif_write_exif_jpeg_to_file(char *filename, mm_exif_info_t *info, void *jpeg, int jpeg_len);
124
125 /**
126  * Write exif info into a jpeg memory buffer.
127  * @param[in/out] mem image data buffer.
128  * @param[in/out] length image data length.
129  * @param[in] info exif info.
130  * @param[in] jpeg jpeg image data.
131  * @param[in] length length of jpeg image.
132  * @return return int.
133  */
134 int mm_exif_write_exif_jpeg_to_memory(void **mem, unsigned int *length,
135                                       mm_exif_info_t *info, void *jpeg,
136                                       unsigned int jpeg_len);
137
138 /**
139  * Load exif info from a jpeg memory buffer.
140  * @param[out] info exif info.
141  * @param[in] jpeg jpeg image data.
142  * @param[in] length length of jpeg image.
143  * @return return int.
144  */
145 int mm_exif_load_exif_info(mm_exif_info_t **info, void *jpeg_data, int jpeg_length);
146
147 #ifdef __cplusplus
148 }
149 #endif
150 #endif  /*_MM_EXIFINFO_H_*/