EXIF library (libexif) API
0.6.21
|
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 00106 void exif_data_load_data (ExifData *data, const unsigned char *d, 00107 unsigned int size); 00108 00119 void exif_data_save_data (ExifData *data, unsigned char **d, 00120 unsigned int *ds); 00121 00122 void exif_data_ref (ExifData *data); 00123 void exif_data_unref (ExifData *data); 00124 void exif_data_free (ExifData *data); 00125 00131 ExifByteOrder exif_data_get_byte_order (ExifData *data); 00132 00140 void exif_data_set_byte_order (ExifData *data, ExifByteOrder order); 00141 00150 ExifMnoteData *exif_data_get_mnote_data (ExifData *d); 00151 00159 void exif_data_fix (ExifData *d); 00160 00161 typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data); 00162 00169 void exif_data_foreach_content (ExifData *data, 00170 ExifDataForeachContentFunc func, 00171 void *user_data); 00172 00174 typedef enum { 00176 EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0, 00177 00179 EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1, 00180 00182 EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2 00183 } ExifDataOption; 00184 00190 const char *exif_data_option_get_name (ExifDataOption o); 00191 00197 const char *exif_data_option_get_description (ExifDataOption o); 00198 00204 void exif_data_set_option (ExifData *d, ExifDataOption o); 00205 00211 void exif_data_unset_option (ExifData *d, ExifDataOption o); 00212 00218 void exif_data_set_data_type (ExifData *d, ExifDataType dt); 00219 00225 ExifDataType exif_data_get_data_type (ExifData *d); 00226 00232 void exif_data_dump (ExifData *data); 00233 00239 void exif_data_log (ExifData *data, ExifLog *log); 00240 00249 #define exif_data_get_entry(d,t) \ 00250 (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ? \ 00251 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) : \ 00252 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ? \ 00253 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) : \ 00254 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ? \ 00255 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) : \ 00256 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ? \ 00257 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) : \ 00258 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ? \ 00259 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL) 00260 00261 #ifdef __cplusplus 00262 } 00263 #endif /* __cplusplus */ 00264 00265 #endif /* __EXIF_DATA_H__ */