00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #define EXIFOFFSETTAG 0x8769
00031 #define INTEROPERABILITYOFFSET 0xA005
00032 #define GPSOFFSETTAG 0x8825
00033 #define MAXSTRINGLENGTH 65535
00034
00035 #ifdef RENAME_INTERNAL_LIBTIFF_SYMBOLS
00036 #include "../frmts/gtiff/libtiff/gdal_libtiff_symbol_rename.h"
00037 #endif
00038
00039 static const struct gpsname {
00040 GUInt16 tag;
00041 const char* name;
00042 } gpstags [] = {
00043 { 0x00, "EXIF_GPSVersionID" },
00044 { 0x01, "EXIF_GPSLatitudeRef" },
00045 { 0x02, "EXIF_GPSLatitude" },
00046 { 0x03, "EXIF_GPSLongitudeRef" },
00047 { 0x04, "EXIF_GPSLongitude" },
00048 { 0x05, "EXIF_GPSAltitudeRef" },
00049 { 0x06, "EXIF_GPSAltitude" },
00050 { 0x07, "EXIF_GPSTimeStamp" },
00051 { 0x08, "EXIF_GPSSatellites" },
00052 { 0x09, "EXIF_GPSStatus" },
00053 { 0x0a, "EXIF_GPSMeasureMode" },
00054 { 0x0b, "EXIF_GPSDOP" },
00055 { 0x0c, "EXIF_GPSSpeedRef"},
00056 { 0x0d, "EXIF_GPSSpeed"},
00057 { 0x0e, "EXIF_GPSTrackRef"},
00058 { 0x0f, "EXIF_GPSTrack"},
00059 { 0x10, "EXIF_GPSImgDirectionRef"},
00060 { 0x11, "EXIF_GPSImgDirection"},
00061 { 0x12, "EXIF_GPSMapDatum"},
00062 { 0x13, "EXIF_GPSDestLatitudeRef"},
00063 { 0x14, "EXIF_GPSDestLatitude"},
00064 { 0x15, "EXIF_GPSDestLongitudeRef"},
00065 { 0x16, "EXIF_GPSDestLongitude"},
00066 { 0x17, "EXIF_GPSDestBearingRef"},
00067 { 0x18, "EXIF_GPSDestBearing"},
00068 { 0x19, "EXIF_GPSDestDistanceRef"},
00069 { 0x1a, "EXIF_GPSDestDistance"},
00070 { 0x1b, "EXIF_GPSProcessingMethod"},
00071 { 0x1c, "EXIF_GPSAreaInformation"},
00072 { 0x1d, "EXIF_GPSDateStamp"},
00073 { 0x1e, "EXIF_GPSDifferential"},
00074 { 0xffff, ""}
00075 };
00076
00077 static const struct tagname {
00078 GUInt16 tag;
00079 const char* name;
00080 } tagnames [] = {
00081
00082
00083
00084 { 0x102, "EXIF_BitsPerSample"},
00085 { 0x103, "EXIF_Compression"},
00086 { 0x106, "EXIF_PhotometricInterpretation"},
00087 { 0x10A, "EXIF_Fill_Order"},
00088 { 0x10D, "EXIF_Document_Name"},
00089 { 0x10E, "EXIF_ImageDescription"},
00090 { 0x10F, "EXIF_Make"},
00091 { 0x110, "EXIF_Model"},
00092 { 0x111, "EXIF_StripOffsets"},
00093 { 0x112, "EXIF_Orientation"},
00094 { 0x115, "EXIF_SamplesPerPixel"},
00095 { 0x116, "EXIF_RowsPerStrip"},
00096 { 0x117, "EXIF_StripByteCounts"},
00097 { 0x11A, "EXIF_XResolution"},
00098 { 0x11B, "EXIF_YResolution"},
00099 { 0x11C, "EXIF_PlanarConfiguration"},
00100 { 0x128, "EXIF_ResolutionUnit"},
00101 { 0x12D, "EXIF_TransferFunction"},
00102 { 0x131, "EXIF_Software"},
00103 { 0x132, "EXIF_DateTime"},
00104 { 0x13B, "EXIF_Artist"},
00105 { 0x13E, "EXIF_WhitePoint"},
00106 { 0x13F, "EXIF_PrimaryChromaticities"},
00107 { 0x156, "EXIF_Transfer_Range"},
00108 { 0x200, "EXIF_JPEG_Proc"},
00109 { 0x201, "EXIF_JPEGInterchangeFormat"},
00110 { 0x202, "EXIF_JPEGInterchangeFormatLength"},
00111 { 0x211, "EXIF_YCbCrCoefficients"},
00112 { 0x212, "EXIF_YCbCrSubSampling"},
00113 { 0x213, "EXIF_YCbCrPositioning"},
00114 { 0x214, "EXIF_ReferenceBlackWhite"},
00115 { 0x828D, "EXIF_CFA_Repeat_Pattern_Dim"},
00116 { 0x828E, "EXIF_CFA_Pattern"},
00117 { 0x828F, "EXIF_Battery_Level"},
00118 { 0x8298, "EXIF_Copyright"},
00119 { 0x829A, "EXIF_ExposureTime"},
00120 { 0x829D, "EXIF_FNumber"},
00121 { 0x83BB, "EXIF_IPTC/NAA"},
00122
00123 { 0x8773, "EXIF_Inter_Color_Profile"},
00124 { 0x8822, "EXIF_ExposureProgram"},
00125 { 0x8824, "EXIF_SpectralSensitivity"},
00126
00127 { 0x8827, "EXIF_ISOSpeedRatings"},
00128 { 0x8828, "EXIF_OECF"},
00129 { 0x9000, "EXIF_ExifVersion"},
00130 { 0x9003, "EXIF_DateTimeOriginal"},
00131 { 0x9004, "EXIF_DateTimeDigitized"},
00132 { 0x9101, "EXIF_ComponentsConfiguration"},
00133 { 0x9102, "EXIF_CompressedBitsPerPixel"},
00134 { 0x9201, "EXIF_ShutterSpeedValue"},
00135 { 0x9202, "EXIF_ApertureValue"},
00136 { 0x9203, "EXIF_BrightnessValue"},
00137 { 0x9204, "EXIF_ExposureBiasValue"},
00138 { 0x9205, "EXIF_MaxApertureValue"},
00139 { 0x9206, "EXIF_SubjectDistance"},
00140 { 0x9207, "EXIF_MeteringMode"},
00141 { 0x9208, "EXIF_LightSource"},
00142 { 0x9209, "EXIF_Flash"},
00143 { 0x920A, "EXIF_FocalLength"},
00144 { 0x9214, "EXIF_SubjectArea"},
00145 { 0x927C, "EXIF_MakerNote"},
00146 { 0x9286, "EXIF_UserComment"},
00147 { 0x9290, "EXIF_SubSecTime"},
00148 { 0x9291, "EXIF_SubSecTime_Original"},
00149 { 0x9292, "EXIF_SubSecTime_Digitized"},
00150 { 0xA000, "EXIF_FlashpixVersion"},
00151 { 0xA001, "EXIF_ColorSpace"},
00152 { 0xA002, "EXIF_PixelXDimension"},
00153 { 0xA003, "EXIF_PixelYDimension"},
00154 { 0xA004, "EXIF_RelatedSoundFile"},
00155
00156 { 0xA20B, "EXIF_FlashEnergy"},
00157 { 0xA20C, "EXIF_SpatialFrequencyResponse"},
00158 { 0xA20E, "EXIF_FocalPlaneXResolution"},
00159 { 0xA20F, "EXIF_FocalPlaneYResolution"},
00160 { 0xA210, "EXIF_FocalPlaneResolutionUnit"},
00161 { 0xA214, "EXIF_SubjectLocation"},
00162 { 0xA215, "EXIF_ExposureIndex"},
00163 { 0xA217, "EXIF_SensingMethod"},
00164 { 0xA300, "EXIF_FileSource"},
00165 { 0xA301, "EXIF_SceneType"},
00166 { 0xA302, "EXIF_CFAPattern"},
00167 { 0xA401, "EXIF_CustomRendered"},
00168 { 0xA402, "EXIF_ExposureMode"},
00169 { 0XA403, "EXIF_WhiteBalance"},
00170 { 0xA404, "EXIF_DigitalZoomRatio"},
00171 { 0xA405, "EXIF_FocalLengthIn35mmFilm"},
00172 { 0xA406, "EXIF_SceneCaptureType"},
00173 { 0xA407, "EXIF_GainControl"},
00174 { 0xA408, "EXIF_Contrast"},
00175 { 0xA409, "EXIF_Saturation"},
00176 { 0xA40A, "EXIF_Sharpness"},
00177 { 0xA40B, "EXIF_DeviceSettingDescription"},
00178 { 0xA40C, "EXIF_SubjectDistanceRange"},
00179 { 0xA420, "EXIF_ImageUniqueID"},
00180 { 0x0000, ""}
00181 };
00182
00183
00184 static const struct intr_tag {
00185 GInt16 tag;
00186 const char* name;
00187 } intr_tags [] = {
00188
00189 { 0x1, "EXIF_Interoperability_Index"},
00190 { 0x2, "EXIF_Interoperability_Version"},
00191 { 0x1000, "EXIF_Related_Image_File_Format"},
00192 { 0x1001, "EXIF_Related_Image_Width"},
00193 { 0x1002, "EXIF_Related_Image_Length"},
00194 { 0x0000, ""}
00195 };
00196
00197 typedef enum {
00198 TIFF_NOTYPE = 0,
00199 TIFF_BYTE = 1,
00200 TIFF_ASCII = 2,
00201 TIFF_SHORT = 3,
00202 TIFF_LONG = 4,
00203 TIFF_RATIONAL = 5,
00204 TIFF_SBYTE = 6,
00205 TIFF_UNDEFINED = 7,
00206 TIFF_SSHORT = 8,
00207 TIFF_SLONG = 9,
00208 TIFF_SRATIONAL = 10,
00209 TIFF_FLOAT = 11,
00210 TIFF_DOUBLE = 12,
00211 TIFF_IFD = 13
00212 } TIFFDataType;
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225 typedef struct {
00226 GUInt16 tdir_tag;
00227 GUInt16 tdir_type;
00228 GUInt32 tdir_count;
00229 GUInt32 tdir_offset;
00230 } TIFFDirEntry;
00231
00232 CPL_C_START
00233 extern int TIFFDataWidth(TIFFDataType);
00234 extern void TIFFSwabShort(GUInt16*);
00235 extern void TIFFSwabLong(GUInt32*);
00236 extern void TIFFSwabDouble(double*);
00237 extern void TIFFSwabArrayOfShort(GUInt16*, unsigned long);
00238 extern void TIFFSwabArrayOfLong(GUInt32*, unsigned long);
00239 extern void TIFFSwabArrayOfDouble(double*, unsigned long);
00240 CPL_C_END
00241