EXIF library (libexif) API
0.6.20
|
00001 00004 /* 00005 * \author Lutz Mueller <lutz@users.sourceforge.net> 00006 * \date 2001-2005 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the 00020 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00021 * Boston, MA 02110-1301 USA. 00022 */ 00023 00024 #ifndef __EXIF_DATA_H__ 00025 #define __EXIF_DATA_H__ 00026 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif /* __cplusplus */ 00030 00031 #include <libexif/exif-byte-order.h> 00032 #include <libexif/exif-data-type.h> 00033 #include <libexif/exif-ifd.h> 00034 #include <libexif/exif-log.h> 00035 #include <libexif/exif-tag.h> 00036 00038 typedef struct _ExifData ExifData; 00039 typedef struct _ExifDataPrivate ExifDataPrivate; 00040 00041 #include <libexif/exif-content.h> 00042 #include <libexif/exif-mnote-data.h> 00043 #include <libexif/exif-mem.h> 00044 00046 struct _ExifData 00047 { 00049 ExifContent *ifd[EXIF_IFD_COUNT]; 00050 00052 unsigned char *data; 00053 00055 unsigned int size; 00056 00057 ExifDataPrivate *priv; 00058 }; 00059 00067 ExifData *exif_data_new (void); 00068 00076 ExifData *exif_data_new_mem (ExifMem *); 00077 00084 ExifData *exif_data_new_from_file (const char *path); 00085 00092 ExifData *exif_data_new_from_data (const unsigned char *data, 00093 unsigned int size); 00094 00105 void exif_data_load_data (ExifData *data, const unsigned char *d, 00106 unsigned int size); 00107 00118 void exif_data_save_data (ExifData *data, unsigned char **d, 00119 unsigned int *ds); 00120 00121 void exif_data_ref (ExifData *data); 00122 void exif_data_unref (ExifData *data); 00123 void exif_data_free (ExifData *data); 00124 00130 ExifByteOrder exif_data_get_byte_order (ExifData *data); 00131 00139 void exif_data_set_byte_order (ExifData *data, ExifByteOrder order); 00140 00149 ExifMnoteData *exif_data_get_mnote_data (ExifData *d); 00150 00158 void exif_data_fix (ExifData *d); 00159 00160 typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data); 00161 00168 void exif_data_foreach_content (ExifData *data, 00169 ExifDataForeachContentFunc func, 00170 void *user_data); 00171 00173 typedef enum { 00175 EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0, 00176 00178 EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1, 00179 00181 EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2 00182 } ExifDataOption; 00183 00189 const char *exif_data_option_get_name (ExifDataOption o); 00190 00196 const char *exif_data_option_get_description (ExifDataOption o); 00197 00203 void exif_data_set_option (ExifData *d, ExifDataOption o); 00204 00210 void exif_data_unset_option (ExifData *d, ExifDataOption o); 00211 00217 void exif_data_set_data_type (ExifData *d, ExifDataType dt); 00218 00224 ExifDataType exif_data_get_data_type (ExifData *d); 00225 00231 void exif_data_dump (ExifData *data); 00232 00238 void exif_data_log (ExifData *data, ExifLog *log); 00239 00248 #define exif_data_get_entry(d,t) \ 00249 (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ? \ 00250 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) : \ 00251 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ? \ 00252 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) : \ 00253 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ? \ 00254 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) : \ 00255 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ? \ 00256 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) : \ 00257 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ? \ 00258 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL) 00259 00260 #ifdef __cplusplus 00261 } 00262 #endif /* __cplusplus */ 00263 00264 #endif /* __EXIF_DATA_H__ */