LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
Data Fields

Store the current directory values and image traversal state. More...

#include <tif_dir.h>

Collaboration diagram for TIFFDirectory:
[legend]

Data Fields

uint32_t td_fieldsset [FIELDSET_ITEMS]
 Presence bitmap indexed by FIELD_* bit numbers.
 
uint32_t td_imagewidth
 Image width in pixels.
 
uint32_t td_imagelength
 Image length in rows.
 
uint32_t td_imagedepth
 Image depth in slices.
 
uint32_t td_tilewidth
 Tile width in pixels.
 
uint32_t td_tilelength
 Tile length in rows.
 
uint32_t td_tiledepth
 Tile depth in slices.
 
uint32_t td_subfiletype
 NewSubfileType flag mask.
 
uint16_t td_bitspersample
 Bits in each sample.
 
uint16_t td_sampleformat
 SAMPLEFORMAT_* interpretation of samples.
 
uint16_t td_compression
 COMPRESSION_* codec identifier.
 
uint16_t td_photometric
 PHOTOMETRIC_* interpretation.
 
uint16_t td_threshholding
 THRESHHOLD_* bilevel rendering convention.
 
uint16_t td_fillorder
 FILLORDER_* bit order within file bytes.
 
uint16_t td_orientation
 ORIENTATION_* storage orientation.
 
uint16_t td_samplesperpixel
 Samples per pixel, including extra samples.
 
uint32_t td_rowsperstrip
 Rows per strip; UINT32_MAX represents one whole-image strip.
 
uint16_t td_minsamplevalue
 Legacy unsigned minimum sample value.
 
uint16_t td_maxsamplevalue
 Legacy unsigned maximum sample value.
 
double * td_sminsamplevalue
 Owned SamplesPerPixel-length array of minimum values, or NULL.
 
double * td_smaxsamplevalue
 Owned SamplesPerPixel-length array of maximum values, or NULL.
 
float td_xresolution
 Horizontal pixels per resolution unit.
 
float td_yresolution
 Vertical pixels per resolution unit.
 
uint16_t td_resolutionunit
 RESUNIT_* unit for resolution and position values.
 
uint16_t td_planarconfig
 PLANARCONFIG_* sample-plane arrangement.
 
float td_xposition
 Horizontal image position in resolution units.
 
float td_yposition
 Vertical image position in resolution units.
 
uint16_t td_pagenumber [2]
 Page index and total-page count as two uint16_t values.
 
uint16_t * td_colormap [3]
 Three owned palette planes of td_colormap_alloc entries each, or NULL slots; presence is FIELD_COLORMAP, not the count.
 
uint32_t td_colormap_count
 Number of entries in each ColorMap plane that the directory uses, zero when none is installed.
 
uint32_t td_colormap_alloc
 Number of entries allocated in each ColorMap plane, zero when none is installed.
 
uint16_t td_halftonehints [2]
 Highlight and shadow grayscale breakpoints.
 
uint16_t td_extrasamples
 Number of extra samples described by td_sampleinfo.
 
uint16_t * td_sampleinfo
 Owned ExtraSamples interpretation array of td_extrasamples entries, or NULL.
 
uint32_t td_row
 Current scanline index; UINT32_MAX before traversal starts.
 
uint32_t td_curstrip
 Current strip index, or NOSTRIP.
 
tmsize_t td_scanlinesize
 Cached decoded scanline size in bytes; zero when not computed.
 
uint32_t td_col
 Current pixel column; UINT32_MAX before traversal starts.
 
uint32_t td_curtile
 Current tile index, or NOTILE.
 
tmsize_t td_tilesize
 Cached decoded tile size in bytes; minus one when invalidated.
 
uint32_t td_stripsperimage
 Strips or tiles per sample plane, despite the historic name.
 
uint32_t td_nstrips
 Total strile count across all planes; logical array length.
 
uint64_t * td_stripoffset_p
 Owned offset array/cache, possibly NULL or partial; use TIFFGetStrileOffset().
 
uint64_t * td_stripbytecount_p
 Owned byte-count array/cache, possibly NULL or partial; use TIFFGetStrileByteCount().
 
uint32_t td_stripoffsetbyteallocsize
 Allocated element capacity of lazy strile offset/count caches, not byte size.
 
TIFFDirEntry td_stripoffset_entry
 Deferred offset entry; tag/type/count are swapped but offset storage is raw.
 
TIFFDirEntry td_stripbytecount_entry
 Deferred byte-count entry; offset storage still requires swapping.
 
uint16_t td_nsubifd
 Number of child-directory offsets in td_subifd.
 
uint64_t * td_subifd
 Owned array of td_nsubifd child-directory offsets, or NULL.
 
uint16_t td_ycbcrsubsampling [2]
 Horizontal and vertical YCbCr subsampling factors.
 
uint16_t td_ycbcrpositioning
 YCBCRPOSITION_* placement convention.
 
uint16_t * td_transferfunction [3]
 Up to three owned gamma curves of td_transferfunction_count entries each.
 
uint32_t td_transferfunction_count
 Number of entries in each installed TransferFunction curve, zero when none is installed; the only record of the curve length.
 
float * td_refblackwhite
 Owned six-float reference black/white array, or NULL.
 
int td_inknameslen
 Byte length of the concatenated ink-name strings, including terminators.
 
char * td_inknames
 Owned concatenated null-terminated ink names, or NULL.
 
uint16_t td_numberofinks
 Number of inks, kept consistent with accepted InkNames where possible.
 
int td_customValueCount
 Number of live records in td_customValues, including partial setter entries.
 
TIFFTagValue * td_customValues
 Owned array of custom-value records, each owning its value.
 
unsigned char td_deferstrilearraywriting
 Nonzero to reserve strile entries for later explicit array writing.
 
unsigned char td_iswrittentofile
 Nonzero when the current directory has an on-file representation.
 
uint64_t td_dirdatasize_write
 Accumulated IFD write size in bytes, including entry space after counting.
 
uint64_t td_dirdatasize_read
 Reusable IFD span including entry space and contiguous external data; UINT64_MAX permits extension at EOF.
 
uint32_t td_dirdatasize_Noffsets
 Number of ranges collected in td_dirdatasize_offsets.
 
TIFFEntryOffsetAndLength * td_dirdatasize_offsets
 Owned auxiliary array of external IFD-value ranges, or NULL.
 

Detailed Description

Store the current directory values and image traversal state.

Embedded in a TIFF handle. Pointer arrays/strings and custom values are owned by the matching handle allocator unless explicitly noted; TIFFFreeDirectory() releases them. Field bits determine which values are present. Defaults can exist with their presence bits clear. Use strile accessors instead of directly dereferencing deferred offset/count arrays. Resetting the structure without first freeing live allocations loses ownership. See Directories for the current documentation boundary.

Definition at line 142 of file tif_dir.h.

Field Documentation

◆ td_bitspersample

uint16_t TIFFDirectory::td_bitspersample

◆ td_col

uint32_t TIFFDirectory::td_col

Current pixel column; UINT32_MAX before traversal starts.

Definition at line 253 of file tif_dir.h.

Referenced by _TIFFResetTifDirAndInitStrileCounters(), TIFFReadAndRealloc(), TIFFReadRawStripOrTile2(), TIFFReadRawTile1(), TIFFStartTile(), and TIFFWriteEncodedTile().

◆ td_colormap

uint16_t* TIFFDirectory::td_colormap[3]

Three owned palette planes of td_colormap_alloc entries each, or NULL slots; presence is FIELD_COLORMAP, not the count.

The first td_colormap_count entries of each plane describe the directory and are written with it. The planes, count and capacity are installed together and the count and capacity are zero when no plane is allocated. Narrowing BitsPerSample shortens the count but keeps the planes, so that widening BitsPerSample again up to the capacity restores the entries.

Definition at line 218 of file tif_dir.h.

Referenced by _TIFFVGetField(), cancelColorMap(), LogLuvClose(), PixarLogClose(), setColorMap(), TIFFPrintDirectory(), and TIFFWriteDirectoryTagColormap().

◆ td_colormap_alloc

uint32_t TIFFDirectory::td_colormap_alloc

Number of entries allocated in each ColorMap plane, zero when none is installed.

Definition at line 228 of file tif_dir.h.

Referenced by cancelColorMap(), LogLuvClose(), PixarLogClose(), setColorMap(), and TIFFFreeDirectory().

◆ td_colormap_count

uint32_t TIFFDirectory::td_colormap_count

Number of entries in each ColorMap plane that the directory uses, zero when none is installed.

Definition at line 223 of file tif_dir.h.

Referenced by cancelColorMap(), checkcmap(), cvtcmap(), LogLuvClose(), PixarLogClose(), setColorMap(), TIFFFreeDirectory(), TIFFPrintDirectory(), TIFFRGBAImageBegin(), and TIFFWriteDirectoryTagColormap().

◆ td_compression

uint16_t TIFFDirectory::td_compression

◆ td_curstrip

uint32_t TIFFDirectory::td_curstrip

◆ td_curtile

uint32_t TIFFDirectory::td_curtile

◆ td_customValueCount

int TIFFDirectory::td_customValueCount

Number of live records in td_customValues, including partial setter entries.

Definition at line 346 of file tif_dir.h.

Referenced by _TIFFVGetField(), removeCustomValue(), TIFFFreeDirectory(), TIFFGetTagListCount(), TIFFGetTagListEntry(), TIFFUnsetField(), and TIFFWriteDirectorySec().

◆ td_customValues

TIFFTagValue* TIFFDirectory::td_customValues

Owned array of custom-value records, each owning its value.

Definition at line 348 of file tif_dir.h.

Referenced by _TIFFVGetField(), removeCustomValue(), TIFFFreeDirectory(), TIFFGetTagListEntry(), TIFFUnsetField(), and TIFFWriteDirectorySec().

◆ td_deferstrilearraywriting

unsigned char TIFFDirectory::td_deferstrilearraywriting

Nonzero to reserve strile entries for later explicit array writing.

Definition at line 354 of file tif_dir.h.

Referenced by TIFFDeferStrileArrayWriting(), and TIFFWriteDirectoryTagLongLong8Array().

◆ td_dirdatasize_Noffsets

uint32_t TIFFDirectory::td_dirdatasize_Noffsets

Number of ranges collected in td_dirdatasize_offsets.

Definition at line 377 of file tif_dir.h.

Referenced by CalcFinalIFDdatasizeReading(), EvaluateIFDdatasizeReading(), and TIFFFreeDirectory().

◆ td_dirdatasize_offsets

TIFFEntryOffsetAndLength* TIFFDirectory::td_dirdatasize_offsets

Owned auxiliary array of external IFD-value ranges, or NULL.

Definition at line 380 of file tif_dir.h.

Referenced by CalcFinalIFDdatasizeReading(), EvaluateIFDdatasizeReading(), TIFFFreeDirectory(), TIFFReadCustomDirectory(), and TIFFReadDirectory().

◆ td_dirdatasize_read

uint64_t TIFFDirectory::td_dirdatasize_read

Reusable IFD span including entry space and contiguous external data; UINT64_MAX permits extension at EOF.

Definition at line 375 of file tif_dir.h.

Referenced by CalcFinalIFDdatasizeReading(), EvaluateIFDdatasizeReading(), TIFFFreeDirectory(), and TIFFWriteDirectorySec().

◆ td_dirdatasize_write

uint64_t TIFFDirectory::td_dirdatasize_write

Accumulated IFD write size in bytes, including entry space after counting.

Definition at line 369 of file tif_dir.h.

Referenced by EvaluateIFDdatasizeWrite(), TIFFFreeDirectory(), TIFFWriteDirectorySec(), and TIFFWriteDirectoryTagCheckedRational().

◆ td_extrasamples

uint16_t TIFFDirectory::td_extrasamples

◆ td_fieldsset

uint32_t TIFFDirectory::td_fieldsset[FIELDSET_ITEMS]

Presence bitmap indexed by FIELD_* bit numbers.

Definition at line 151 of file tif_dir.h.

Referenced by TIFFFreeDirectory().

◆ td_fillorder

uint16_t TIFFDirectory::td_fillorder

◆ td_halftonehints

uint16_t TIFFDirectory::td_halftonehints[2]

Highlight and shadow grayscale breakpoints.

Definition at line 230 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_imagedepth

uint32_t TIFFDirectory::td_imagedepth

◆ td_imagelength

uint32_t TIFFDirectory::td_imagelength

◆ td_imagewidth

uint32_t TIFFDirectory::td_imagewidth

◆ td_inknames

char* TIFFDirectory::td_inknames

Owned concatenated null-terminated ink names, or NULL.

Definition at line 335 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_inknameslen

int TIFFDirectory::td_inknameslen

Byte length of the concatenated ink-name strings, including terminators.

Definition at line 333 of file tif_dir.h.

Referenced by TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_iswrittentofile

unsigned char TIFFDirectory::td_iswrittentofile

Nonzero when the current directory has an on-file representation.

Definition at line 359 of file tif_dir.h.

Referenced by TIFFCreateDirectory(), TIFFFreeDirectory(), TIFFLinkDirectory(), TIFFReadDirectory(), TIFFSetSubDirectory(), and TIFFWriteDirectorySec().

◆ td_maxsamplevalue

uint16_t TIFFDirectory::td_maxsamplevalue

Legacy unsigned maximum sample value.

Definition at line 188 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFReadDirectory(), and TIFFWriteDirectorySec().

◆ td_minsamplevalue

uint16_t TIFFDirectory::td_minsamplevalue

Legacy unsigned minimum sample value.

Definition at line 186 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFVGetFieldDefaulted(), and TIFFWriteDirectorySec().

◆ td_nstrips

uint32_t TIFFDirectory::td_nstrips

◆ td_nsubifd

uint16_t TIFFDirectory::td_nsubifd

Number of child-directory offsets in td_subifd.

Definition at line 307 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectoryTagSubifd().

◆ td_numberofinks

uint16_t TIFFDirectory::td_numberofinks

Number of inks, kept consistent with accepted InkNames where possible.

Definition at line 340 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_orientation

uint16_t TIFFDirectory::td_orientation

ORIENTATION_* storage orientation.

Definition at line 180 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFVGetFieldDefaulted(), and TIFFWriteDirectorySec().

◆ td_pagenumber

uint16_t TIFFDirectory::td_pagenumber[2]

Page index and total-page count as two uint16_t values.

Definition at line 206 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_photometric

uint16_t TIFFDirectory::td_photometric

◆ td_planarconfig

uint16_t TIFFDirectory::td_planarconfig

◆ td_refblackwhite

float* TIFFDirectory::td_refblackwhite

Owned six-float reference black/white array, or NULL.

Definition at line 327 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultRefBlackWhite(), TIFFPrintDirectory(), TIFFVGetFieldDefaulted(), and TIFFWriteDirectorySec().

◆ td_resolutionunit

uint16_t TIFFDirectory::td_resolutionunit

RESUNIT_* unit for resolution and position values.

Definition at line 198 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFVGetFieldDefaulted(), and TIFFWriteDirectorySec().

◆ td_row

uint32_t TIFFDirectory::td_row

◆ td_rowsperstrip

uint32_t TIFFDirectory::td_rowsperstrip

◆ td_sampleformat

uint16_t TIFFDirectory::td_sampleformat

◆ td_sampleinfo

uint16_t* TIFFDirectory::td_sampleinfo

Owned ExtraSamples interpretation array of td_extrasamples entries, or NULL.

Definition at line 237 of file tif_dir.h.

Referenced by _TIFFVGetField(), LERCPostEncode(), LERCPreDecode(), setExtraSamples(), SetupBuffers(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFReadDirectory(), and TIFFVGetFieldDefaulted().

◆ td_samplesperpixel

uint16_t TIFFDirectory::td_samplesperpixel

◆ td_scanlinesize

tmsize_t TIFFDirectory::td_scanlinesize

◆ td_smaxsamplevalue

double* TIFFDirectory::td_smaxsamplevalue

Owned SamplesPerPixel-length array of maximum values, or NULL.

Definition at line 192 of file tif_dir.h.

Referenced by _TIFFVGetField(), LogLuvClose(), PixarLogClose(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_sminsamplevalue

double* TIFFDirectory::td_sminsamplevalue

Owned SamplesPerPixel-length array of minimum values, or NULL.

Definition at line 190 of file tif_dir.h.

Referenced by _TIFFVGetField(), LogLuvClose(), PixarLogClose(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_stripbytecount_entry

TIFFDirEntry TIFFDirectory::td_stripbytecount_entry

◆ td_stripbytecount_p

uint64_t* TIFFDirectory::td_stripbytecount_p

◆ td_stripoffset_entry

TIFFDirEntry TIFFDirectory::td_stripoffset_entry

Deferred offset entry; tag/type/count are swapped but offset storage is raw.

Definition at line 301 of file tif_dir.h.

Referenced by _TIFFFillStrilesInternal(), _TIFFGetStrileOffsetOrByteCountValue(), _TIFFRewriteField(), TIFFForceStrileArrayWriting(), TIFFFreeDirectory(), TIFFGetStrileOffsetWithErr(), TIFFReadDirectory(), and TIFFWriteCheck().

◆ td_stripoffset_p

uint64_t* TIFFDirectory::td_stripoffset_p

◆ td_stripoffsetbyteallocsize

uint32_t TIFFDirectory::td_stripoffsetbyteallocsize

Allocated element capacity of lazy strile offset/count caches, not byte size.

Definition at line 286 of file tif_dir.h.

Referenced by _TIFFFetchStrileValue(), _TIFFFillStrilesInternal(), _TIFFPartialReadStripArray(), and TIFFFreeDirectory().

◆ td_stripsperimage

uint32_t TIFFDirectory::td_stripsperimage

Strips or tiles per sample plane, despite the historic name.

Definition at line 269 of file tif_dir.h.

Referenced by allocChoppedUpStripArrays(), EstimateStripByteCounts(), OJPEGPostDecode(), OJPEGPreDecode(), TIFFReadDirectory(), TIFFSeek(), and TIFFSetupStrips().

◆ td_subfiletype

uint32_t TIFFDirectory::td_subfiletype

NewSubfileType flag mask.

Definition at line 166 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFVGetFieldDefaulted(), and TIFFWriteDirectorySec().

◆ td_subifd

uint64_t* TIFFDirectory::td_subifd

Owned array of td_nsubifd child-directory offsets, or NULL.

Definition at line 309 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectoryTagSubifd().

◆ td_threshholding

uint16_t TIFFDirectory::td_threshholding

THRESHHOLD_* bilevel rendering convention.

Definition at line 176 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFVGetFieldDefaulted(), and TIFFWriteDirectorySec().

◆ td_tiledepth

uint32_t TIFFDirectory::td_tiledepth

◆ td_tilelength

uint32_t TIFFDirectory::td_tilelength

◆ td_tilesize

tmsize_t TIFFDirectory::td_tilesize

◆ td_tilewidth

uint32_t TIFFDirectory::td_tilewidth

◆ td_transferfunction

uint16_t* TIFFDirectory::td_transferfunction[3]

◆ td_transferfunction_count

uint32_t TIFFDirectory::td_transferfunction_count

Number of entries in each installed TransferFunction curve, zero when none is installed; the only record of the curve length.

Definition at line 325 of file tif_dir.h.

Referenced by cancelTransferFunction(), LogLuvClose(), PixarLogClose(), setTransferFunction(), TIFFDefaultTransferFunction(), TIFFFreeDirectory(), TIFFPrintDirectory(), and TIFFWriteDirectoryTagTransferfunction().

◆ td_xposition

float TIFFDirectory::td_xposition

Horizontal image position in resolution units.

Definition at line 202 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_xresolution

float TIFFDirectory::td_xresolution

Horizontal pixels per resolution unit.

Definition at line 194 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_ycbcrpositioning

uint16_t TIFFDirectory::td_ycbcrpositioning

YCBCRPOSITION_* placement convention.

Definition at line 314 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFDefaultDirectory(), TIFFPrintDirectory(), TIFFVGetFieldDefaulted(), and TIFFWriteDirectorySec().

◆ td_ycbcrsubsampling

uint16_t TIFFDirectory::td_ycbcrsubsampling[2]

◆ td_yposition

float TIFFDirectory::td_yposition

Vertical image position in resolution units.

Definition at line 204 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().

◆ td_yresolution

float TIFFDirectory::td_yresolution

Vertical pixels per resolution unit.

Definition at line 196 of file tif_dir.h.

Referenced by _TIFFVGetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().


The documentation for this struct was generated from the following file: