EXIF library (libexif) API: libexif/exif-data.h Source File

Main Page | Directories | File List | Globals | Related Pages

# exif-data.h

Go to the documentation of this file.

    00001
    00023 #ifndef __EXIF_DATA_H__
    00024 #define __EXIF_DATA_H__
    00025
    00026 #ifdef __cplusplus
    00027 extern "C" {
    00028 #endif /* __cplusplus */
    00029
    00030 #include <libexif/exif-byte-order.h>
    00031 #include <libexif/exif-data-type.h>
    00032 #include <libexif/exif-ifd.h>
    00033 #include <libexif/exif-log.h>
    00034 #include <libexif/exif-tag.h>
    00035
    00036 typedef struct _ExifData        ExifData;
    00037 typedef struct _ExifDataPrivate ExifDataPrivate;
    00038
    00039 #include <libexif/exif-content.h>
    00040 #include <libexif/exif-mnote-data.h>
    00041 #include <libexif/exif-mem.h>
    00042
    00043 struct _ExifData
    00044 {
    00045         ExifContent *ifd[EXIF_IFD_COUNT];
    00046
    00047         unsigned char *data;
    00048         unsigned int size;
    00049
    00050         ExifDataPrivate *priv;
    00051 };
    00052
    00053 ExifData *exif_data_new           (void);
    00054 ExifData *exif_data_new_mem       (ExifMem *);
    00055
    00061 ExifData *exif_data_new_from_file (const char *path);
    00062 ExifData *exif_data_new_from_data (const unsigned char *data,
    00063                                    unsigned int size);
    00064
    00065 void      exif_data_load_data (ExifData *data, const unsigned char *d,
    00066                                unsigned int size);
    00067 void      exif_data_save_data (ExifData *data, unsigned char **d,
    00068                                unsigned int *size);
    00069
    00070 void      exif_data_ref   (ExifData *data);
    00071 void      exif_data_unref (ExifData *data);
    00072 void      exif_data_free  (ExifData *data);
    00073
    00074 ExifByteOrder exif_data_get_byte_order  (ExifData *data);
    00075 void          exif_data_set_byte_order  (ExifData *data, ExifByteOrder order);
    00076
    00077 ExifMnoteData *exif_data_get_mnote_data (ExifData *);
    00078 void           exif_data_fix (ExifData *);
    00079
    00080 typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data);
    00081 void          exif_data_foreach_content (ExifData *data,
    00082                                          ExifDataForeachContentFunc func,
    00083                                          void *user_data);
    00084
    00085 typedef enum {
    00086         EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0,
    00087         EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1,
    00088         EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2
    00089 } ExifDataOption;
    00090
    00091 const char *exif_data_option_get_name        (ExifDataOption);
    00092 const char *exif_data_option_get_description (ExifDataOption);
    00093 void        exif_data_set_option             (ExifData *, ExifDataOption);
    00094 void        exif_data_unset_option           (ExifData *, ExifDataOption);
    00095
    00096 void         exif_data_set_data_type (ExifData *, ExifDataType);
    00097 ExifDataType exif_data_get_data_type (ExifData *);
    00098
    00099 /* For debugging purposes and error reporting */
    00100 void exif_data_dump (ExifData *data);
    00101 void exif_data_log  (ExifData *data, ExifLog *log);
    00102
    00103 /* For your convenience */
    00104 #define exif_data_get_entry(d,t)                                        \
    00105         (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?                 \
    00106          exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :                 \
    00107          exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?                 \
    00108          exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :                 \
    00109          exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?              \
    00110          exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :              \
    00111          exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?               \
    00112          exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :               \
    00113          exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?  \
    00114          exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
    00115
    00116 #ifdef __cplusplus
    00117 }
    00118 #endif /* __cplusplus */
    00119
    00120 #endif /* __EXIF_DATA_H__ */