|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Get, set, unset, and default values through tag-specific arguments. More...
Typedefs | |
| typedef int(* | TIFFVSetMethod) (TIFF *tif, uint32_t tag, va_list ap) |
| Implement a handle's variadic tag setter. | |
| typedef int(* | TIFFVGetMethod) (TIFF *tif, uint32_t tag, va_list ap) |
| Implement a handle's variadic tag getter. | |
| typedef void(* | TIFFPrintMethod) (TIFF *tif, FILE *fd, long flags) |
| Append extension-specific directory information to a stream. | |
Functions | |
| int | TIFFGetField (TIFF *tif, uint32_t tag,...) |
| Query a present tag in the current directory. | |
| int | TIFFVGetField (TIFF *tif, uint32_t tag, va_list ap) |
| Query a present tag in the current directory. | |
| int | TIFFGetFieldDefaulted (TIFF *tif, uint32_t tag,...) |
| Query a present tag or a supported default. | |
| int | TIFFVGetFieldDefaulted (TIFF *tif, uint32_t tag, va_list ap) |
| Query a present tag or a supported default. | |
| int | TIFFSetField (TIFF *tif, uint32_t tag,...) |
| Set a tag value in the current in-memory directory. | |
| int | TIFFVSetField (TIFF *tif, uint32_t tag, va_list ap) |
| Set a tag value in the current in-memory directory. | |
| int | TIFFUnsetField (TIFF *tif, uint32_t tag) |
| Clear tag presence or remove a stored custom value. | |
Get, set, unset, and default values through tag-specific arguments.
See Tag arguments before constructing a variadic call.
| typedef void(* TIFFPrintMethod) (TIFF *tif, FILE *fd, long flags) |
Append extension-specific directory information to a stream.
Invoked synchronously by TIFFPrintDirectory() after core and custom values, and before optional strip/tile rows. Borrowed arguments are valid only for this call; do not close/free them. Follow TIFFPRINT_* controls, delegate saved parent printers where needed, and avoid recursive directory printing. The original flags are forwarded unchanged, including bits unused by the core formatter. Callback code must remain live while installed or in flight. The caller performs no exception handling or aggregate output-status check. Stream errors cannot be returned by this interface; report failures through diagnostics if required.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in,out] | fd | Non-NULL writable caller-owned stdio stream. |
| [in] | flags | TIFFPRINT_* bit mask. |
| typedef int(* TIFFVGetMethod) (TIFF *tif, uint32_t tag, va_list ap) |
Implement a handle's variadic tag getter.
Invoked synchronously for registered, set tags or pseudo-tags. Use Tag arguments to fill caller-owned outputs; returned arrays remain borrowed. Delegate unhandled tags to the saved parent method without recursing through TIFFGetField(). Queries may allocate/cache data or do I/O. On failure outputs need not be unchanged; the caller must not use them. No handle/list ownership transfers.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number in the current namespace. |
| [in,out] | ap | Borrowed output-argument list; traversal and pointed-to outputs may change. Use va_copy() for independent traversal. |
| typedef int(* TIFFVSetMethod) (TIFF *tif, uint32_t tag, va_list ap) |
Implement a handle's variadic tag setter.
Invoked synchronously after TIFFVSetField() validates registration and mutability. Apply the tag-specific Tag arguments contract, copy borrowed values when storing them, and manage dirty/field bits and codec state. Save/delegate to the parent method for unhandled tags; calling TIFFSetField() on the same tag would recurse. The callback owns no input list or handle. Diagnostics and partial failure state follow the implementation.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Registered tag number. |
| [in,out] | ap | Borrowed list of promoted values/array pointers; may be traversed. Use va_copy() for an independent traversal. |
|
extern |
Query a present tag in the current directory.
See Tag arguments for exact pointer types, counts, exceptions, and lifetimes. Values are read from the current in-memory directory, not reread wholesale from disk. Registered pseudo-tags bypass the presence- bit test and may have codec effects. Array/string results are borrowed and must not be freed or modified; replacement, unsetting, directory change, codec cleanup, or handle cleanup can invalidate them. Deferred strip/tile arrays may allocate and perform I/O. Missing fields normally return zero silently; codec, I/O, and allocation failures can dispatch diagnostics. Outputs are usable only on success, and failure need not preserve them. No errno contract is provided.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number in the current directory namespace. |
| [out] | ... | Tag-specific non-NULL output pointers; see Tag arguments. Caller owns the output slots. |
Definition at line 2099 of file tif_dir.c.
References TIFFVGetField().
Referenced by gtTileContig(), gtTileSeparate(), isCCITTCompression(), JPEGSetupEncode(), TIFFPrintDirectory(), TIFFRGBAImageBegin(), TIFFRGBAImageOK(), and TIFFWriteDirectorySec().
|
extern |
Query a present tag or a supported default.
See Tag arguments for exact pointer types, counts, exceptions, and lifetimes. Values are read from the current in-memory directory, not reread wholesale from disk. Registered pseudo-tags bypass the presence- bit test and may have codec effects. Array/string results are borrowed and must not be freed or modified; replacement, unsetting, directory change, codec cleanup, or handle cleanup can invalidate them. Deferred strip/tile arrays may allocate and perform I/O. Missing fields normally return zero silently; codec, I/O, and allocation failures can dispatch diagnostics. Outputs are usable only on success, and failure need not preserve them. No errno contract is provided. If ordinary lookup fails, selected core defaults are supplied. TransferFunction and ReferenceBlackWhite may be allocated/cached without setting tag presence; unsupported defaults still return zero. Static default arrays also remain borrowed. Failed custom getters must not consume ap before returning zero if this fallback is to reuse it safely.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number in the current directory namespace. |
| [out] | ... | Tag-specific non-NULL output pointers; see Tag arguments. Caller owns the output slots. |
Definition at line 591 of file tif_aux.c.
References TIFFVGetFieldDefaulted().
Referenced by _TIFFStrileSize64(), gtStripContig(), gtStripSeparate(), gtTileContig(), initCIELabConversion(), initYCbCrConversion(), PickContigCase(), PickSeparateCase(), TIFFReadRGBAStripExt(), TIFFReadRGBATileExt(), TIFFRGBAImageBegin(), TIFFRGBAImageOK(), TIFFScanlineSize64(), TIFFTileRowSize64(), and TIFFWriteDirectorySec().
|
extern |
Set a tag value in the current in-memory directory.
See Tag arguments for exact promoted values, counts, array lengths, and exceptions. Changes update memory and dirty/field bits; file- directory persistence requires a later write/flush. Unknown tags or disallowed changes after writing begins are diagnosed and rejected (ImageLength is a special exception). Codec selection may clean up and reinitialise codec state. Core setters copy arrays/strings without taking ownership, but ExtraSamples may repair a caller element in place. Input storage must not alias replaced owned storage. Failure can discard old values, alter codec/related tags, or leave a partial custom entry; there is no rollback. Some void array-copy helpers lose data on allocation failure without changing the setter's success result. Diagnostics and errno alone do not establish success.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Registered tag or pseudo-tag number. |
| [in,out] | ... | Promoted tag-specific values and borrowed buffers; ExtraSamples may be repaired in place. See Tag arguments. |
Definition at line 1627 of file tif_dir.c.
References TIFFVSetField().
Referenced by allocChoppedUpStripArrays(), JPEGSetupEncode(), LogLuvVSetField(), PixarLogVSetField(), TIFFDefaultDirectory(), TIFFFetchNormalTag(), TIFFFetchSubjectDistance(), TIFFInitLERC(), TIFFInitOJPEG(), TIFFReadDirectory(), and TIFFRGBAImageBegin().
|
extern |
Clear tag presence or remove a stored custom value.
A non-custom tag only has its field bit cleared: stored scalar/array values and codec configuration are not reset, and a shared bit can hide multiple tags. A custom entry frees its owned value and compacts the value list without unregistering its descriptor. Marks the directory dirty even when a known custom value was absent. Does not enforce setter mutability rules or persist changes. Unknown-tag warnings follow TIFFFieldWithTag(). No rollback or general resource-reset operation is provided.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number whose descriptor is registered. |
Definition at line 1641 of file tif_dir.c.
References _TIFFfreeExt(), _TIFFField::field_bit, FIELD_CUSTOM, _TIFFField::field_tag, TIFFTagValue::info, TIFFDirectory::td_customValueCount, TIFFDirectory::td_customValues, tiff::tif_dir, tiff::tif_flags, TIFF_DIRTYDIRECT, TIFFClrFieldBit, TIFFFieldWithTag(), and TIFFTagValue::value.
|
extern |
Query a present tag in the current directory.
See Tag arguments for exact pointer types, counts, exceptions, and lifetimes. Values are read from the current in-memory directory, not reread wholesale from disk. Registered pseudo-tags bypass the presence- bit test and may have codec effects. Array/string results are borrowed and must not be freed or modified; replacement, unsetting, directory change, codec cleanup, or handle cleanup can invalidate them. Deferred strip/tile arrays may allocate and perform I/O. Missing fields normally return zero silently; codec, I/O, and allocation failures can dispatch diagnostics. Outputs are usable only on success, and failure need not preserve them. No errno contract is provided.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number in the current directory namespace. |
| [in,out] | ap | Borrowed tag-specific output list; pointed-to outputs and traversal can change. Do not reuse without va_copy(). |
Definition at line 2116 of file tif_dir.c.
References _TIFFField::field_bit, isPseudoTag, tiff::tif_tagmethods, TIFF_ANY, TIFFFieldSet, TIFFFindField(), and TIFFTagMethods::vgetfield.
Referenced by TIFFGetField(), and TIFFVGetFieldDefaulted().
|
extern |
Query a present tag or a supported default.
See Tag arguments for exact pointer types, counts, exceptions, and lifetimes. Values are read from the current in-memory directory, not reread wholesale from disk. Registered pseudo-tags bypass the presence- bit test and may have codec effects. Array/string results are borrowed and must not be freed or modified; replacement, unsetting, directory change, codec cleanup, or handle cleanup can invalidate them. Deferred strip/tile arrays may allocate and perform I/O. Missing fields normally return zero silently; codec, I/O, and allocation failures can dispatch diagnostics. Outputs are usable only on success, and failure need not preserve them. No errno contract is provided. If ordinary lookup fails, selected core defaults are supplied. TransferFunction and ReferenceBlackWhite may be allocated/cached without setting tag presence; unsupported defaults still return zero. Static default arrays also remain borrowed. Failed custom getters must not consume ap before returning zero if this fallback is to reuse it safely.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number in the current directory namespace. |
| [in,out] | ap | Borrowed tag-specific output list; pointed-to outputs and traversal can change. Do not reuse without va_copy(). |
Definition at line 422 of file tif_aux.c.
References D50_X0, D50_Y0, D50_Z0, EXTRASAMPLE_ASSOCALPHA, INKSET_CMYK, TIFFPredictorState::predictor, TIFFDirectory::td_bitspersample, TIFFDirectory::td_extrasamples, TIFFDirectory::td_fillorder, TIFFDirectory::td_imagedepth, TIFFDirectory::td_minsamplevalue, TIFFDirectory::td_orientation, TIFFDirectory::td_planarconfig, TIFFDirectory::td_refblackwhite, TIFFDirectory::td_resolutionunit, TIFFDirectory::td_rowsperstrip, TIFFDirectory::td_sampleformat, TIFFDirectory::td_sampleinfo, TIFFDirectory::td_samplesperpixel, TIFFDirectory::td_subfiletype, TIFFDirectory::td_threshholding, TIFFDirectory::td_tiledepth, TIFFDirectory::td_transferfunction, TIFFDirectory::td_ycbcrpositioning, TIFFDirectory::td_ycbcrsubsampling, tiff::tif_data, tiff::tif_dir, tiff::tif_name, TIFFDefaultRefBlackWhite(), TIFFDefaultTransferFunction(), TIFFErrorExtR(), TIFFTAG_BITSPERSAMPLE, TIFFTAG_DATATYPE, TIFFTAG_DOTRANGE, TIFFTAG_EXTRASAMPLES, TIFFTAG_FILLORDER, TIFFTAG_IMAGEDEPTH, TIFFTAG_INKSET, TIFFTAG_MATTEING, TIFFTAG_MAXSAMPLEVALUE, TIFFTAG_MINSAMPLEVALUE, TIFFTAG_NUMBEROFINKS, TIFFTAG_ORIENTATION, TIFFTAG_PLANARCONFIG, TIFFTAG_PREDICTOR, TIFFTAG_REFERENCEBLACKWHITE, TIFFTAG_RESOLUTIONUNIT, TIFFTAG_ROWSPERSTRIP, TIFFTAG_SAMPLEFORMAT, TIFFTAG_SAMPLESPERPIXEL, TIFFTAG_SUBFILETYPE, TIFFTAG_THRESHHOLDING, TIFFTAG_TILEDEPTH, TIFFTAG_TRANSFERFUNCTION, TIFFTAG_WHITEPOINT, TIFFTAG_YCBCRCOEFFICIENTS, TIFFTAG_YCBCRPOSITIONING, TIFFTAG_YCBCRSUBSAMPLING, and TIFFVGetField().
Referenced by TIFFGetFieldDefaulted().
|
extern |
Set a tag value in the current in-memory directory.
See Tag arguments for exact promoted values, counts, array lengths, and exceptions. Changes update memory and dirty/field bits; file- directory persistence requires a later write/flush. Unknown tags or disallowed changes after writing begins are diagnosed and rejected (ImageLength is a special exception). Codec selection may clean up and reinitialise codec state. Core setters copy arrays/strings without taking ownership, but ExtraSamples may repair a caller element in place. Input storage must not alias replaced owned storage. Failure can discard old values, alter codec/related tags, or leave a partial custom entry; there is no rollback. Some void array-copy helpers lose data on allocation failure without changing the setter's success result. Diagnostics and errno alone do not establish success.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Registered tag or pseudo-tag number. |
| [in,out] | ap | Borrowed tag-specific value list; traversal and permitted mutable input data can change. Use va_copy() before reusing. |
Definition at line 1686 of file tif_dir.c.
References OkToChangeTag(), tiff::tif_tagmethods, and TIFFTagMethods::vsetfield.
Referenced by TIFFSetField().