|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Register, enumerate, and install compression implementations. More...
Modules | |
| Predictor transforms | |
| Chain codec methods and transform predicted rows. | |
| Uncompressed and byte-run codecs | |
| Implement uncompressed PackBits ThunderScan and NeXT transfers. | |
| LZW codec | |
| Manage TIFF LZW dictionaries bit streams and predictor-aware transfers. | |
| ZSTD streaming codec | |
| Implement predictor-aware ZSTD frame streaming. | |
| LZMA2 streaming codec | |
| Implement filtered LZMA2 stream compression. | |
| Deflate codec | |
| Implement zlib and optional whole-strile libdeflate compression. | |
| WebP frame codec | |
| Stage and transfer WebP RGB or RGBA frames. | |
| JBIG plane codec | |
| Transfer complete JBIG image planes through strip callbacks. | |
| LERC frame codec | |
| Stage scalar samples validity masks and secondary compression. | |
| CCITT fax codecs | |
| Encode and decode Group3 Group4 and aligned bilevel runs. | |
| PixarLog codec | |
| Compand linear samples into predicted eleven-bit zlib streams. | |
| SGILog codec | |
| Compress logarithmic luminance and packed LogLuv pixel rows. | |
| JPEG dependency interface | |
| Bridge dependency error handling and borrowed JPEG buffers. | |
| Old-style JPEG reconstruction | |
| The decode-only old-style JPEG codec reconstructs a single dependency stream. | |
Data Structures | |
| struct | _codec |
| Link a dynamically registered codec allocation. More... | |
Typedefs | |
| typedef struct _codec | codec_t |
| Link a dynamically registered codec allocation. | |
Functions | |
| static int | _notConfigured (TIFF *tif) |
| Report that the current compression support was not built. | |
| static int | NotConfigured (TIFF *tif, int scheme) |
| Install unavailable-codec setup methods while accepting metadata access. | |
| static int | TIFFNoEncode (TIFF *tif, const char *method) |
| Diagnose an unsupported encoder operation. | |
| static int | TIFFNoDecode (TIFF *tif, const char *method) |
| Diagnose an unsupported decoder operation. | |
| static int | _TIFFNoFixupTags (TIFF *tif) |
| Accept a no-op codec tag fixup. | |
| static int | _TIFFtrue (TIFF *tif) |
| Accept a no-op codec setup or completion. | |
| static void | _TIFFvoid (TIFF *tif) |
| Perform no codec close or cleanup work. | |
| static uint64_t | _TIFFDefaultGetMaxCompressionRatio (TIFF *tif) |
| Report an unknown codec compression ratio. | |
| static uint64_t | _TIFFGetMaxCompressionRatioOne (TIFF *tif) |
| Report the uncompressed ratio of one. | |
| int | _TIFFNoRowEncode (TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) |
| Report unsupported codec encoding. | |
| int | _TIFFNoStripEncode (TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) |
| Report unsupported codec encoding. | |
| int | _TIFFNoTileEncode (TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) |
| Report unsupported codec encoding. | |
| int | _TIFFNoRowDecode (TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) |
| Report unsupported codec decoding. | |
| int | _TIFFNoStripDecode (TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) |
| Report unsupported codec decoding. | |
| int | _TIFFNoTileDecode (TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) |
| Report unsupported codec decoding. | |
| int | _TIFFNoPreCode (TIFF *tif, uint16_t s) |
| Accept a no-op codec preparation. | |
| int | _TIFFNoSeek (TIFF *tif, uint32_t off) |
| Report unsupported codec seeking. | |
| void | _TIFFSetDefaultCompressionState (TIFF *tif) |
| Install fallback codec callbacks and reset raw-access flags. | |
| int | TIFFSetCompressionScheme (TIFF *tif, int scheme) |
| Reset methods and install the selected compression implementation. | |
| int | TIFFSetDefaultCompressionState (TIFF *tif) |
| Retain an obsolete declaration with no library implementation. | |
Variables | |
| static codec_t * | registeredCODECS = NULL |
| Head the newest-first registered codec list. | |
| const TIFFCodec | _TIFFBuiltinCODECS [] |
| Describe built-in compression names and initialisers. | |
Register, enumerate, and install compression implementations.
Link a dynamically registered codec allocation.
The node, descriptor and copied name share one allocation released by unregister. Global list operations require external serialisation.
|
static |
Report that the current compression support was not built.
Looks up a display name and dispatches handle diagnostics; no allocation, pixel I/O, or buffer ownership transfer.
| [in] | tif | Non-NULL live handle; td_compression and tif_name are read for the diagnostic and codec state is unchanged. |
Definition at line 126 of file tif_codec.c.
References TIFFCodec::name, TIFFDirectory::td_compression, tiff::tif_dir, tiff::tif_name, TIFFErrorExtR(), and TIFFFindCODEC().
Referenced by NotConfigured().
|
static |
Report an unknown codec compression ratio.
No state, allocation, I/O, diagnostics or ownership effects.
| [in] | tif | Handle (ignored). |
Definition at line 210 of file tif_compress.c.
Referenced by _TIFFSetDefaultCompressionState().
|
static |
Report the uncompressed ratio of one.
No state, allocation, I/O, diagnostics or ownership effects.
| [in] | tif | Handle (ignored). |
Definition at line 225 of file tif_compress.c.
Referenced by TIFFSetCompressionScheme().
|
static |
Accept a no-op codec tag fixup.
Ignores the handle; no state, allocation, I/O, diagnostics or ownership effects.
| [in] | tif | Handle (ignored). |
Definition at line 130 of file tif_compress.c.
Referenced by _TIFFSetDefaultCompressionState().
|
extern |
Accept a no-op codec preparation.
No pixel buffer access, allocation, I/O, or ownership transfer. Ignores all arguments without diagnostics.
| [in] | tif | Unused handle. |
| [in] | s | Unused compatibility argument; does not select a working codec operation. |
Definition at line 168 of file tif_compress.c.
Referenced by _TIFFSetDefaultCompressionState().
Report unsupported codec decoding.
No pixel buffer access, allocation, I/O, or ownership transfer. Dispatches handle diagnostics; registry lookup supplies the name when available.
| [in] | tif | Non-NULL live handle; only td_compression and tif_name are read, for the diagnostic. Not modified. |
| [in] | pp | Unused compatibility argument; no buffer access occurs. |
| [in] | cc | Unused compatibility argument; does not select a working codec operation. |
| [in] | s | Unused compatibility argument; does not select a working codec operation. |
Definition at line 136 of file tif_compress.c.
References TIFFNoDecode().
Referenced by _TIFFSetDefaultCompressionState().
Report unsupported codec encoding.
No pixel buffer access, allocation, I/O, or ownership transfer. Dispatches handle diagnostics; registry lookup supplies the name when available.
| [in] | tif | Non-NULL live handle; only td_compression and tif_name are read, for the diagnostic. Not modified. |
| [in] | pp | Unused compatibility argument; no buffer access occurs. |
| [in] | cc | Unused compatibility argument; does not select a working codec operation. |
| [in] | s | Unused compatibility argument; does not select a working codec operation. |
Definition at line 69 of file tif_compress.c.
References TIFFNoEncode().
Referenced by _TIFFSetDefaultCompressionState().
|
extern |
Report unsupported codec seeking.
No pixel buffer access, allocation, I/O, or ownership transfer. Reports that the compression algorithm does not support random access through the handle's error handler.
| [in] | tif | Non-NULL live handle used for the diagnostic (tif_name); not modified. |
| [in] | off | Unused compatibility argument; does not select a working codec operation. |
Definition at line 160 of file tif_compress.c.
References tiff::tif_name, and TIFFErrorExtR().
Referenced by _TIFFSetDefaultCompressionState().
Report unsupported codec decoding.
No pixel buffer access, allocation, I/O, or ownership transfer. Dispatches handle diagnostics; registry lookup supplies the name when available.
| [in] | tif | Non-NULL live handle; only td_compression and tif_name are read, for the diagnostic. Not modified. |
| [in] | pp | Unused compatibility argument; no buffer access occurs. |
| [in] | cc | Unused compatibility argument; does not select a working codec operation. |
| [in] | s | Unused compatibility argument; does not select a working codec operation. |
Definition at line 144 of file tif_compress.c.
References TIFFNoDecode().
Referenced by _TIFFSetDefaultCompressionState().
Report unsupported codec encoding.
No pixel buffer access, allocation, I/O, or ownership transfer. Dispatches handle diagnostics; registry lookup supplies the name when available.
| [in] | tif | Non-NULL live handle; only td_compression and tif_name are read, for the diagnostic. Not modified. |
| [in] | pp | Unused compatibility argument; no buffer access occurs. |
| [in] | cc | Unused compatibility argument; does not select a working codec operation. |
| [in] | s | Unused compatibility argument; does not select a working codec operation. |
Definition at line 77 of file tif_compress.c.
References TIFFNoEncode().
Referenced by _TIFFSetDefaultCompressionState().
Report unsupported codec decoding.
No pixel buffer access, allocation, I/O, or ownership transfer. Dispatches handle diagnostics; registry lookup supplies the name when available.
| [in] | tif | Non-NULL live handle; only td_compression and tif_name are read, for the diagnostic. Not modified. |
| [in] | pp | Unused compatibility argument; no buffer access occurs. |
| [in] | cc | Unused compatibility argument; does not select a working codec operation. |
| [in] | s | Unused compatibility argument; does not select a working codec operation. |
Definition at line 152 of file tif_compress.c.
References TIFFNoDecode().
Referenced by _TIFFSetDefaultCompressionState().
Report unsupported codec encoding.
No pixel buffer access, allocation, I/O, or ownership transfer. Dispatches handle diagnostics; registry lookup supplies the name when available.
| [in] | tif | Non-NULL live handle; only td_compression and tif_name are read, for the diagnostic. Not modified. |
| [in] | pp | Unused compatibility argument; no buffer access occurs. |
| [in] | cc | Unused compatibility argument; does not select a working codec operation. |
| [in] | s | Unused compatibility argument; does not select a working codec operation. |
Definition at line 85 of file tif_compress.c.
References TIFFNoEncode().
Referenced by _TIFFSetDefaultCompressionState().
|
extern |
Install fallback codec callbacks and reset raw-access flags.
Assigns no-op setup/close/cleanup, unsupported encode/decode/seek methods, default sizing, and unknown ratio. Sets tif_decodestatus and tif_encodestatus to TRUE and clears NOBITREV/NOREADRAW/UPSAMPLED, so a codec change does not inherit a previous codec's upsampling. Does not free old state, flush data, allocate, read/write bytes, or report status. Caller must clean up previous codec first.
| [in,out] | tif | Non-NULL live handle whose codec methods and flags are overwritten; serialise access externally. |
Definition at line 231 of file tif_compress.c.
References _TIFFDefaultGetMaxCompressionRatio(), _TIFFDefaultStripSize(), _TIFFDefaultTileSize(), _TIFFNoFixupTags(), _TIFFNoPreCode(), _TIFFNoRowDecode(), _TIFFNoRowEncode(), _TIFFNoSeek(), _TIFFNoStripDecode(), _TIFFNoStripEncode(), _TIFFNoTileDecode(), _TIFFNoTileEncode(), _TIFFtrue(), _TIFFvoid(), tiff::tif_cleanup, tiff::tif_close, tiff::tif_decoderow, tiff::tif_decodestatus, tiff::tif_decodestrip, tiff::tif_decodetile, tiff::tif_defstripsize, tiff::tif_deftilesize, tiff::tif_encoderow, tiff::tif_encodestatus, tiff::tif_encodestrip, tiff::tif_encodetile, tiff::tif_fixuptags, tiff::tif_flags, tiff::tif_getmaxcompressionratio, tiff::tif_postencode, tiff::tif_predecode, tiff::tif_preencode, tiff::tif_seek, tiff::tif_setupdecode, tiff::tif_setupencode, TIFF_NOBITREV, TIFF_NOREADRAW, TIFF_UPSAMPLED, and TRUE.
Referenced by JPEGCleanup(), LERCCleanup(), LogLuvCleanup(), LZMACleanup(), LZWCleanup(), OJPEGCleanup(), PixarLogCleanup(), TIFFClientOpenExt(), TIFFSetCompressionScheme(), TWebPCleanup(), ZIPCleanup(), and ZSTDCleanup().
|
static |
Accept a no-op codec setup or completion.
Ignores the handle; no state, allocation, I/O, diagnostics or ownership effects.
| [in] | tif | Handle (ignored). |
Definition at line 185 of file tif_compress.c.
Referenced by _TIFFSetDefaultCompressionState().
|
static |
Perform no codec close or cleanup work.
Ignores the handle; does not free codec state, flush, diagnose, allocate or transfer ownership.
| [in] | tif | Handle (ignored). |
Definition at line 199 of file tif_compress.c.
Referenced by _TIFFSetDefaultCompressionState().
|
static |
Install unavailable-codec setup methods while accepting metadata access.
Sets fixup/setup callbacks to _notConfigured and clears encode/decode status. Does not allocate state, access payload, or diagnose until callbacks are used.
| [in,out] | tif | Non-NULL live handle whose fixup/setup callbacks and encode/decode status flags are replaced; serialise access externally. |
| [in] | scheme | Unused compression identifier. |
Definition at line 153 of file tif_codec.c.
References _notConfigured(), FALSE, tiff::tif_decodestatus, tiff::tif_encodestatus, tiff::tif_fixuptags, tiff::tif_setupdecode, and tiff::tif_setupencode.
Referenced by TIFFIsCODECConfigured().
|
static |
Diagnose an unsupported decoder operation.
Looks up the name and invokes handle diagnostics; no buffer access, allocation or pixel I/O.
| [in] | tif | Non-NULL live handle; td_compression and tif_name are read for the diagnostic and codec state is unchanged. |
| [in] | method | Borrowed method label used only during diagnostics. |
Definition at line 105 of file tif_compress.c.
References TIFFCodec::name, TIFFDirectory::td_compression, tiff::tif_dir, tiff::tif_name, TIFFErrorExtR(), and TIFFFindCODEC().
Referenced by _TIFFNoRowDecode(), _TIFFNoStripDecode(), and _TIFFNoTileDecode().
|
static |
Diagnose an unsupported encoder operation.
Looks up the name and invokes handle diagnostics; no buffer access, allocation or pixel I/O.
| [in] | tif | Non-NULL live handle; td_compression and tif_name are read for the diagnostic and codec state is unchanged. |
| [in] | method | Borrowed method label used only during diagnostics. |
Definition at line 50 of file tif_compress.c.
References TIFFCodec::name, TIFFDirectory::td_compression, tiff::tif_dir, tiff::tif_name, TIFFErrorExtR(), and TIFFFindCODEC().
Referenced by _TIFFNoRowEncode(), _TIFFNoStripEncode(), and _TIFFNoTileEncode().
|
extern |
Reset methods and install the selected compression implementation.
Looks up the uint16_t scheme, resets default callbacks/flags, sets ratio one for COMPRESSION_NONE, and invokes the selected init if present. Unknown schemes return success with fallback methods so metadata can still be inspected. Requires previous codec cleanup by the caller; this function does not release prior tif_data. Initialiser allocation/diagnostic/state effects can survive failure; no pixel I/O is performed directly. The process-global registry is unsynchronised; serialise queries and modifications externally. No registry operation manages active codec state or unloads callback code.
| [in,out] | tif | Non-NULL live handle whose codec state can be changed; caller serialises handle and registry access. |
| [in] | scheme | Requested compression identifier; lookup narrows to uint16_t. |
Definition at line 256 of file tif_compress.c.
References _TIFFGetMaxCompressionRatioOne(), _TIFFSetDefaultCompressionState(), COMPRESSION_NONE, TIFFCodec::init, tiff::tif_getmaxcompressionratio, and TIFFFindCODEC().
Referenced by _TIFFVSetField().
|
extern |
Retain an obsolete declaration with no library implementation.
This spelling has no definition in this source tree and must not be called. The implemented private reset helper is _TIFFSetDefaultCompressionState(). No error, ownership, lifetime or side-effect contract exists for this unimplemented declaration.
| [in,out] | tif | Historical handle argument; no valid invocation is available in this library. |
|
extern |
Describe built-in compression names and initialisers.
Immutable library-lifetime name-NULL terminated array; disabled entries refer to a metadata-accepting stub. Borrowed storage must not be modified or freed.
Definition at line 91 of file tif_codec.c.
Referenced by TIFFFindCODEC(), and TIFFGetConfiguredCODECs().
|
static |
Head the newest-first registered codec list.
Process-global unsynchronised state; nodes are owned until unregister.
Definition at line 304 of file tif_compress.c.
Referenced by TIFFFindCODEC(), TIFFGetConfiguredCODECs(), TIFFRegisterCODEC(), and TIFFUnRegisterCODEC().