LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
tif_dir.h File Reference

Define private directory storage, field schemas, and presence bits. More...

#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.

Data Structures

struct  TIFFTagValue
 Store one custom field value and its descriptor. More...
 
struct  TIFFDirEntry
 Represent a parsed directory entry before value conversion. More...
 
struct  TIFFEntryOffsetAndLength
 Describe an external directory-value byte range. More...
 
struct  TIFFDirectory
 Store the current directory values and image traversal state. More...
 
struct  _TIFFFieldArray
 Describe a borrowed schema or owned compatibility batch. More...
 
struct  _TIFFField
 Describe a field's file type and internal argument contract. More...
 

Macros

#define FIELDSET_ITEMS   4
 Size of the presence bitmap in uint32_t words.
 
#define NOSTRIP   ((uint32_t)(-1)) /* undefined state */
 Represent the absence of a current strip with UINT32_MAX.
 
#define NOTILE   ((uint32_t)(-1)) /* undefined state */
 Represent the absence of a current tile with UINT32_MAX.
 
#define FIELD_IGNORE   0
 Mark a processed-but-discarded tag; bit zero is reserved.
 
#define FIELD_IMAGEDIMENSIONS   1
 Index the image dimensions presence bit; not an on-disk tag number.
 
#define FIELD_TILEDIMENSIONS   2
 Index the tile dimensions presence bit; not an on-disk tag number.
 
#define FIELD_RESOLUTION   3
 Index the resolution presence bit; not an on-disk tag number.
 
#define FIELD_POSITION   4
 Index the position presence bit; not an on-disk tag number.
 
#define FIELD_SUBFILETYPE   5
 Index the subfile type presence bit; not an on-disk tag number.
 
#define FIELD_BITSPERSAMPLE   6
 Index the bits per sample presence bit; not an on-disk tag number.
 
#define FIELD_COMPRESSION   7
 Index the compression presence bit; not an on-disk tag number.
 
#define FIELD_PHOTOMETRIC   8
 Index the photometric presence bit; not an on-disk tag number.
 
#define FIELD_THRESHHOLDING   9
 Index the thresholding presence bit; not an on-disk tag number.
 
#define FIELD_FILLORDER   10
 Index the fill order presence bit; not an on-disk tag number.
 
#define FIELD_ORIENTATION   15
 Index the orientation presence bit; not an on-disk tag number.
 
#define FIELD_SAMPLESPERPIXEL   16
 Index the samples per pixel presence bit; not an on-disk tag number.
 
#define FIELD_ROWSPERSTRIP   17
 Index the rows per strip presence bit; not an on-disk tag number.
 
#define FIELD_MINSAMPLEVALUE   18
 Index the minimum sample value presence bit; not an on-disk tag number.
 
#define FIELD_MAXSAMPLEVALUE   19
 Index the maximum sample value presence bit; not an on-disk tag number.
 
#define FIELD_PLANARCONFIG   20
 Index the planar configuration presence bit; not an on-disk tag number.
 
#define FIELD_RESOLUTIONUNIT   22
 Index the resolution unit presence bit; not an on-disk tag number.
 
#define FIELD_PAGENUMBER   23
 Index the page number presence bit; not an on-disk tag number.
 
#define FIELD_STRIPBYTECOUNTS   24
 Index the strile byte counts presence bit; not an on-disk tag number.
 
#define FIELD_STRIPOFFSETS   25
 Index the strile offsets presence bit; not an on-disk tag number.
 
#define FIELD_COLORMAP   26
 Index the colormap presence bit; not an on-disk tag number.
 
#define FIELD_EXTRASAMPLES   31
 Index the extra samples presence bit; not an on-disk tag number.
 
#define FIELD_SAMPLEFORMAT   32
 Index the sample format presence bit; not an on-disk tag number.
 
#define FIELD_SMINSAMPLEVALUE   33
 Index the per-sample minimum presence bit; not an on-disk tag number.
 
#define FIELD_SMAXSAMPLEVALUE   34
 Index the per-sample maximum presence bit; not an on-disk tag number.
 
#define FIELD_IMAGEDEPTH   35
 Index the image depth presence bit; not an on-disk tag number.
 
#define FIELD_TILEDEPTH   36
 Index the tile depth presence bit; not an on-disk tag number.
 
#define FIELD_HALFTONEHINTS   37
 Index the halftone hints presence bit; not an on-disk tag number.
 
#define FIELD_YCBCRSUBSAMPLING   39
 Index the YCbCr subsampling presence bit; not an on-disk tag number.
 
#define FIELD_YCBCRPOSITIONING   40
 Index the YCbCr positioning presence bit; not an on-disk tag number.
 
#define FIELD_REFBLACKWHITE   41
 Index the reference black/white presence bit; not an on-disk tag number.
 
#define FIELD_TRANSFERFUNCTION   44
 Index the transfer function presence bit; not an on-disk tag number.
 
#define FIELD_INKNAMES   46
 Index the ink names presence bit; not an on-disk tag number.
 
#define FIELD_SUBIFD   49
 Index the child IFD presence bit; not an on-disk tag number.
 
#define FIELD_NUMBEROFINKS   50
 Index the number of inks presence bit; not an on-disk tag number.
 
#define FIELD_CODEC   66 /* base of codec-private tags */
 Start the range reserved for codec-private presence bits.
 
#define FIELD_PSEUDO   0
 Share bit zero with FIELD_IGNORE for pseudo-tags.
 
#define FIELD_LAST   (32 * FIELDSET_ITEMS - 1)
 Largest valid presence bit index in the bitmap.
 
#define BITn(n)   (1U << ((n) & 0x1f))
 Construct a one-bit mask within a 32-bit presence word.
 
#define BITFIELDn(tif, n)   ((tif)->tif_dir.td_fieldsset[(n) / 32])
 Select the lvalue word containing a presence bit.
 
#define TIFFFieldSet(tif, field)   (BITFIELDn(tif, field) & BITn(field))
 Test a directory presence bit.
 
#define TIFFSetFieldBit(tif, field)   (BITFIELDn(tif, field) |= BITn(field))
 Set a directory presence bit.
 
#define TIFFClrFieldBit(tif, field)   (BITFIELDn(tif, field) &= ~BITn(field))
 Clear a directory presence bit.
 
#define FieldSet(fields, f)   (fields[(f) / 32] & BITn(f))
 Test a bit in a supplied presence bitmap.
 
#define ResetFieldBit(fields, f)   (fields[(f) / 32] &= ~BITn(f))
 Clear a bit in a supplied presence bitmap.
 

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
}
 Encode the internal value and variadic count representation. More...
 
enum  TIFFFieldArrayType { tfiatImage , tfiatExif , tfiatGps , tfiatOther }
 Identify the namespace described by a field array. More...
 

Functions

void _TIFFResetTifDirAndInitStrileCounters (TIFFDirectory *td)
 Zero directory storage and initialise traversal sentinels.
 
const TIFFFieldArray * _TIFFGetFields (void)
 Return the built-in image field schema.
 
const TIFFFieldArray * _TIFFGetExifFields (void)
 Return the built-in EXIF field schema.
 
const TIFFFieldArray * _TIFFGetGpsFields (void)
 Return the built-in GPS field schema.
 
void _TIFFSetupFields (TIFF *tif, const TIFFFieldArray *fieldarray)
 Replace the registered field-pointer table with a schema.
 
void _TIFFPrintFieldInfo (TIFF *tif, FILE *fd)
 Print the registered field metadata to a stream.
 
int _TIFFFillStriles (TIFF *tif)
 Materialise deferred strile arrays when required.
 
int _TIFFMergeFields (TIFF *tif, const TIFFField info[], uint32_t n)
 Merge borrowed field definitions into the lookup table.
 
const TIFFField * _TIFFFindOrRegisterField (TIFF *tif, uint32_t tag, TIFFDataType dt)
 Find a typed field or register an anonymous replacement.
 
TIFFField * _TIFFCreateAnonField (TIFF *tif, uint32_t tag, TIFFDataType field_type)
 Allocate a counted anonymous field descriptor.
 
int _TIFFCheckFieldIsValidForCodec (TIFF *tif, ttag_t tag)
 Filter recognised codec-specific tags against current compression.
 
int _TIFFCheckDirNumberAndOffset (TIFF *tif, tdir_t dirn, uint64_t diroff)
 Register or validate a chain index/offset pair for loop detection.
 
int _TIFFGetDirNumberFromOffset (TIFF *tif, uint64_t diroff, tdir_t *dirn)
 Resolve a directory offset using the chain maps.
 
int _TIFFGetOffsetFromDirNumber (TIFF *tif, tdir_t dirn, uint64_t *diroff)
 Resolve an index from the existing number-to-offset map.
 
int _TIFFRemoveEntryFromDirectoryListByOffset (TIFF *tif, uint64_t diroff)
 Attempt to remove a shared directory-map entry by offset.
 

Detailed Description

Define private directory storage, field schemas, and presence bits.

Definition in file tif_dir.h.