tizen beta release
[platform/core/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 #include <libexif/mnote-samsung-tag.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /*=======================================================================================
39 | STRUCTURE DEFINITIONS                                                                 |
40 ========================================================================================*/
41 /**
42  * Structure for exif data infomation.
43  */
44 typedef struct {
45         void *data;                     /**< saved exif data*/
46         unsigned int size;              /**< size of saved exif data*/
47 } mm_exif_info_t;
48
49 /*=======================================================================================
50 | GLOBAL FUNCTION PROTOTYPES                                                            |
51 ========================================================================================*/
52 /**
53  * Create exif info 
54  *  @param[in] info exif info.
55  * @return return int.
56  */
57 int mm_exif_create_exif_info(mm_exif_info_t **info);
58
59 /**
60  * Destroy exif info 
61  *  @param[in] info exif info.
62  *  @return void
63  */
64 void mm_exif_destory_exif_info(mm_exif_info_t *info);
65
66 /**
67  * get exif data information from data buffer
68  *  @param[in] info exif info.
69  *  @return return ExifData.
70  */
71 ExifData *mm_exif_get_exif_data_from_data(mm_exif_info_t *info);
72
73 /**
74  * get exif data information from exif info
75  *  @param[in] info exif info.
76  *  @param[out] Exif tag .
77  *  @return return int.
78  */
79 ExifData *mm_exif_get_exif_from_info(mm_exif_info_t *info);
80
81 /**
82  * Write exif data information into exif info
83  *  @param[in] info exif info.
84  *  @param[in] Exif tag .
85  *  @param[in] Exif tag value to be written.
86  *  @return return int.
87  */
88 int mm_exif_set_exif_to_info(mm_exif_info_t *info, ExifData *exif);
89
90 /**
91  * add one tag information into exif 
92  *  @param[in] info exif info.
93  *  @param[in] Exif tag .
94  *  @param[in] tag content category.
95  *  @param[in] tag format.
96  *  @param[in] the number of the component .
97  *  @param[in] the pointer of the tag data.
98  *  @return return int.
99  */
100 int mm_exif_set_add_entry(ExifData *exif, ExifIfd ifd, ExifTag tag,
101                           ExifFormat format, unsigned long components,
102                           unsigned char *data);
103
104 /**
105  * Write thumbnail data into exif info.
106  * @param[in] info exif info.
107  * @param[in] thumbnail image thumbnail data.
108  * @param[in] width width of thumbnail image.
109  * @param[in] height height of thumbnail image.
110  * @param[in] length length of thumbnail image.
111  * @return return int.
112  */
113 int mm_exif_add_thumbnail_info(mm_exif_info_t *info, void *thumbnail,
114                                int width, int height, int len);
115
116 /**
117  * create ExifMnoteDataSamsung and set up related function pointers
118  * @param[in/out] info exif info.
119  * @return return int.
120  */
121 int mm_exif_mnote_create(ExifData *exif);
122
123 /**
124  * add one Samsung maker note tag information into exif
125  *  @param[in/out] info exif info.
126  *  @param[in] Samsung maker note tag .
127  *  @param[in] tag index.
128  *  @param[in] sub tag index 1.
129  *  @param[in] sub tag index 2.
130  *  @return return int.
131  */
132 int mm_exif_mnote_set_add_entry(ExifData *exif, MnoteSamsungTag tag,
133                                 int index, int subindex1, int subindex2);
134
135 /**
136  * Write exif info into a jpeg image and then save as a jpeg file.
137  * @param[in/out] filename jpeg filename.
138  * @param[in] info exif info.
139  * @param[in] jpeg jpeg image data.
140  * @param[in] length length of jpeg image.
141  * @return return int.
142  */
143 int mm_exif_write_exif_jpeg_to_file(char *filename, mm_exif_info_t *info, void *jpeg, int jpeg_len);
144
145 /**
146  * Write exif info into a jpeg memory buffer.
147  * @param[in/out] mem image data buffer.
148  * @param[in/out] length image data length.
149  * @param[in] info exif info.
150  * @param[in] jpeg jpeg image data.
151  * @param[in] length length of jpeg image.
152  * @return return int.
153  */
154 int mm_exif_write_exif_jpeg_to_memory(void **mem, unsigned int *length,
155                                       mm_exif_info_t *info, void *jpeg,
156                                       unsigned int jpeg_len);
157
158 #ifdef __cplusplus
159 }
160 #endif
161 #endif  /*_MM_EXIFINFO_H_*/