exif.h

Go to the documentation of this file.
00001 
00012 #ifndef _gphoto_exif_
00013 #define _gphoto_exif_ 
00014 #include <stdio.h>
00015 #include <stdlib.h>
00016 #include <string.h>
00017 #include <time.h>
00018 #include <sys/time.h>
00019 #include <fcntl.h>
00020 
00021 
00022 /*
00023  * Tag data type information.
00024  */
00025 typedef enum {
00026         EXIF_NOTYPE     = 0,    /* placeholder */
00027         EXIF_BYTE       = 1,    /* 8-bit unsigned integer */
00028         EXIF_ASCII      = 2,    /* 8-bit bytes w/ last byte null */
00029         EXIF_SHORT      = 3,    /* 16-bit unsigned integer */
00030         EXIF_LONG       = 4,    /* 32-bit unsigned integer */
00031         EXIF_RATIONAL   = 5,    /* 64-bit unsigned fraction */
00032         EXIF_SBYTE      = 6,    /* !8-bit signed integer */
00033         EXIF_UNDEFINED  = 7,    /* !8-bit untyped data */
00034         EXIF_SSHORT     = 8,    /* !16-bit signed integer */
00035         EXIF_SLONG      = 9,    /* !32-bit signed integer */
00036         EXIF_SRATIONAL  = 10,   /* !64-bit signed fraction */
00037         EXIF_FLOAT      = 11,   /* !32-bit IEEE floating point */
00038         EXIF_DOUBLE     = 12    /* !64-bit IEEE floating point */
00039 } EXIFDataType;
00040 
00041 
00042 typedef struct exif_parser {
00043   unsigned char *header,*data,*ifds[10];
00044   int ifdtags[10];  /* How many tags in each ifd */
00045   int ifdcnt;       /* Number of IFD's, assumed to be < 10  */
00046   unsigned int exiflen;
00047   int preparsed,endian;
00048 } exifparser;
00049 
00050 typedef struct {
00051     int tag;            /* Tag ID, see exif_tags.h */
00052     EXIFDataType type;  /* Tag data type, see exif_tags.h */
00053     int size;           /* Length of the data, in bytes. */
00054     unsigned char *data;         /* The data itself, not an offset */
00055     int num;     /* When type is (s)rational, we */
00056     int den;   /* store the value here... */
00057     int intval;
00058 } ExifData;
00059 
00060 /*
00061  * The same as gpi_exif_get_thumbnail but returns
00062  * also the thumbnail size
00063  */
00064 unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size);
00065 
00066 /*
00067  * COMMENT ME
00068  */
00069 int gpi_exif_stat(exifparser *exifdata);
00070 
00071 /*
00072  * Now, all the 'defines'
00073  */
00074 
00075 #define EXIF_InteroperabilityIndex 0x1
00076 #define EXIF_InteroperabilityVersion    0x2
00077 #define EXIF_RelatedImageFileFormat 0x1000
00078 #define EXIF_RelatedImageWidth 0x1001
00079 #define EXIF_RelatedImageLength 0x1002
00080 
00081 #define EXIF_NewSubFileType              0xFE
00082 #define EXIF_ImageWidth                  0x100
00083 #define EXIF_ImageLength                 0x101
00084 #define EXIF_BitsPerSample               0x102
00085 #define EXIF_Compression                 0x103
00086 #define EXIF_PhotometricInterpretation   0x106
00087 #define EXIF_FillOrder                   0x10A
00088 #define EXIF_DocumentName                0x10D
00089 #define EXIF_ImageDescription            0x10E
00090 #define EXIF_Make                        0x10F
00091 #define EXIF_Model                       0x110
00092 #define EXIF_StripOffsets                0x111
00093 #define EXIF_Orientation                 0x112
00094 #define EXIF_SamplesPerPixel             0x115
00095 #define EXIF_RowsPerStrip                0x116
00096 #define EXIF_StripByteCounts             0x117
00097 #define EXIF_XResolution                 0x11A
00098 #define EXIF_YResolution                 0x11B
00099 #define EXIF_PlanarConfiguration         0x11C
00100 #define EXIF_ResolutionUnit              0x128
00101 #define EXIF_TransferFunction            0x12D
00102 #define EXIF_Software                    0x131
00103 #define EXIF_DateTime                    0x132
00104 #define EXIF_Artist                      0x13B
00105 #define EXIF_WhitePoint                  0x13E
00106 #define EXIF_PrimaryChromaticities       0x13F
00107 #define EXIF_TransferRange               0x156
00108 #define EXIF_JPEGProc                    0x200
00109 #define EXIF_JPEGInterchangeFormat       0x201
00110 #define EXIF_JPEGInterchangeFormatLength 0x202
00111 #define EXIF_YCbCrCoefficients           0x211
00112 #define EXIF_YCbCrSubSampling            0x212
00113 #define EXIF_YCbCrPositioning            0x213
00114 #define EXIF_ReferenceBlackWhite         0x214
00115 #define EXIF_CFARepeatPatternDim        0x828D
00116 #define EXIF_CFAPattern                 0x828E
00117 #define EXIF_BatteryLevel               0x828F
00118 #define EXIF_Copyright                  0x8298
00119 #define EXIF_ExposureTime               0x829A
00120 #define EXIF_FNumber                    0x829D
00121 /* Be careful: the next tag's official name is IPTC/NAA but
00122    we can't do a define with a "/" */
00123 #define EXIF_IPTC_NAA                   0x83BB
00124 #define EXIF_ExifOffset                 0x8769
00125 #define EXIF_InterColorProfile          0x8773
00126 #define EXIF_ExposureProgram            0x8822
00127 #define EXIF_SpectralSensitivity        0x8824
00128 #define EXIF_GPSInfo                    0x8825
00129 #define EXIF_ISOSpeedRatings            0x8827
00130 #define EXIF_OECF                       0x8828
00131 #define EXIF_ExifVersion                0x9000
00132 #define EXIF_DateTimeOriginal           0x9003
00133 #define EXIF_DateTimeDigitized          0x9004
00134 #define EXIF_ComponentsConfiguration    0x9101
00135 #define EXIF_CompressedBitsPerPixel     0x9102
00136 #define EXIF_ShutterSpeedValue          0x9201
00137 #define EXIF_ApertureValue              0x9202
00138 #define EXIF_BrightnessValue            0x9203
00139 #define EXIF_ExposureBiasValue          0x9204
00140 #define EXIF_MaxApertureValue           0x9205
00141 #define EXIF_SubjectDistance            0x9206
00142 #define EXIF_MeteringMode               0x9207
00143 #define EXIF_LightSource                0x9208
00144 #define EXIF_Flash                      0x9209
00145 #define EXIF_FocalLength                0x920A
00146 #define EXIF_MakerNote                  0x927C
00147 #define EXIF_UserComment                0x9286
00148 #define EXIF_SubSecTime                 0x9290
00149 #define EXIF_SubSecTimeOriginal         0x9291
00150 #define EXIF_SubSecTimeDigitized        0x9292
00151 #define EXIF_FlashPixVersion            0xA000
00152 #define EXIF_ColorSpace                 0xA001
00153 #define EXIF_ExifImageWidth             0xA002
00154 #define EXIF_ExifImageLength            0xA003
00155 #define EXIF_InteroperabilityOffset     0xA005
00156 #define EXIF_FlashEnergy                0xA20B  /* 0x920B in TIFF/EP */
00157 #define EXIF_SpatialFrequencyResponse   0xA20C  /* 0x920C    -  - */
00158 #define EXIF_FocalPlaneXResolution      0xA20E  /* 0x920E    -  - */
00159 #define EXIF_FocalPlaneYResolution      0xA20F  /* 0x920F    -  - */
00160 #define EXIF_FocalPlaneResolutionUnit   0xA210  /* 0x9210    -  - */
00161 #define EXIF_SubjectLocation            0xA214  /* 0x9214    -  - */
00162 #define EXIF_ExposureIndex              0xA215  /* 0x9215    -  - */
00163 #define EXIF_SensingMethod              0xA217  /* 0x9217    -  - */
00164 #define EXIF_FileSource                 0xA300
00165 #define EXIF_SceneType                  0xA301
00166 
00167 #endif /* _gphoto_exif_ */

Generated on 25 Apr 2017 for libgphoto2 photo camera library (libgphoto2) API by  doxygen 1.6.1