62 "Compression scheme %" PRIu16
63 " %s encoding is not implemented",
114 "Compression scheme %" PRIu16
115 " %s decoding is not implemented",
164 "Compression algorithm does not support random access");
269 return (c ? (*c->
init)(tif, scheme) : 1);
323 size_t name_len = strlen(name) + 1;
331 codec_name = (
char *)((uint8_t *)cd->
info +
sizeof(
TIFFCodec));
342 "No space to register compression scheme %s", name);
361 "Cannot remove compression scheme %s; not registered",
static void _TIFFvoid(TIFF *tif)
Perform no codec close or cleanup work.
int TIFFSetCompressionScheme(TIFF *tif, int scheme)
Reset methods and install the selected compression implementation.
int _TIFFNoTileEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Report unsupported codec encoding.
static int TIFFNoEncode(TIFF *tif, const char *method)
Diagnose an unsupported encoder operation.
void _TIFFSetDefaultCompressionState(TIFF *tif)
Install fallback codec callbacks and reset raw-access flags.
static int _TIFFtrue(TIFF *tif)
Accept a no-op codec setup or completion.
int _TIFFNoTileDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Report unsupported codec decoding.
struct _codec codec_t
Link a dynamically registered codec allocation.
static codec_t * registeredCODECS
Head the newest-first registered codec list.
static uint64_t _TIFFDefaultGetMaxCompressionRatio(TIFF *tif)
Report an unknown codec compression ratio.
static int _TIFFNoFixupTags(TIFF *tif)
Accept a no-op codec tag fixup.
int _TIFFNoRowDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Report unsupported codec decoding.
int _TIFFNoRowEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Report unsupported codec encoding.
static uint64_t _TIFFGetMaxCompressionRatioOne(TIFF *tif)
Report the uncompressed ratio of one.
int _TIFFNoStripEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Report unsupported codec encoding.
static int TIFFNoDecode(TIFF *tif, const char *method)
Diagnose an unsupported decoder operation.
int _TIFFNoStripDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Report unsupported codec decoding.
const TIFFCodec _TIFFBuiltinCODECS[]
Describe built-in compression names and initialisers.
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 _TIFFDefaultTileSize(TIFF *tif, uint32_t *tw, uint32_t *th)
Supply default tile dimensions and round them to multiples of sixteen.
uint32_t _TIFFDefaultStripSize(TIFF *tif, uint32_t s)
Choose a default strip height near STRIP_SIZE_DEFAULT bytes.
void _TIFFfreeExt(TIFF *tif, void *p)
Release a handle-aware allocation and its payload charge.
void * _TIFFreallocExt(TIFF *tif, void *p, tmsize_t s)
Resize a handle-aware block or release it for a nonpositive size.
void * _TIFFmallocExt(TIFF *tif, tmsize_t s)
Allocate uninitialised bytes under a handle's allocation policy.
#define TIFF_UPSAMPLED
Mark codec output that has already been upsampled.
#define TRUE
Represent the legacy internal true value.
#define TIFF_NOREADRAW
Suppress the normal raw-data read path.
#define TIFF_NOBITREV
Suppress automatic bit reversal.
TIFFCodec * TIFFRegisterCODEC(uint16_t scheme, const char *name, TIFFInitMethod init)
Register a codec descriptor ahead of built-in and older entries.
const TIFFCodec * TIFFFindCODEC(uint16_t scheme)
Find the highest-priority descriptor for a compression scheme.
int(* TIFFInitMethod)(TIFF *tif, int scheme)
Install compression methods and private state on a handle.
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.
void TIFFUnRegisterCODEC(TIFFCodec *c)
Remove and free an exact registered codec descriptor.
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Dispatch a error diagnostic to the configured handlers.
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,...)
Dispatch a error diagnostic to the configured handlers.
uint64_t TIFFGetMaxCompressionRatio(TIFF *tif)
Query the codec's allocation-recovery compression-ratio heuristic.
void _TIFFmemset(void *p, int v, tmsize_t c)
Fill a byte range with one repeated byte.
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
Copy a non-overlapping byte range.
TIFF_SSIZE_T tmsize_t
Represent a signed memory or I/O size in bytes.
Describe a named compression scheme and its initialiser.
const char * name
Codec name; storage lifetime follows the API supplying this descriptor.
TIFFInitMethod init
Callback that installs the codec on a TIFF handle.
uint16_t scheme
Compression identifier, such as COMPRESSION_LZW.
uint16_t td_compression
COMPRESSION_* codec identifier.
Link a dynamically registered codec allocation.
TIFFCodec * info
Descriptor stored inside this node allocation.
struct _codec * next
Next older registered node, borrowed within the global list.
Hold private state for one open TIFF library instance.
TIFFTileMethod tif_deftilesize
Codec callback computing or constraining default tile dimensions.
TIFFCodeMethod tif_encodestrip
Codec callback encoding strip data.
TIFFSeekMethod tif_seek
Codec callback advancing within a strip.
TIFFCodeMethod tif_encodetile
Codec callback encoding tile data.
TIFFPreMethod tif_preencode
Codec callback preparing a row, strip, or tile encode.
TIFFBoolMethod tif_fixuptags
Codec callback for directory-dependent tag corrections.
TIFFPreMethod tif_predecode
Codec callback preparing a row, strip, or tile decode.
TIFFCodeMethod tif_decodestrip
Codec callback decoding strip data.
TIFFGetMaxCompressionRatioMethod tif_getmaxcompressionratio
Codec callback returning its maximum compression ratio.
TIFFStripMethod tif_defstripsize
Codec callback computing or constraining a default strip size.
char * tif_name
Current filename pointer; may refer to inline or client-supplied storage.
TIFFCodeMethod tif_decoderow
Codec callback decoding a scanline.
TIFFBoolMethod tif_setupencode
Codec setup callback run before preencode.
TIFFDirectory tif_dir
Inline representation of the current image directory.
TIFFBoolMethod tif_postencode
Codec callback completing buffered encoding.
TIFFCodeMethod tif_encoderow
Codec callback encoding a scanline.
TIFFVoidMethod tif_close
Codec close callback; distinct from the client I/O close callback.
int tif_decodestatus
Nonzero unless the selected scheme is a known but unconfigured codec; not a setup result.
int tif_encodestatus
Nonzero unless the selected scheme is a known but unconfigured codec; never read.
TIFFVoidMethod tif_cleanup
Codec callback releasing codec-private state.
TIFFBoolMethod tif_setupdecode
Codec setup callback run before predecode.
uint32_t tif_flags
Bitmask combining the TIFF_* handle-state flags declared below.
TIFFCodeMethod tif_decodetile
Codec callback decoding tile data.
Declare private library state, callbacks, and implementation helpers.