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 
46 struct _ExifData
47 {
49  ExifContent *ifd[EXIF_IFD_COUNT];
50 
52  unsigned char *data;
53 
55  unsigned int size;
56 
57  ExifDataPrivate *priv;
58 };
59 
67 ExifData *exif_data_new (void);
68 
76 ExifData *exif_data_new_mem (ExifMem *);
77 
84 ExifData *exif_data_new_from_file (const char *path);
85 
92 ExifData *exif_data_new_from_data (const unsigned char *data,
93  unsigned int size);
94 
106 void exif_data_load_data (ExifData *data, const unsigned char *d,
107  unsigned int size);
108 
119 void exif_data_save_data (ExifData *data, unsigned char **d,
120  unsigned int *ds);
121 
122 void exif_data_ref (ExifData *data);
123 void exif_data_unref (ExifData *data);
124 void exif_data_free (ExifData *data);
125 
131 ExifByteOrder exif_data_get_byte_order (ExifData *data);
132 
140 void exif_data_set_byte_order (ExifData *data, ExifByteOrder order);
141 
150 ExifMnoteData *exif_data_get_mnote_data (ExifData *d);
151 
159 void exif_data_fix (ExifData *d);
160 
161 typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data);
162 
169 void exif_data_foreach_content (ExifData *data,
170  ExifDataForeachContentFunc func,
171  void *user_data);
172 
174 typedef enum {
177 
180 
184 
190 const char *exif_data_option_get_name (ExifDataOption o);
191 
197 const char *exif_data_option_get_description (ExifDataOption o);
198 
204 void exif_data_set_option (ExifData *d, ExifDataOption o);
205 
211 void exif_data_unset_option (ExifData *d, ExifDataOption o);
212 
218 void exif_data_set_data_type (ExifData *d, ExifDataType dt);
219 
225 ExifDataType exif_data_get_data_type (ExifData *d);
226 
232 void exif_data_dump (ExifData *data);
233 
239 void exif_data_log (ExifData *data, ExifLog *log);
240 
249 #define exif_data_get_entry(d,t) \
250  (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ? \
251  exif_content_get_entry(d->ifd[EXIF_IFD_0],t) : \
252  exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ? \
253  exif_content_get_entry(d->ifd[EXIF_IFD_1],t) : \
254  exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ? \
255  exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) : \
256  exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ? \
257  exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) : \
258  exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ? \
259  exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
260 
261 #ifdef __cplusplus
262 }
263 #endif /* __cplusplus */
264 
265 #endif /* __EXIF_DATA_H__ */