|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Register, enumerate, and install compression implementations. More...
Typedefs | |
| typedef int(* | TIFFInitMethod) (TIFF *tif, int scheme) |
| Install compression methods and private state on a handle. | |
Functions | |
| const TIFFCodec * | TIFFFindCODEC (uint16_t scheme) |
| Find the highest-priority descriptor for a compression scheme. | |
| TIFFCodec * | TIFFRegisterCODEC (uint16_t scheme, const char *name, TIFFInitMethod init) |
| Register a codec descriptor ahead of built-in and older entries. | |
| void | TIFFUnRegisterCODEC (TIFFCodec *c) |
| Remove and free an exact registered codec descriptor. | |
| int | TIFFIsCODECConfigured (uint16_t scheme) |
| Check whether the selected descriptor has a configured initialiser. | |
| TIFFCodec * | TIFFGetConfiguredCODECs (void) |
| Allocate a terminated snapshot of registered and configured codec descriptors. | |
Register, enumerate, and install compression implementations.
| typedef int(* TIFFInitMethod) (TIFF *tif, int scheme) |
Install compression methods and private state on a handle.
Invoked synchronously after default methods have been installed. The initialiser may allocate handle-owned state and chain tag methods; keep code live for the lifetime of all installed callbacks. Cleanup must release that state and restore method chains. Failure can leave partial state for the handle lifecycle; no caller-buffer ownership transfers. Do not close or recursively reconfigure the active handle.
| [in,out] | tif | Non-NULL live handle whose codec state can be changed; caller serialises handle and registry access. |
| [in] | scheme | Requested compression identifier; related schemes can share an initialiser. |
|
extern |
Find the highest-priority descriptor for a compression scheme.
Searches registered entries newest first, then built-ins; a descriptor can represent a codec disabled at build time. No allocation, I/O or diagnostics. Returned registered storage is invalidated by unregister; built-in storage remains live while the library is loaded. Do not modify/free it. The process-global registry is unsynchronised; serialise queries and modifications externally. No registry operation manages active codec state or unloads callback code.
| [in] | scheme | Compression identifier to look up. |
Definition at line 306 of file tif_compress.c.
References _TIFFBuiltinCODECS, _codec::info, TIFFCodec::name, _codec::next, registeredCODECS, and TIFFCodec::scheme.
Referenced by _notConfigured(), TIFFIsCODECConfigured(), TIFFNoDecode(), TIFFNoEncode(), TIFFPrintDirectory(), and TIFFSetCompressionScheme().
|
extern |
Allocate a terminated snapshot of registered and configured codec descriptors.
Lists registrations newest first followed by built-in records whose scheme currently resolves as configured. Duplicates/shadowed entries can remain, and registered entries are copied even if their callback is NULL. The sentinel record has all fields zero. Caller frees the array with _TIFFfree(); names and callback pointers are shallow borrowed copies. Registration removal invalidates names in earlier snapshots. Reallocation failure frees partial output and returns NULL; no explicit diagnostic is emitted here. The process-global registry is unsynchronised; serialise queries and modifications externally. No registry operation manages active codec state or unloads callback code.
Definition at line 371 of file tif_compress.c.
References _TIFFBuiltinCODECS, _TIFFfreeExt(), _TIFFmemcpy(), _TIFFmemset(), _TIFFreallocExt(), _codec::info, TIFFCodec::name, _codec::next, registeredCODECS, TIFFCodec::scheme, and TIFFIsCODECConfigured().
|
extern |
Check whether the selected descriptor has a configured initialiser.
Tests lookup, non-NULL init and inequality with the build-disabled stub. Does not call init, validate a custom callback, test format support, allocate, do I/O, or diagnose. The process-global registry is unsynchronised; serialise queries and modifications externally. No registry operation manages active codec state or unloads callback code.
| [in] | scheme | Compression identifier. |
Definition at line 171 of file tif_codec.c.
References TIFFCodec::init, NotConfigured(), and TIFFFindCODEC().
Referenced by _TIFFCheckFieldIsValidForCodec(), and TIFFGetConfiguredCODECs().
|
extern |
Register a codec descriptor ahead of built-in and older entries.
Copies name into a combined allocation and stores the init pointer without invoking it. Registration can shadow existing schemes and need not supply both encoding and decoding. Keep callback code/context live while registered and while any installed handles still use it. Release this registration only with TIFFUnRegisterCODEC(); do not free the returned descriptor or its name separately. Allocation failure uses global diagnostics. The process-global registry is unsynchronised; serialise queries and modifications externally. No registry operation manages active codec state or unloads callback code.
| [in] | scheme | Compression identifier to register. |
| [in] | name | Non-NULL borrowed terminated name, copied synchronously; combined allocation size must be representable. |
| [in] | init | Initialiser callback; a usable registration requires a callable non-NULL function. |
Definition at line 320 of file tif_compress.c.
References _TIFFmallocExt(), _TIFFmemcpy(), _codec::info, TIFFCodec::init, TIFFCodec::name, _codec::next, registeredCODECS, TIFFCodec::scheme, and TIFFErrorExt().
|
extern |
Remove and free an exact registered codec descriptor.
Requires a live descriptor token from TIFFRegisterCODEC(). Removes only that pointer, exposing any older match. Frees the combined allocation and invalidates its descriptor/name plus borrowed copies of that name. Does not clean up installed handles; callback code must still outlive them. An unmatched live descriptor is diagnosed through global handlers; dangling/NULL input is not safe. The process-global registry is unsynchronised; serialise queries and modifications externally. No registry operation manages active codec state or unloads callback code.
| [in] | c | Live registration token, consumed on successful removal; not a configured-list copy or built-in descriptor. |
Definition at line 348 of file tif_compress.c.
References _TIFFfreeExt(), _codec::info, TIFFCodec::name, _codec::next, registeredCODECS, and TIFFErrorExt().