00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00030 #ifndef AVCODEC_TIFF_H
00031 #define AVCODEC_TIFF_H
00032
00033 #include <stdint.h>
00034
00036 enum TiffTags{
00037 TIFF_SUBFILE = 0xfe,
00038 TIFF_WIDTH = 0x100,
00039 TIFF_HEIGHT,
00040 TIFF_BPP,
00041 TIFF_COMPR,
00042 TIFF_INVERT = 0x106,
00043 TIFF_FILL_ORDER = 0x10A,
00044 TIFF_DOCUMENT_NAME = 0x10D,
00045 TIFF_IMAGE_DESCRIPTION = 0x10E,
00046 TIFF_MAKE = 0x10F,
00047 TIFF_MODEL = 0x110,
00048 TIFF_STRIP_OFFS = 0x111,
00049 TIFF_SAMPLES_PER_PIXEL = 0x115,
00050 TIFF_ROWSPERSTRIP = 0x116,
00051 TIFF_STRIP_SIZE,
00052 TIFF_XRES = 0x11A,
00053 TIFF_YRES = 0x11B,
00054 TIFF_PLANAR = 0x11C,
00055 TIFF_PAGE_NAME = 0x11D,
00056 TIFF_XPOS = 0x11E,
00057 TIFF_YPOS = 0x11F,
00058 TIFF_T4OPTIONS = 0x124,
00059 TIFF_T6OPTIONS,
00060 TIFF_RES_UNIT = 0x128,
00061 TIFF_PAGE_NUMBER = 0x129,
00062 TIFF_SOFTWARE_NAME = 0x131,
00063 TIFF_DATE = 0x132,
00064 TIFF_ARTIST = 0x13B,
00065 TIFF_HOST_COMPUTER = 0x13C,
00066 TIFF_PREDICTOR = 0x13D,
00067 TIFF_PAL = 0x140,
00068 TIFF_TILE_WIDTH = 0x142,
00069 TIFF_TILE_LENGTH = 0x143,
00070 TIFF_TILE_OFFSETS = 0x144,
00071 TIFF_TILE_BYTE_COUNTS = 0x145,
00072 TIFF_EXTRASAMPLES = 0x152,
00073 TIFF_YCBCR_COEFFICIENTS = 0x211,
00074 TIFF_YCBCR_SUBSAMPLING = 0x212,
00075 TIFF_YCBCR_POSITIONING = 0x213,
00076 TIFF_REFERENCE_BW = 0x214,
00077 TIFF_COPYRIGHT = 0x8298,
00078 TIFF_MODEL_TIEPOINT = 0x8482,
00079 TIFF_MODEL_PIXEL_SCALE = 0x830E,
00080 TIFF_MODEL_TRANSFORMATION = 0x8480,
00081 TIFF_GEO_KEY_DIRECTORY = 0x87AF,
00082 TIFF_GEO_DOUBLE_PARAMS = 0x87B0,
00083 TIFF_GEO_ASCII_PARAMS = 0x87B1
00084 };
00085
00087 enum TiffCompr{
00088 TIFF_RAW = 1,
00089 TIFF_CCITT_RLE,
00090 TIFF_G3,
00091 TIFF_G4,
00092 TIFF_LZW,
00093 TIFF_JPEG,
00094 TIFF_NEWJPEG,
00095 TIFF_ADOBE_DEFLATE,
00096 TIFF_PACKBITS = 0x8005,
00097 TIFF_DEFLATE = 0x80B2
00098 };
00099
00100 enum TiffTypes{
00101 TIFF_BYTE = 1,
00102 TIFF_STRING,
00103 TIFF_SHORT,
00104 TIFF_LONG,
00105 TIFF_RATIONAL,
00106 TIFF_SBYTE,
00107 TIFF_UNDEFINED,
00108 TIFF_SSHORT,
00109 TIFF_SLONG,
00110 TIFF_SRATIONAL,
00111 TIFF_FLOAT,
00112 TIFF_DOUBLE,
00113 TIFF_IFD
00114 };
00115
00116 enum TiffGeoTagKey {
00117 TIFF_GT_MODEL_TYPE_GEOKEY = 1024,
00118 TIFF_GT_RASTER_TYPE_GEOKEY = 1025,
00119 TIFF_GT_CITATION_GEOKEY = 1026,
00120 TIFF_GEOGRAPHIC_TYPE_GEOKEY = 2048,
00121 TIFF_GEOG_CITATION_GEOKEY = 2049,
00122 TIFF_GEOG_GEODETIC_DATUM_GEOKEY = 2050,
00123 TIFF_GEOG_PRIME_MERIDIAN_GEOKEY = 2051,
00124 TIFF_GEOG_LINEAR_UNITS_GEOKEY = 2052,
00125 TIFF_GEOG_LINEAR_UNIT_SIZE_GEOKEY = 2053,
00126 TIFF_GEOG_ANGULAR_UNITS_GEOKEY = 2054,
00127 TIFF_GEOG_ANGULAR_UNIT_SIZE_GEOKEY = 2055,
00128 TIFF_GEOG_ELLIPSOID_GEOKEY = 2056,
00129 TIFF_GEOG_SEMI_MAJOR_AXIS_GEOKEY = 2057,
00130 TIFF_GEOG_SEMI_MINOR_AXIS_GEOKEY = 2058,
00131 TIFF_GEOG_INV_FLATTENING_GEOKEY = 2059,
00132 TIFF_GEOG_AZIMUTH_UNITS_GEOKEY = 2060,
00133 TIFF_GEOG_PRIME_MERIDIAN_LONG_GEOKEY = 2061,
00134 TIFF_PROJECTED_CS_TYPE_GEOKEY = 3072,
00135 TIFF_PCS_CITATION_GEOKEY = 3073,
00136 TIFF_PROJECTION_GEOKEY = 3074,
00137 TIFF_PROJ_COORD_TRANS_GEOKEY = 3075,
00138 TIFF_PROJ_LINEAR_UNITS_GEOKEY = 3076,
00139 TIFF_PROJ_LINEAR_UNIT_SIZE_GEOKEY = 3077,
00140 TIFF_PROJ_STD_PARALLEL1_GEOKEY = 3078,
00141 TIFF_PROJ_STD_PARALLEL2_GEOKEY = 3079,
00142 TIFF_PROJ_NAT_ORIGIN_LONG_GEOKEY = 3080,
00143 TIFF_PROJ_NAT_ORIGIN_LAT_GEOKEY = 3081,
00144 TIFF_PROJ_FALSE_EASTING_GEOKEY = 3082,
00145 TIFF_PROJ_FALSE_NORTHING_GEOKEY = 3083,
00146 TIFF_PROJ_FALSE_ORIGIN_LONG_GEOKEY = 3084,
00147 TIFF_PROJ_FALSE_ORIGIN_LAT_GEOKEY = 3085,
00148 TIFF_PROJ_FALSE_ORIGIN_EASTING_GEOKEY = 3086,
00149 TIFF_PROJ_FALSE_ORIGIN_NORTHING_GEOKEY = 3087,
00150 TIFF_PROJ_CENTER_LONG_GEOKEY = 3088,
00151 TIFF_PROJ_CENTER_LAT_GEOKEY = 3089,
00152 TIFF_PROJ_CENTER_EASTING_GEOKEY = 3090,
00153 TIFF_PROJ_CENTER_NORTHING_GEOKEY = 3091,
00154 TIFF_PROJ_SCALE_AT_NAT_ORIGIN_GEOKEY = 3092,
00155 TIFF_PROJ_SCALE_AT_CENTER_GEOKEY = 3093,
00156 TIFF_PROJ_AZIMUTH_ANGLE_GEOKEY = 3094,
00157 TIFF_PROJ_STRAIGHT_VERT_POLE_LONG_GEOKEY = 3095,
00158 TIFF_VERTICAL_CS_TYPE_GEOKEY = 4096,
00159 TIFF_VERTICAL_CITATION_GEOKEY = 4097,
00160 TIFF_VERTICAL_DATUM_GEOKEY = 4098,
00161 TIFF_VERTICAL_UNITS_GEOKEY = 4099
00162 };
00163
00164 enum TiffGeoTagType {
00165 GEOTIFF_SHORT = 0,
00166 GEOTIFF_DOUBLE = 34736,
00167 GEOTIFF_STRING = 34737
00168 };
00169
00171 static const uint8_t type_sizes[14] = {
00172 0, 1, 100, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4
00173 };
00174
00175 typedef struct TiffGeoTag {
00176 enum TiffGeoTagKey key;
00177 enum TiffTags type;
00178 int count;
00179 int offset;
00180 char *val;
00181 } TiffGeoTag;
00182
00183 typedef struct TiffGeoTagKeyName {
00184 const enum TiffGeoTagKey key;
00185 const char *const name;
00186 } TiffGeoTagKeyName;
00187
00188 typedef struct TiffGeoTagNameType {
00189 const char *const name;
00190 const enum TiffGeoTagType type;
00191 } TiffGeoTagNameType;
00192
00193 #endif