ReactOS 0.4.15-dev-5672-gf73ac17
tif_dir.h File Reference
#include "tiff.h"
#include "tiffio.h"
Include dependency graph for tif_dir.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TIFFTagValue
 
struct  TIFFDirEntry
 
struct  TIFFDirectory
 
struct  _TIFFFieldArray
 
struct  _TIFFField
 

Macros

#define FIELD_SETLONGS   4
 
#define FIELD_IGNORE   0
 
#define FIELD_IMAGEDIMENSIONS   1
 
#define FIELD_TILEDIMENSIONS   2
 
#define FIELD_RESOLUTION   3
 
#define FIELD_POSITION   4
 
#define FIELD_SUBFILETYPE   5
 
#define FIELD_BITSPERSAMPLE   6
 
#define FIELD_COMPRESSION   7
 
#define FIELD_PHOTOMETRIC   8
 
#define FIELD_THRESHHOLDING   9
 
#define FIELD_FILLORDER   10
 
#define FIELD_ORIENTATION   15
 
#define FIELD_SAMPLESPERPIXEL   16
 
#define FIELD_ROWSPERSTRIP   17
 
#define FIELD_MINSAMPLEVALUE   18
 
#define FIELD_MAXSAMPLEVALUE   19
 
#define FIELD_PLANARCONFIG   20
 
#define FIELD_RESOLUTIONUNIT   22
 
#define FIELD_PAGENUMBER   23
 
#define FIELD_STRIPBYTECOUNTS   24
 
#define FIELD_STRIPOFFSETS   25
 
#define FIELD_COLORMAP   26
 
#define FIELD_EXTRASAMPLES   31
 
#define FIELD_SAMPLEFORMAT   32
 
#define FIELD_SMINSAMPLEVALUE   33
 
#define FIELD_SMAXSAMPLEVALUE   34
 
#define FIELD_IMAGEDEPTH   35
 
#define FIELD_TILEDEPTH   36
 
#define FIELD_HALFTONEHINTS   37
 
#define FIELD_YCBCRSUBSAMPLING   39
 
#define FIELD_YCBCRPOSITIONING   40
 
#define FIELD_REFBLACKWHITE   41
 
#define FIELD_TRANSFERFUNCTION   44
 
#define FIELD_INKNAMES   46
 
#define FIELD_SUBIFD   49
 
#define FIELD_CODEC   66 /* base of codec-private tags */
 
#define FIELD_PSEUDO   0
 
#define FIELD_LAST   (32*FIELD_SETLONGS-1)
 
#define BITn(n)   (((unsigned long)1L)<<((n)&0x1f))
 
#define BITFIELDn(tif, n)   ((tif)->tif_dir.td_fieldsset[(n)/32])
 
#define TIFFFieldSet(tif, field)   (BITFIELDn(tif, field) & BITn(field))
 
#define TIFFSetFieldBit(tif, field)   (BITFIELDn(tif, field) |= BITn(field))
 
#define TIFFClrFieldBit(tif, field)   (BITFIELDn(tif, field) &= ~BITn(field))
 
#define FieldSet(fields, f)   (fields[(f)/32] & BITn(f))
 
#define ResetFieldBit(fields, f)   (fields[(f)/32] &= ~BITn(f))
 

Enumerations

enum  TIFFSetGetFieldType {
  TIFF_SETGET_UNDEFINED = 0 , TIFF_SETGET_ASCII = 1 , TIFF_SETGET_UINT8 = 2 , TIFF_SETGET_SINT8 = 3 ,
  TIFF_SETGET_UINT16 = 4 , TIFF_SETGET_SINT16 = 5 , TIFF_SETGET_UINT32 = 6 , TIFF_SETGET_SINT32 = 7 ,
  TIFF_SETGET_UINT64 = 8 , TIFF_SETGET_SINT64 = 9 , TIFF_SETGET_FLOAT = 10 , TIFF_SETGET_DOUBLE = 11 ,
  TIFF_SETGET_IFD8 = 12 , TIFF_SETGET_INT = 13 , TIFF_SETGET_UINT16_PAIR = 14 , TIFF_SETGET_C0_ASCII = 15 ,
  TIFF_SETGET_C0_UINT8 = 16 , TIFF_SETGET_C0_SINT8 = 17 , TIFF_SETGET_C0_UINT16 = 18 , TIFF_SETGET_C0_SINT16 = 19 ,
  TIFF_SETGET_C0_UINT32 = 20 , TIFF_SETGET_C0_SINT32 = 21 , TIFF_SETGET_C0_UINT64 = 22 , TIFF_SETGET_C0_SINT64 = 23 ,
  TIFF_SETGET_C0_FLOAT = 24 , TIFF_SETGET_C0_DOUBLE = 25 , TIFF_SETGET_C0_IFD8 = 26 , TIFF_SETGET_C16_ASCII = 27 ,
  TIFF_SETGET_C16_UINT8 = 28 , TIFF_SETGET_C16_SINT8 = 29 , TIFF_SETGET_C16_UINT16 = 30 , TIFF_SETGET_C16_SINT16 = 31 ,
  TIFF_SETGET_C16_UINT32 = 32 , TIFF_SETGET_C16_SINT32 = 33 , TIFF_SETGET_C16_UINT64 = 34 , TIFF_SETGET_C16_SINT64 = 35 ,
  TIFF_SETGET_C16_FLOAT = 36 , TIFF_SETGET_C16_DOUBLE = 37 , TIFF_SETGET_C16_IFD8 = 38 , TIFF_SETGET_C32_ASCII = 39 ,
  TIFF_SETGET_C32_UINT8 = 40 , TIFF_SETGET_C32_SINT8 = 41 , TIFF_SETGET_C32_UINT16 = 42 , TIFF_SETGET_C32_SINT16 = 43 ,
  TIFF_SETGET_C32_UINT32 = 44 , TIFF_SETGET_C32_SINT32 = 45 , TIFF_SETGET_C32_UINT64 = 46 , TIFF_SETGET_C32_SINT64 = 47 ,
  TIFF_SETGET_C32_FLOAT = 48 , TIFF_SETGET_C32_DOUBLE = 49 , TIFF_SETGET_C32_IFD8 = 50 , TIFF_SETGET_OTHER = 51
}
 
enum  TIFFFieldArrayType { tfiatImage , tfiatExif , tfiatOther }
 

Functions

const TIFFFieldArray_TIFFGetFields (void)
 
const TIFFFieldArray_TIFFGetExifFields (void)
 
void _TIFFSetupFields (TIFF *tif, const TIFFFieldArray *infoarray)
 
void _TIFFPrintFieldInfo (TIFF *, FILE *)
 
int _TIFFFillStriles (TIFF *)
 
int _TIFFMergeFields (TIFF *, const TIFFField[], uint32)
 
const TIFFField_TIFFFindOrRegisterField (TIFF *, uint32, TIFFDataType)
 
TIFFField_TIFFCreateAnonField (TIFF *, uint32, TIFFDataType)
 
int _TIFFCheckFieldIsValidForCodec (TIFF *tif, ttag_t tag)
 

Macro Definition Documentation

◆ BITFIELDn

#define BITFIELDn (   tif,
  n 
)    ((tif)->tif_dir.td_fieldsset[(n)/32])

Definition at line 195 of file tif_dir.h.

◆ BITn

#define BITn (   n)    (((unsigned long)1L)<<((n)&0x1f))

Definition at line 194 of file tif_dir.h.

◆ FIELD_BITSPERSAMPLE

#define FIELD_BITSPERSAMPLE   6

Definition at line 148 of file tif_dir.h.

◆ FIELD_CODEC

#define FIELD_CODEC   66 /* base of codec-private tags */

Definition at line 179 of file tif_dir.h.

◆ FIELD_COLORMAP

#define FIELD_COLORMAP   26

Definition at line 163 of file tif_dir.h.

◆ FIELD_COMPRESSION

#define FIELD_COMPRESSION   7

Definition at line 149 of file tif_dir.h.

◆ FIELD_EXTRASAMPLES

#define FIELD_EXTRASAMPLES   31

Definition at line 164 of file tif_dir.h.

◆ FIELD_FILLORDER

#define FIELD_FILLORDER   10

Definition at line 152 of file tif_dir.h.

◆ FIELD_HALFTONEHINTS

#define FIELD_HALFTONEHINTS   37

Definition at line 170 of file tif_dir.h.

◆ FIELD_IGNORE

#define FIELD_IGNORE   0

Definition at line 138 of file tif_dir.h.

◆ FIELD_IMAGEDEPTH

#define FIELD_IMAGEDEPTH   35

Definition at line 168 of file tif_dir.h.

◆ FIELD_IMAGEDIMENSIONS

#define FIELD_IMAGEDIMENSIONS   1

Definition at line 141 of file tif_dir.h.

◆ FIELD_INKNAMES

#define FIELD_INKNAMES   46

Definition at line 175 of file tif_dir.h.

◆ FIELD_LAST

#define FIELD_LAST   (32*FIELD_SETLONGS-1)

Definition at line 192 of file tif_dir.h.

◆ FIELD_MAXSAMPLEVALUE

#define FIELD_MAXSAMPLEVALUE   19

Definition at line 157 of file tif_dir.h.

◆ FIELD_MINSAMPLEVALUE

#define FIELD_MINSAMPLEVALUE   18

Definition at line 156 of file tif_dir.h.

◆ FIELD_ORIENTATION

#define FIELD_ORIENTATION   15

Definition at line 153 of file tif_dir.h.

◆ FIELD_PAGENUMBER

#define FIELD_PAGENUMBER   23

Definition at line 160 of file tif_dir.h.

◆ FIELD_PHOTOMETRIC

#define FIELD_PHOTOMETRIC   8

Definition at line 150 of file tif_dir.h.

◆ FIELD_PLANARCONFIG

#define FIELD_PLANARCONFIG   20

Definition at line 158 of file tif_dir.h.

◆ FIELD_POSITION

#define FIELD_POSITION   4

Definition at line 144 of file tif_dir.h.

◆ FIELD_PSEUDO

#define FIELD_PSEUDO   0

Definition at line 190 of file tif_dir.h.

◆ FIELD_REFBLACKWHITE

#define FIELD_REFBLACKWHITE   41

Definition at line 173 of file tif_dir.h.

◆ FIELD_RESOLUTION

#define FIELD_RESOLUTION   3

Definition at line 143 of file tif_dir.h.

◆ FIELD_RESOLUTIONUNIT

#define FIELD_RESOLUTIONUNIT   22

Definition at line 159 of file tif_dir.h.

◆ FIELD_ROWSPERSTRIP

#define FIELD_ROWSPERSTRIP   17

Definition at line 155 of file tif_dir.h.

◆ FIELD_SAMPLEFORMAT

#define FIELD_SAMPLEFORMAT   32

Definition at line 165 of file tif_dir.h.

◆ FIELD_SAMPLESPERPIXEL

#define FIELD_SAMPLESPERPIXEL   16

Definition at line 154 of file tif_dir.h.

◆ FIELD_SETLONGS

#define FIELD_SETLONGS   4

Definition at line 68 of file tif_dir.h.

◆ FIELD_SMAXSAMPLEVALUE

#define FIELD_SMAXSAMPLEVALUE   34

Definition at line 167 of file tif_dir.h.

◆ FIELD_SMINSAMPLEVALUE

#define FIELD_SMINSAMPLEVALUE   33

Definition at line 166 of file tif_dir.h.

◆ FIELD_STRIPBYTECOUNTS

#define FIELD_STRIPBYTECOUNTS   24

Definition at line 161 of file tif_dir.h.

◆ FIELD_STRIPOFFSETS

#define FIELD_STRIPOFFSETS   25

Definition at line 162 of file tif_dir.h.

◆ FIELD_SUBFILETYPE

#define FIELD_SUBFILETYPE   5

Definition at line 147 of file tif_dir.h.

◆ FIELD_SUBIFD

#define FIELD_SUBIFD   49

Definition at line 176 of file tif_dir.h.

◆ FIELD_THRESHHOLDING

#define FIELD_THRESHHOLDING   9

Definition at line 151 of file tif_dir.h.

◆ FIELD_TILEDEPTH

#define FIELD_TILEDEPTH   36

Definition at line 169 of file tif_dir.h.

◆ FIELD_TILEDIMENSIONS

#define FIELD_TILEDIMENSIONS   2

Definition at line 142 of file tif_dir.h.

◆ FIELD_TRANSFERFUNCTION

#define FIELD_TRANSFERFUNCTION   44

Definition at line 174 of file tif_dir.h.

◆ FIELD_YCBCRPOSITIONING

#define FIELD_YCBCRPOSITIONING   40

Definition at line 172 of file tif_dir.h.

◆ FIELD_YCBCRSUBSAMPLING

#define FIELD_YCBCRSUBSAMPLING   39

Definition at line 171 of file tif_dir.h.

◆ FieldSet

#define FieldSet (   fields,
  f 
)    (fields[(f)/32] & BITn(f))

Definition at line 200 of file tif_dir.h.

◆ ResetFieldBit

#define ResetFieldBit (   fields,
  f 
)    (fields[(f)/32] &= ~BITn(f))

Definition at line 201 of file tif_dir.h.

◆ TIFFClrFieldBit

#define TIFFClrFieldBit (   tif,
  field 
)    (BITFIELDn(tif, field) &= ~BITn(field))

Definition at line 198 of file tif_dir.h.

◆ TIFFFieldSet

#define TIFFFieldSet (   tif,
  field 
)    (BITFIELDn(tif, field) & BITn(field))

Definition at line 196 of file tif_dir.h.

◆ TIFFSetFieldBit

#define TIFFSetFieldBit (   tif,
  field 
)    (BITFIELDn(tif, field) |= BITn(field))

Definition at line 197 of file tif_dir.h.

Enumeration Type Documentation

◆ TIFFFieldArrayType

Enumerator
tfiatImage 
tfiatExif 
tfiatOther 

Definition at line 269 of file tif_dir.h.

269 {
271 tfiatExif,
TIFFFieldArrayType
Definition: tif_dir.h:269
@ tfiatOther
Definition: tif_dir.h:272
@ tfiatImage
Definition: tif_dir.h:270
@ tfiatExif
Definition: tif_dir.h:271

◆ TIFFSetGetFieldType

Enumerator
TIFF_SETGET_UNDEFINED 
TIFF_SETGET_ASCII 
TIFF_SETGET_UINT8 
TIFF_SETGET_SINT8 
TIFF_SETGET_UINT16 
TIFF_SETGET_SINT16 
TIFF_SETGET_UINT32 
TIFF_SETGET_SINT32 
TIFF_SETGET_UINT64 
TIFF_SETGET_SINT64 
TIFF_SETGET_FLOAT 
TIFF_SETGET_DOUBLE 
TIFF_SETGET_IFD8 
TIFF_SETGET_INT 
TIFF_SETGET_UINT16_PAIR 
TIFF_SETGET_C0_ASCII 
TIFF_SETGET_C0_UINT8 
TIFF_SETGET_C0_SINT8 
TIFF_SETGET_C0_UINT16 
TIFF_SETGET_C0_SINT16 
TIFF_SETGET_C0_UINT32 
TIFF_SETGET_C0_SINT32 
TIFF_SETGET_C0_UINT64 
TIFF_SETGET_C0_SINT64 
TIFF_SETGET_C0_FLOAT 
TIFF_SETGET_C0_DOUBLE 
TIFF_SETGET_C0_IFD8 
TIFF_SETGET_C16_ASCII 
TIFF_SETGET_C16_UINT8 
TIFF_SETGET_C16_SINT8 
TIFF_SETGET_C16_UINT16 
TIFF_SETGET_C16_SINT16 
TIFF_SETGET_C16_UINT32 
TIFF_SETGET_C16_SINT32 
TIFF_SETGET_C16_UINT64 
TIFF_SETGET_C16_SINT64 
TIFF_SETGET_C16_FLOAT 
TIFF_SETGET_C16_DOUBLE 
TIFF_SETGET_C16_IFD8 
TIFF_SETGET_C32_ASCII 
TIFF_SETGET_C32_UINT8 
TIFF_SETGET_C32_SINT8 
TIFF_SETGET_C32_UINT16 
TIFF_SETGET_C32_SINT16 
TIFF_SETGET_C32_UINT32 
TIFF_SETGET_C32_SINT32 
TIFF_SETGET_C32_UINT64 
TIFF_SETGET_C32_SINT64 
TIFF_SETGET_C32_FLOAT 
TIFF_SETGET_C32_DOUBLE 
TIFF_SETGET_C32_IFD8 
TIFF_SETGET_OTHER 

Definition at line 203 of file tif_dir.h.

203 {
216 TIFF_SETGET_IFD8 = 12,
217 TIFF_SETGET_INT = 13,
TIFFSetGetFieldType
Definition: tif_dir.h:203
@ TIFF_SETGET_C16_UINT8
Definition: tif_dir.h:232
@ TIFF_SETGET_C0_SINT64
Definition: tif_dir.h:227
@ TIFF_SETGET_DOUBLE
Definition: tif_dir.h:215
@ TIFF_SETGET_SINT64
Definition: tif_dir.h:213
@ TIFF_SETGET_C32_SINT32
Definition: tif_dir.h:249
@ TIFF_SETGET_C16_FLOAT
Definition: tif_dir.h:240
@ TIFF_SETGET_UNDEFINED
Definition: tif_dir.h:204
@ TIFF_SETGET_SINT8
Definition: tif_dir.h:207
@ TIFF_SETGET_C32_ASCII
Definition: tif_dir.h:243
@ TIFF_SETGET_INT
Definition: tif_dir.h:217
@ TIFF_SETGET_C32_UINT8
Definition: tif_dir.h:244
@ TIFF_SETGET_IFD8
Definition: tif_dir.h:216
@ TIFF_SETGET_C32_UINT16
Definition: tif_dir.h:246
@ TIFF_SETGET_C16_DOUBLE
Definition: tif_dir.h:241
@ TIFF_SETGET_UINT64
Definition: tif_dir.h:212
@ TIFF_SETGET_C0_UINT32
Definition: tif_dir.h:224
@ TIFF_SETGET_C16_UINT32
Definition: tif_dir.h:236
@ TIFF_SETGET_UINT16_PAIR
Definition: tif_dir.h:218
@ TIFF_SETGET_C32_SINT16
Definition: tif_dir.h:247
@ TIFF_SETGET_C16_UINT16
Definition: tif_dir.h:234
@ TIFF_SETGET_C16_SINT64
Definition: tif_dir.h:239
@ TIFF_SETGET_C0_FLOAT
Definition: tif_dir.h:228
@ TIFF_SETGET_C0_SINT32
Definition: tif_dir.h:225
@ TIFF_SETGET_C16_UINT64
Definition: tif_dir.h:238
@ TIFF_SETGET_C32_UINT32
Definition: tif_dir.h:248
@ TIFF_SETGET_C0_ASCII
Definition: tif_dir.h:219
@ TIFF_SETGET_C32_SINT8
Definition: tif_dir.h:245
@ TIFF_SETGET_UINT16
Definition: tif_dir.h:208
@ TIFF_SETGET_C16_SINT16
Definition: tif_dir.h:235
@ TIFF_SETGET_C0_UINT8
Definition: tif_dir.h:220
@ TIFF_SETGET_ASCII
Definition: tif_dir.h:205
@ TIFF_SETGET_C0_SINT8
Definition: tif_dir.h:221
@ TIFF_SETGET_C16_SINT8
Definition: tif_dir.h:233
@ TIFF_SETGET_OTHER
Definition: tif_dir.h:255
@ TIFF_SETGET_C0_UINT64
Definition: tif_dir.h:226
@ TIFF_SETGET_FLOAT
Definition: tif_dir.h:214
@ TIFF_SETGET_C16_SINT32
Definition: tif_dir.h:237
@ TIFF_SETGET_SINT16
Definition: tif_dir.h:209
@ TIFF_SETGET_C0_SINT16
Definition: tif_dir.h:223
@ TIFF_SETGET_C32_IFD8
Definition: tif_dir.h:254
@ TIFF_SETGET_UINT32
Definition: tif_dir.h:210
@ TIFF_SETGET_C32_SINT64
Definition: tif_dir.h:251
@ TIFF_SETGET_C16_ASCII
Definition: tif_dir.h:231
@ TIFF_SETGET_C32_DOUBLE
Definition: tif_dir.h:253
@ TIFF_SETGET_UINT8
Definition: tif_dir.h:206
@ TIFF_SETGET_C0_UINT16
Definition: tif_dir.h:222
@ TIFF_SETGET_C32_UINT64
Definition: tif_dir.h:250
@ TIFF_SETGET_C0_IFD8
Definition: tif_dir.h:230
@ TIFF_SETGET_C16_IFD8
Definition: tif_dir.h:242
@ TIFF_SETGET_SINT32
Definition: tif_dir.h:211
@ TIFF_SETGET_C32_FLOAT
Definition: tif_dir.h:252
@ TIFF_SETGET_C0_DOUBLE
Definition: tif_dir.h:229

Function Documentation

◆ _TIFFCheckFieldIsValidForCodec()

int _TIFFCheckFieldIsValidForCodec ( TIFF tif,
ttag_t  tag 
)

Definition at line 958 of file tif_dirinfo.c.

959{
960 /* Filter out non-codec specific tags */
961 switch (tag) {
962 /* Shared tags */
964 /* JPEG tags */
966 /* OJPEG tags */
972 case TIFFTAG_JPEGPROC:
974 /* CCITT* */
980 /* LERC */
982 break;
983 default:
984 return 1;
985 }
986 /* Check if codec specific tags are allowed for the current
987 * compression scheme (codec) */
988 switch (tif->tif_dir.td_compression) {
989 case COMPRESSION_LZW:
990 if (tag == TIFFTAG_PREDICTOR)
991 return 1;
992 break;
994 /* No codec-specific tags */
995 break;
997 /* No codec-specific tags */
998 break;
999 case COMPRESSION_NEXT:
1000 /* No codec-specific tags */
1001 break;
1002 case COMPRESSION_JPEG:
1003 if (tag == TIFFTAG_JPEGTABLES)
1004 return 1;
1005 break;
1006 case COMPRESSION_OJPEG:
1007 switch (tag) {
1013 case TIFFTAG_JPEGPROC:
1015 return 1;
1016 }
1017 break;
1022 switch (tag) {
1026 return 1;
1029 return 1;
1030 break;
1033 return 1;
1034 break;
1035 }
1036 break;
1037 case COMPRESSION_JBIG:
1038 /* No codec-specific tags */
1039 break;
1042 if (tag == TIFFTAG_PREDICTOR)
1043 return 1;
1044 break;
1046 if (tag == TIFFTAG_PREDICTOR)
1047 return 1;
1048 break;
1049 case COMPRESSION_SGILOG:
1051 /* No codec-specific tags */
1052 break;
1053 case COMPRESSION_LZMA:
1054 if (tag == TIFFTAG_PREDICTOR)
1055 return 1;
1056 break;
1057 case COMPRESSION_ZSTD:
1058 if (tag == TIFFTAG_PREDICTOR)
1059 return 1;
1060 break;
1061 case COMPRESSION_LERC:
1063 return 1;
1064 break;
1065 case COMPRESSION_WEBP:
1066 if (tag == TIFFTAG_PREDICTOR)
1067 return 1;
1068 break;
1069 }
1070 return 0;
1071}
uint16 td_compression
Definition: tif_dir.h:77
Definition: ecma_167.h:138
TIFFDirectory tif_dir
Definition: tiffiop.h:151
#define COMPRESSION_PIXARLOG
Definition: tiff.h:180
#define COMPRESSION_ZSTD
Definition: tiff.h:192
#define COMPRESSION_CCITTFAX3
Definition: tiff.h:160
#define COMPRESSION_CCITTRLE
Definition: tiff.h:159
#define TIFFTAG_JPEGDCTABLES
Definition: tiff.h:359
#define TIFFTAG_GROUP3OPTIONS
Definition: tiff.h:253
#define TIFFTAG_GROUP4OPTIONS
Definition: tiff.h:258
#define COMPRESSION_OJPEG
Definition: tiff.h:165
#define TIFFTAG_CONSECUTIVEBADFAXLINES
Definition: tiff.h:294
#define COMPRESSION_DEFLATE
Definition: tiff.h:181
#define TIFFTAG_JPEGQTABLES
Definition: tiff.h:358
#define COMPRESSION_SGILOG
Definition: tiff.h:186
#define TIFFTAG_LERC_PARAMETERS
Definition: tiff.h:447
#define COMPRESSION_CCITTRLEW
Definition: tiff.h:170
#define TIFFTAG_JPEGIFBYTECOUNT
Definition: tiff.h:354
#define TIFFTAG_JPEGACTABLES
Definition: tiff.h:360
#define TIFFTAG_JPEGRESTARTINTERVAL
Definition: tiff.h:355
#define COMPRESSION_LZMA
Definition: tiff.h:191
#define COMPRESSION_WEBP
Definition: tiff.h:193
#define COMPRESSION_JBIG
Definition: tiff.h:185
#define COMPRESSION_LERC
Definition: tiff.h:189
#define COMPRESSION_ADOBE_DEFLATE
Definition: tiff.h:182
#define COMPRESSION_PACKBITS
Definition: tiff.h:171
#define COMPRESSION_LZW
Definition: tiff.h:164
#define TIFFTAG_JPEGIFOFFSET
Definition: tiff.h:353
#define TIFFTAG_CLEANFAXDATA
Definition: tiff.h:290
#define COMPRESSION_SGILOG24
Definition: tiff.h:187
#define TIFFTAG_BADFAXLINES
Definition: tiff.h:289
#define TIFFTAG_JPEGPROC
Definition: tiff.h:350
#define COMPRESSION_CCITTFAX4
Definition: tiff.h:162
#define COMPRESSION_NEXT
Definition: tiff.h:169
#define TIFFTAG_PREDICTOR
Definition: tiff.h:277
#define TIFFTAG_JPEGTABLES
Definition: tiff.h:320
#define COMPRESSION_JPEG
Definition: tiff.h:166
#define COMPRESSION_THUNDERSCAN
Definition: tiff.h:172

Referenced by TIFFReadDirectory().

◆ _TIFFCreateAnonField()

TIFFField * _TIFFCreateAnonField ( TIFF tif,
uint32  tag,
TIFFDataType  field_type 
)

Definition at line 634 of file tif_dirinfo.c.

635{
636 TIFFField *fld;
637 (void) tif;
638
639 fld = (TIFFField *) _TIFFmalloc(sizeof (TIFFField));
640 if (fld == NULL)
641 return NULL;
642 _TIFFmemset(fld, 0, sizeof(TIFFField));
643
644 fld->field_tag = tag;
647 fld->field_type = field_type;
648 fld->reserved = 0;
649 switch (field_type)
650 {
651 case TIFF_BYTE:
652 case TIFF_UNDEFINED:
655 break;
656 case TIFF_ASCII:
659 break;
660 case TIFF_SHORT:
663 break;
664 case TIFF_LONG:
667 break;
668 case TIFF_RATIONAL:
669 case TIFF_SRATIONAL:
670 case TIFF_FLOAT:
673 break;
674 case TIFF_SBYTE:
677 break;
678 case TIFF_SSHORT:
681 break;
682 case TIFF_SLONG:
685 break;
686 case TIFF_DOUBLE:
689 break;
690 case TIFF_IFD:
691 case TIFF_IFD8:
694 break;
695 case TIFF_LONG8:
698 break;
699 case TIFF_SLONG8:
702 break;
703 default:
706 break;
707 }
708 fld->field_bit = FIELD_CUSTOM;
709 fld->field_oktochange = TRUE;
710 fld->field_passcount = TRUE;
711 fld->field_name = (char *) _TIFFmalloc(32);
712 if (fld->field_name == NULL) {
713 _TIFFfree(fld);
714 return NULL;
715 }
716 fld->field_subfields = NULL;
717
718 /*
719 * note that this name is a special sign to TIFFClose() and
720 * _TIFFSetupFields() to free the field
721 */
722 (void) snprintf(fld->field_name, 32, "Tag %d", (int) tag);
723
724 return fld;
725}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
uint32 field_tag
Definition: tif_dir.h:283
unsigned char field_oktochange
Definition: tif_dir.h:291
TIFFDataType field_type
Definition: tif_dir.h:286
unsigned char field_passcount
Definition: tif_dir.h:292
char * field_name
Definition: tif_dir.h:293
TIFFSetGetFieldType get_field_type
Definition: tif_dir.h:289
TIFFSetGetFieldType set_field_type
Definition: tif_dir.h:288
unsigned short field_bit
Definition: tif_dir.h:290
short field_readcount
Definition: tif_dir.h:284
uint32 reserved
Definition: tif_dir.h:287
TIFFFieldArray * field_subfields
Definition: tif_dir.h:294
short field_writecount
Definition: tif_dir.h:285
void _TIFFfree(void *p)
Definition: tif_unix.c:326
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
@ TIFF_SSHORT
Definition: tiff.h:132
@ TIFF_SLONG
Definition: tiff.h:133
@ TIFF_BYTE
Definition: tiff.h:125
@ TIFF_SBYTE
Definition: tiff.h:130
@ TIFF_IFD
Definition: tiff.h:137
@ TIFF_SHORT
Definition: tiff.h:127
@ TIFF_UNDEFINED
Definition: tiff.h:131
@ TIFF_LONG
Definition: tiff.h:128
@ TIFF_SLONG8
Definition: tiff.h:139
@ TIFF_LONG8
Definition: tiff.h:138
@ TIFF_ASCII
Definition: tiff.h:126
@ TIFF_FLOAT
Definition: tiff.h:135
@ TIFF_DOUBLE
Definition: tiff.h:136
@ TIFF_IFD8
Definition: tiff.h:140
@ TIFF_SRATIONAL
Definition: tiff.h:134
@ TIFF_RATIONAL
Definition: tiff.h:129
#define FIELD_CUSTOM
Definition: tiffio.h:312
#define TIFF_VARIABLE2
Definition: tiffio.h:310
#define snprintf
Definition: wintirpc.h:48

Referenced by _TIFFFindOrRegisterField(), TIFFReadCustomDirectory(), and TIFFReadDirectory().

◆ _TIFFFillStriles()

int _TIFFFillStriles ( TIFF tif)

Definition at line 6320 of file tif_dirread.c.

6321{
6322 return _TIFFFillStrilesInternal( tif, 1 );
6323}
static int _TIFFFillStrilesInternal(TIFF *tif, int loadStripByteCount)
Definition: tif_dirread.c:6325

Referenced by _TIFFGetStrileOffsetOrByteCountValue(), _TIFFVGetField(), TIFFReadDirectory(), TIFFWriteCheck(), and TIFFWriteDirectorySec().

◆ _TIFFFindOrRegisterField()

const TIFFField * _TIFFFindOrRegisterField ( TIFF tif,
uint32  tag,
TIFFDataType  dt 
)

Definition at line 618 of file tif_dirinfo.c.

620{
621 const TIFFField *fld;
622
623 fld = TIFFFindField(tif, tag, dt);
624 if (fld == NULL) {
625 fld = _TIFFCreateAnonField(tif, tag, dt);
626 if (!_TIFFMergeFields(tif, fld, 1))
627 return NULL;
628 }
629
630 return fld;
631}
const TIFFField * TIFFFindField(TIFF *tif, uint32 tag, TIFFDataType dt)
Definition: tif_dirinfo.c:506
TIFFField * _TIFFCreateAnonField(TIFF *tif, uint32 tag, TIFFDataType field_type)
Definition: tif_dirinfo.c:634
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32 n)
Definition: tif_dirinfo.c:369

◆ _TIFFGetExifFields()

const TIFFFieldArray * _TIFFGetExifFields ( void  )

Definition at line 311 of file tif_dirinfo.c.

312{
313 return(&exifFieldArray);
314}
static const TIFFFieldArray exifFieldArray
Definition: tif_dirinfo.c:49

Referenced by TIFFCreateEXIFDirectory(), and TIFFReadEXIFDirectory().

◆ _TIFFGetFields()

const TIFFFieldArray * _TIFFGetFields ( void  )

Definition at line 305 of file tif_dirinfo.c.

306{
307 return(&tiffFieldArray);
308}
static const TIFFFieldArray tiffFieldArray
Definition: tif_dirinfo.c:48

Referenced by TIFFDefaultDirectory().

◆ _TIFFMergeFields()

int _TIFFMergeFields ( TIFF tif,
const  TIFFField[],
uint32  n 
)

Definition at line 369 of file tif_dirinfo.c.

370{
371 static const char module[] = "_TIFFMergeFields";
372 static const char reason[] = "for fields array";
373 /* TIFFField** tp; */
374 uint32 i;
375
376 tif->tif_foundfield = NULL;
377
378 if (tif->tif_fields && tif->tif_nfields > 0) {
379 tif->tif_fields = (TIFFField**)
381 (tif->tif_nfields + n),
382 sizeof(TIFFField *), reason);
383 } else {
384 tif->tif_fields = (TIFFField **)
385 _TIFFCheckMalloc(tif, n, sizeof(TIFFField *),
386 reason);
387 }
388 if (!tif->tif_fields) {
390 "Failed to allocate fields array");
391 return 0;
392 }
393
394 /* tp = tif->tif_fields + tif->tif_nfields; */
395 for (i = 0; i < n; i++) {
396 const TIFFField *fip =
397 TIFFFindField(tif, info[i].field_tag, TIFF_ANY);
398
399 /* only add definitions that aren't already present */
400 if (!fip) {
401 tif->tif_fields[tif->tif_nfields] = (TIFFField *) (info+i);
402 tif->tif_nfields++;
403 }
404 }
405
406 /* Sort the field info by tag number */
407 qsort(tif->tif_fields, tif->tif_nfields,
408 sizeof(TIFFField *), tagCompare);
409
410 return n;
411}
unsigned int uint32
Definition: types.h:32
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
const TIFFField * tif_foundfield
Definition: tiffiop.h:218
size_t tif_nfields
Definition: tiffiop.h:217
TIFFField ** tif_fields
Definition: tiffiop.h:216
thandle_t tif_clientdata
Definition: tiffiop.h:207
void * _TIFFCheckRealloc(TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:97
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:121
static int tagCompare(const void *a, const void *b)
Definition: tif_dirinfo.c:342
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define TIFF_ANY
Definition: tiffio.h:307

Referenced by _TIFFFindOrRegisterField(), _TIFFSetupFields(), TIFFMergeFieldInfo(), TIFFPredictorInit(), TIFFReadCustomDirectory(), and TIFFReadDirectory().

◆ _TIFFPrintFieldInfo()

void _TIFFPrintFieldInfo ( TIFF tif,
FILE fd 
)

Definition at line 414 of file tif_dirinfo.c.

415{
416 uint32 i;
417
418 fprintf(fd, "%s: \n", tif->tif_name);
419 for (i = 0; i < tif->tif_nfields; i++) {
420 const TIFFField* fip = tif->tif_fields[i];
421 fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n"
422 , (int)i
423 , (unsigned long) fip->field_tag
425 , fip->field_type
426 , fip->field_bit
427 , fip->field_oktochange ? "TRUE" : "FALSE"
428 , fip->field_passcount ? "TRUE" : "FALSE"
429 , fip->field_name
430 );
431 }
432}
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
static int fd
Definition: io.c:51
char * tif_name
Definition: tiffiop.h:116

◆ _TIFFSetupFields()

void _TIFFSetupFields ( TIFF tif,
const TIFFFieldArray infoarray 
)

Definition at line 317 of file tif_dirinfo.c.

318{
319 if (tif->tif_fields && tif->tif_nfields > 0) {
320 uint32 i;
321
322 for (i = 0; i < tif->tif_nfields; i++) {
323 TIFFField *fld = tif->tif_fields[i];
324 if (fld->field_bit == FIELD_CUSTOM &&
325 strncmp("Tag ", fld->field_name, 4) == 0) {
326 _TIFFfree(fld->field_name);
327 _TIFFfree(fld);
328 }
329 }
330
331 _TIFFfree(tif->tif_fields);
332 tif->tif_fields = NULL;
333 tif->tif_nfields = 0;
334 }
335 if (!_TIFFMergeFields(tif, fieldarray->fields, fieldarray->count)) {
336 TIFFErrorExt(tif->tif_clientdata, "_TIFFSetupFields",
337 "Setting up field info failed");
338 }
339}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534

Referenced by TIFFCreateCustomDirectory(), TIFFDefaultDirectory(), and TIFFReadCustomDirectory().