EXIF library (libexif) API  0.6.21
exif-data.h
Go to the documentation of this file.
1 
4 /*
5  * \author Lutz Mueller <lutz@users.sourceforge.net>
6  * \date 2001-2005
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301 USA.
22  */
23 
24 #ifndef __EXIF_DATA_H__
25 #define __EXIF_DATA_H__
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 
32 #include <libexif/exif-data-type.h>
33 #include <libexif/exif-ifd.h>
34 #include <libexif/exif-log.h>
35 #include <libexif/exif-tag.h>
36 
38 typedef struct _ExifData ExifData;
39 typedef struct _ExifDataPrivate ExifDataPrivate;
40 
41 #include <libexif/exif-content.h>
43 #include <libexif/exif-mem.h>
44 
45 typedef enum{
46  MAKER_CANON = 1,
47  MAKER_OLYMPUS = 2,
48  MAKER_PENTAX = 3,
49  MAKER_NIKON = 4,
50  MAKER_CASIO = 5,
51  MAKER_FUJI = 6,
52  MAKER_SAMSUNG = 7
53 }Manufacturer;
54 
56 struct _ExifData
57 {
59  ExifContent *ifd[EXIF_IFD_COUNT];
60 
62  unsigned char *data;
63 
65  unsigned int size;
66 
67  ExifDataPrivate *priv;
68 };
69 
77 ExifData *exif_data_new (void);
78 
86 ExifData *exif_data_new_mem (ExifMem *);
87 
94 ExifData *exif_data_new_from_file (const char *path);
95 
102 ExifData *exif_data_new_from_data (const unsigned char *data,
103  unsigned int size);
104 
116 void exif_data_load_data (ExifData *data, const unsigned char *d,
117  unsigned int size);
118 
129 void exif_data_save_data (ExifData *data, unsigned char **d,
130  unsigned int *ds);
131 
132 void exif_data_ref (ExifData *data);
133 void exif_data_unref (ExifData *data);
134 void exif_data_free (ExifData *data);
135 
141 ExifByteOrder exif_data_get_byte_order (ExifData *data);
142 
150 void exif_data_set_byte_order (ExifData *data, ExifByteOrder order);
151 
160 ExifMnoteData *exif_data_get_mnote_data (ExifData *d);
161 
162 ExifByteOrder exif_data_get_data_order (ExifData *d);
163 
171 void exif_data_fix (ExifData *d);
172 
173 typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data);
174 
181 void exif_data_foreach_content (ExifData *data,
182  ExifDataForeachContentFunc func,
183  void *user_data);
184 
186 typedef enum {
189 
192 
196 
202 const char *exif_data_option_get_name (ExifDataOption o);
203 
209 const char *exif_data_option_get_description (ExifDataOption o);
210 
216 void exif_data_set_option (ExifData *d, ExifDataOption o);
217 
223 void exif_data_unset_option (ExifData *d, ExifDataOption o);
224 
230 void exif_data_set_data_type (ExifData *d, ExifDataType dt);
231 
237 ExifDataType exif_data_get_data_type (ExifData *d);
238 
244 void exif_data_dump (ExifData *data);
245 
251 void exif_data_log (ExifData *data, ExifLog *log);
252 
260 int exif_data_mnote_data_new(ExifData *d, Manufacturer maker, ExifDataOption o);
261 
268 int exif_data_mnote_set_mem_for_adding_entry(ExifMnoteData *md, Manufacturer maker);
269 
280 int exif_data_mnote_set_add_entry(ExifMnoteData *md, Manufacturer maker, int tag, ExifFormat fmt, int components, int id);
281 
296 int exif_data_mnote_set_add_entry_subtag(ExifMnoteData* md, Manufacturer maker, int tag, ExifFormat fmt, int components, int subtag1, int id1, int subtag2, int id2, int val);
297 
308 int exif_data_mnote_set_add_entry_string(ExifMnoteData* md, Manufacturer maker, int tag, ExifFormat fmt, int components, const char* string);
309 
318 #define exif_data_get_entry(d,t) \
319  (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ? \
320  exif_content_get_entry(d->ifd[EXIF_IFD_0],t) : \
321  exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ? \
322  exif_content_get_entry(d->ifd[EXIF_IFD_1],t) : \
323  exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ? \
324  exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) : \
325  exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ? \
326  exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) : \
327  exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ? \
328  exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
329 
330 #ifdef __cplusplus
331 }
332 #endif /* __cplusplus */
333 
334 #endif /* __EXIF_DATA_H__ */