4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef _MM_EXIFINFO_H_
23 #define _MM_EXIFINFO_H_
25 /*=======================================================================================
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>
38 /*=======================================================================================
39 | STRUCTURE DEFINITIONS |
40 ========================================================================================*/
42 * Structure for exif data infomation.
45 void *data; /**< saved exif data*/
46 unsigned int size; /**< size of saved exif data*/
49 /*=======================================================================================
50 | GLOBAL FUNCTION PROTOTYPES |
51 ========================================================================================*/
54 * @param[in] info exif info.
57 int mm_exif_create_exif_info(mm_exif_info_t **info);
61 * @param[in] info exif info.
64 void mm_exif_destory_exif_info(mm_exif_info_t *info);
67 * get exif data information from data buffer
68 * @param[in] info exif info.
69 * @return return ExifData.
71 ExifData *mm_exif_get_exif_data_from_data(mm_exif_info_t *info);
74 * get exif data information from exif info
75 * @param[in] info exif info.
76 * @param[out] Exif tag .
79 ExifData *mm_exif_get_exif_from_info(mm_exif_info_t *info);
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.
88 int mm_exif_set_exif_to_info(mm_exif_info_t *info, ExifData *exif);
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.
100 int mm_exif_set_add_entry(ExifData *exif, ExifIfd ifd, ExifTag tag,
101 ExifFormat format, unsigned long components,
102 unsigned char *data);
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.
113 int mm_exif_add_thumbnail_info(mm_exif_info_t *info, void *thumbnail,
114 int width, int height, int len);
117 * create ExifMnoteDataSamsung and set up related function pointers
118 * @param[in/out] info exif info.
119 * @return return int.
121 int mm_exif_mnote_create(ExifData *exif);
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.
132 int mm_exif_mnote_set_add_entry(ExifData *exif, MnoteSamsungTag tag,
133 int index, int subindex1, int subindex2);
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.
143 int mm_exif_write_exif_jpeg_to_file(char *filename, mm_exif_info_t *info, void *jpeg, int jpeg_len);
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.
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);
161 #endif /*_MM_EXIFINFO_H_*/