|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Implement uncompressed PackBits ThunderScan and NeXT transfers. More...
Data Structures | |
| struct | TIFFByteCursor |
| Track a borrowed byte range as a pointer and a remaining count. More... | |
Macros | |
| #define | SETPIXEL(op, v) |
| Store a 2-bit pixel into the packed output byte at op. | |
| #define | LITERALROW 0x00 |
| NeXT row opcode: the scanline follows as td_scanlinesize literal bytes. | |
| #define | LITERALSPAN 0x40 |
| NeXT row opcode: a 16-bit big-endian offset and length precede a literal byte span within the white scanline. | |
| #define | THUNDER_CODE 0xc0 /* mask for 2-bit code word */ |
| Mask selecting the 2-bit code word in the top bits of a ThunderScan byte. | |
| #define | THUNDER_RUN 0x00 /* run of pixels w/ encoded count */ |
| ThunderScan code word for a run of the previous pixel. | |
| #define | THUNDER_2BITDELTAS 0x40 /* 3 pixels w/ encoded 2-bit deltas */ |
| ThunderScan code word for three packed 2-bit pixel deltas. | |
| #define | DELTA2_SKIP 2 /* skip code for 2-bit deltas */ |
| 2-bit delta value meaning "no pixel" in a THUNDER_2BITDELTAS byte. | |
| #define | THUNDER_3BITDELTAS 0x80 /* 2 pixels w/ encoded 3-bit deltas */ |
| ThunderScan code word for two packed 3-bit pixel deltas. | |
| #define | DELTA3_SKIP 4 /* skip code for 3-bit deltas */ |
| 3-bit delta value meaning "no pixel" in a THUNDER_3BITDELTAS byte. | |
| #define | THUNDER_RAW 0xc0 /* raw data encoded */ |
| ThunderScan code word for a literal 4-bit pixel. | |
| #define | SETPIXEL(op, v) |
| Store a 4-bit pixel into the packed output if maxpixels has not been reached. | |
Functions | |
| static int | _TIFFByteCursorGetU8 (TIFFByteCursor *c, uint8_t *out) |
| Read one byte from a cursor. | |
| static int | _TIFFByteCursorFill (TIFFByteCursor *dst, uint8_t value, tmsize_t n) |
| Write n copies of value to a cursor. | |
| static int | _TIFFByteCursorCopy (TIFFByteCursor *dst, TIFFByteCursor *src, tmsize_t n) |
| Move n bytes from src to dst. | |
| static int | DumpFixupTags (TIFF *tif) |
| Accept uncompressed tag fixup without changes. | |
| static int | DumpModeEncode (TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s) |
| Copy uncompressed bytes into the raw output buffer. | |
| static int | DumpModeDecode (TIFF *tif, uint8_t *buf, tmsize_t cc, uint16_t s) |
| Copy uncompressed raw input into decoded output. | |
| static int | DumpModeSeek (TIFF *tif, uint32_t nrows) |
| Advance uncompressed raw input by complete scanlines. | |
| static int | NeXTDecode (TIFF *tif, uint8_t *buf, tmsize_t occ, uint16_t s) |
| Expand NeXT literal rows spans and grayscale runs. | |
| static int | NeXTPreDecode (TIFF *tif, uint16_t s) |
| Validate two-bit single-plane NeXT decoding. | |
| static int | PackBitsPreEncode (TIFF *tif, uint16_t s) |
| Allocate and cache the PackBits row byte extent. | |
| static int | PackBitsPostEncode (TIFF *tif) |
| Release the PackBits cached row-size allocation. | |
| static int | PackBitsEncode (TIFF *tif, uint8_t *buf, tmsize_t cc, uint16_t s) |
| Encode one byte run region using PackBits packets. | |
| static int | PackBitsEncodeChunk (TIFF *tif, uint8_t *bp, tmsize_t cc, uint16_t s) |
| Split PackBits input into row-bounded encoding requests. | |
| static int | PackBitsDecode (TIFF *tif, uint8_t *op, tmsize_t occ, uint16_t s) |
| Expand PackBits packets into a bounded byte destination. | |
| static uint64_t | PackBitsGetMaxCompressionRatio (TIFF *tif) |
| Report the PackBits expansion heuristic. | |
| static int | ThunderSetupDecode (TIFF *tif) |
| Validate four-bit single-plane ThunderScan decoding. | |
| static int | ThunderDecode (TIFF *tif, uint8_t *op0, tmsize_t maxpixels) |
| Expand one ThunderScan row into packed four-bit samples. | |
| static int | ThunderDecodeRow (TIFF *tif, uint8_t *buf, tmsize_t occ, uint16_t s) |
| Decode complete ThunderScan scanlines into caller storage. | |
| int | TIFFInitDumpMode (TIFF *tif, int scheme) |
| Install uncompressed transfer callbacks. | |
| int | TIFFInitPackBits (TIFF *tif, int scheme) |
| Install PackBits transfer callbacks. | |
| int | TIFFInitThunderScan (TIFF *tif, int scheme) |
| Install ThunderScan transfer callbacks. | |
| int | TIFFInitNeXT (TIFF *tif, int scheme) |
| Install NeXT transfer callbacks. | |
Variables | |
| static const int | twobitdeltas [4] = {0, 1, 0, -1} |
| Map two-bit delta codes to signed pixel increments. | |
| static const int | threebitdeltas [8] = {0, 1, 2, 3, 0, -3, -2, -1} |
| Map three-bit delta codes to signed pixel increments. | |
Implement uncompressed PackBits ThunderScan and NeXT transfers.
| #define DELTA2_SKIP 2 /* skip code for 2-bit deltas */ |
2-bit delta value meaning "no pixel" in a THUNDER_2BITDELTAS byte.
Definition at line 77 of file tif_thunder.c.
| #define DELTA3_SKIP 4 /* skip code for 3-bit deltas */ |
3-bit delta value meaning "no pixel" in a THUNDER_3BITDELTAS byte.
Definition at line 89 of file tif_thunder.c.
| #define LITERALROW 0x00 |
NeXT row opcode: the scanline follows as td_scanlinesize literal bytes.
Definition at line 81 of file tif_next.c.
| #define LITERALSPAN 0x40 |
NeXT row opcode: a 16-bit big-endian offset and length precede a literal byte span within the white scanline.
Any other leading byte starts a sequence of grey runs.
Definition at line 89 of file tif_next.c.
| #define SETPIXEL | ( | op, | |
| v | |||
| ) |
Store a 2-bit pixel into the packed output byte at op.
Store a 4-bit pixel into the packed output if maxpixels has not been reached.
Statement macro used by the run branch of NeXTDecode(). Increments the caller local npixels and, by its previous value mod 4, places v in bits 7-6 (assigning op[0], which clears the rest), 5-4, 3-2 or 1-0 (ORing into op[0]). After the fourth pixel it advances op and increments the caller local op_offset. Performs no bounds check: the caller loop stops when npixels reaches the image width or op_offset reaches the scanline size. v is evaluated once and must fit in 2 bits. The break statements belong to the macro's internal switch; no hidden control flow.
| [in,out] | op | Output byte-pointer lvalue, advanced every fourth pixel. |
| [in] | v | Pixel value 0-3. |
Statement macro used by ThunderDecode(). Always sets the caller local lastpixel to (v) & 0xf, so later deltas are relative to it. If npixels < maxpixels it increments npixels and writes the nibble: an even pixel index stores it in the high nibble of op[0] (clearing the low nibble), an odd index ORs it into the low nibble and advances op. Pixels beyond maxpixels are dropped silently; ThunderDecode() reports the count mismatch afterwards. v is evaluated once; op is read and may be incremented once. No hidden control flow.
| [in,out] | op | Output byte-pointer lvalue, advanced after each odd pixel. |
| [in] | v | Pixel value; only the low 4 bits are used. |
Definition at line 54 of file tif_next.c.
| #define SETPIXEL | ( | op, | |
| v | |||
| ) |
Store a 4-bit pixel into the packed output if maxpixels has not been reached.
Statement macro used by ThunderDecode(). Always sets the caller local lastpixel to (v) & 0xf, so later deltas are relative to it. If npixels < maxpixels it increments npixels and writes the nibble: an even pixel index stores it in the high nibble of op[0] (clearing the low nibble), an odd index ORs it into the low nibble and advances op. Pixels beyond maxpixels are dropped silently; ThunderDecode() reports the count mismatch afterwards. v is evaluated once; op is read and may be incremented once. No hidden control flow.
| [in,out] | op | Output byte-pointer lvalue, advanced after each odd pixel. |
| [in] | v | Pixel value; only the low 4 bits are used. |
Definition at line 131 of file tif_thunder.c.
| #define THUNDER_2BITDELTAS 0x40 /* 3 pixels w/ encoded 2-bit deltas */ |
ThunderScan code word for three packed 2-bit pixel deltas.
Deltas sit in bits 5-4, 3-2 and 1-0 and index twobitdeltas.
Definition at line 72 of file tif_thunder.c.
| #define THUNDER_3BITDELTAS 0x80 /* 2 pixels w/ encoded 3-bit deltas */ |
ThunderScan code word for two packed 3-bit pixel deltas.
Deltas sit in bits 5-3 and 2-0 and index threebitdeltas.
Definition at line 84 of file tif_thunder.c.
| #define THUNDER_CODE 0xc0 /* mask for 2-bit code word */ |
Mask selecting the 2-bit code word in the top bits of a ThunderScan byte.
The remaining low 6 bits carry the run count, packed deltas or raw pixel.
Definition at line 57 of file tif_thunder.c.
| #define THUNDER_RAW 0xc0 /* raw data encoded */ |
ThunderScan code word for a literal 4-bit pixel.
Same value as THUNDER_CODE; the pixel is in the low 4 bits.
Definition at line 96 of file tif_thunder.c.
| #define THUNDER_RUN 0x00 /* run of pixels w/ encoded count */ |
ThunderScan code word for a run of the previous pixel.
The low 6 bits give the repeat count; a count of zero emits nothing.
Definition at line 65 of file tif_thunder.c.
|
inlinestatic |
Move n bytes from src to dst.
On success both cursors advance by n bytes. The two ranges must not overlap.
| [in,out] | dst | Non-NULL cursor over writable storage. |
| [in,out] | src | Non-NULL cursor over readable storage. |
| [in] | n | Number of bytes to move. |
Definition at line 115 of file tif_bytecursor.h.
References _TIFFmemcpy(), TIFFByteCursor::left, and TIFFByteCursor::p.
Referenced by PackBitsDecode().
|
inlinestatic |
Write n copies of value to a cursor.
On success the cursor advances by n bytes.
| [in,out] | dst | Non-NULL cursor over writable storage. |
| [in] | value | Byte value to write. |
| [in] | n | Number of bytes to write. |
Definition at line 91 of file tif_bytecursor.h.
References _TIFFmemset(), TIFFByteCursor::left, and TIFFByteCursor::p.
Referenced by PackBitsDecode().
|
inlinestatic |
Read one byte from a cursor.
On success the cursor advances by one byte.
| [in,out] | c | Non-NULL cursor to read from. |
| [out] | out | Non-NULL destination for the byte read; left untouched if no byte is left. |
Definition at line 70 of file tif_bytecursor.h.
References TIFFByteCursor::left, and TIFFByteCursor::p.
Referenced by PackBitsDecode().
|
static |
Accept uncompressed tag fixup without changes.
Ignores tif; no allocation, I/O, diagnostics, ownership or state effects.
| [in] | tif | Handle (ignored). |
Definition at line 46 of file tif_dumpmode.c.
Referenced by TIFFInitDumpMode().
Copy uncompressed raw input into decoded output.
Checks available rawcc before copying, skips exact-pointer self-copy, then advances rawcp and reduces rawcc. Requires nonnegative cc and sufficient destination; nonidentical overlap is unsupported. Diagnoses insufficient data without copying, zeroing the cc destination bytes instead. No allocation, file I/O or ownership transfer.
| [in,out] | tif | Non-NULL live handle whose raw cursor and count are consumed; serialise access. |
| [out] | buf | Borrowed writable decoded output covering the requested byte extent. |
| [in] | cc | Nonnegative number of bytes to copy out of the raw buffer. |
| [in] | s | Sample plane (ignored). |
Definition at line 124 of file tif_dumpmode.c.
References _TIFFmemcpy(), TIFFDirectory::td_row, tiff::tif_dir, tiff::tif_rawcc, tiff::tif_rawcp, TIFF_SSIZE_FORMAT, and TIFFErrorExtR().
Referenced by TIFFInitDumpMode().
Copy uncompressed bytes into the raw output buffer.
Requires positive usable raw capacity and coherent cursor/counts. Copies input unless it already equals rawcp, advances cursors and flushes when full. Flush can write/seek and diagnose; partial file/cache changes survive failure. Nonidentical overlapping regions are not supported. No input ownership transfer.
| [in,out] | tif | Non-NULL live handle with an allocated raw buffer; the raw cursor and count advance and TIFFFlushData1() can be called; serialise access. |
| [in] | pp | Borrowed readable input of cc bytes. |
| [in] | cc | Nonnegative number of input bytes to buffer. |
| [in] | s | Sample plane (ignored). |
Definition at line 73 of file tif_dumpmode.c.
References _TIFFmemcpy(), tiff::tif_rawcc, tiff::tif_rawcp, tiff::tif_rawdatasize, and TIFFFlushData1().
Referenced by TIFFInitDumpMode().
|
static |
Advance uncompressed raw input by complete scanlines.
Uses cached nonnegative scanline byte size, checks multiplication and available rawcc, then advances rawcp and reduces rawcc. Diagnoses rejection; no client seek, allocation or ownership transfer.
| [in,out] | tif | Non-NULL live handle whose cached scanline size is read and raw cursor and count are advanced; serialise access. |
| [in] | nrows | Nonnegative number of complete cached scanlines to skip. |
Definition at line 167 of file tif_dumpmode.c.
References TIFFDirectory::td_scanlinesize, tiff::tif_dir, tiff::tif_rawcc, tiff::tif_rawcp, TIFF_TMSIZE_T_MAX, and TIFFErrorExtR().
Referenced by TIFFInitDumpMode().
Expand NeXT literal rows spans and grayscale runs.
Initialises the whole requested output to white, then checks complete scanline divisibility and decodes available cached input. Requires positive cached row size, nonnegative output extent, matching width and disjoint storage. Malformed spans/runs diagnose and return zero without generally committing local raw cursor progress; output can already be changed. Input exhaustion between rows can end the loop with a successful status and white remaining rows. Normal completion commits raw cursor/counts. No allocation/client I/O or ownership transfer.
| [in,out] | tif | Non-NULL live handle with validated two-bit geometry whose raw cursor and count are updated on success; serialise access. |
| [out] | buf | Borrowed writable decoded output covering the requested byte extent. |
| [in] | occ | Nonnegative decoded output byte extent. |
| [in] | s | Sample plane (ignored). |
Definition at line 113 of file tif_next.c.
References _TIFFmemcpy(), isTiled, LITERALROW, LITERALSPAN, SETPIXEL, TIFFDirectory::td_imagewidth, TIFFDirectory::td_row, TIFFDirectory::td_scanlinesize, TIFFDirectory::td_tilewidth, tiff::tif_dir, tiff::tif_rawcc, tiff::tif_rawcp, and TIFFErrorExtR().
Referenced by TIFFInitNeXT().
|
static |
Validate two-bit single-plane NeXT decoding.
Requires BitsPerSample two and either one sample or separate planes. Diagnoses unsupported settings; no allocation, I/O, buffer changes or ownership transfer.
| [in] | tif | Non-NULL live handle whose BitsPerSample, SamplesPerPixel and PlanarConfiguration are checked; serialise access. |
| [in] | s | Sample plane (ignored). |
Definition at line 239 of file tif_next.c.
References PLANARCONFIG_SEPARATE, tiff::tif_dir, and TIFFErrorExtR().
Referenced by TIFFInitNeXT().
Expand PackBits packets into a bounded byte destination.
Consumes raw cached bytes, ignores -128 no-op packets and clips overlong output runs with warnings. Short input warns, clears the unfilled output tail, diagnoses and returns zero. Raw cursor/counts are updated even on incomplete output. No allocation/client I/O or ownership transfer; requires nonnegative output length and disjoint storage.
| [in,out] | tif | Non-NULL live handle whose raw cursor and count are consumed and updated; serialise access. |
| [out] | op | Borrowed writable output of occ bytes. |
| [in] | occ | Nonnegative decoded output byte extent. |
| [in] | s | Sample plane (ignored). |
Definition at line 370 of file tif_packbits.c.
References _TIFFByteCursorCopy(), _TIFFByteCursorFill(), _TIFFByteCursorGetU8(), TIFFByteCursor::left, TIFFByteCursor::p, TIFFDirectory::td_row, tiff::tif_dir, tiff::tif_rawcc, tiff::tif_rawcp, TIFF_SSIZE_FORMAT, TIFFErrorExtR(), and TIFFWarningExtR().
Referenced by TIFFInitPackBits().
Encode one byte run region using PackBits packets.
Requires nonnegative input length and an allocated raw output buffer. Combines literal and repeated runs, caps packet lengths at 128, and flushes preserving pending literals as needed. If the raw buffer still lacks room for the next packet byte(s) after a flush, as can happen with a small caller-supplied buffer, it records the bytes already encoded in the raw cursor and count, emits an error and fails rather than overrun the buffer. Does not modify caller input. Output/cursors and file bytes can change before a failure; diagnostics follow I/O helpers. No returned ownership.
| [in,out] | tif | Non-NULL live handle with an allocated raw buffer; the raw cursor and count advance and TIFFFlushData1() can be called; serialise access. |
| [in] | buf | Borrowed readable input covering the requested byte extent. |
| [in] | cc | Nonnegative number of input bytes to encode. |
| [in] | s | Sample plane (ignored). |
Begin a new packet.
Extend the current literal packet.
Continue after a repeated-byte packet.
Remember a literal followed by a run for possible merging.
Definition at line 122 of file tif_packbits.c.
References tiff::tif_rawcc, tiff::tif_rawcp, tiff::tif_rawdata, tiff::tif_rawdatasize, TIFF_SSIZE_FORMAT, TIFFErrorExtR(), and TIFFFlushData1().
Referenced by PackBitsEncodeChunk(), and TIFFInitPackBits().
Split PackBits input into row-bounded encoding requests.
Requires positive cached rowsize and a nonnegative input extent. Breaks at row boundaries, permitting a final partial row. Stops at the first inner encoder failure and releases the preencode state with PackBitsPostEncode(), since the caller then returns without calling tif_postencode. Caller input remains borrowed; raw/file state can change.
| [in,out] | tif | Non-NULL live handle whose tif_data holds the cached row size from PackBitsPreEncode(); serialise access. |
| [in] | bp | Borrowed readable input of cc bytes. |
| [in] | cc | Nonnegative number of input bytes, split into row-sized chunks. |
| [in] | s | Sample plane, forwarded unchanged to PackBitsEncode(). |
Definition at line 325 of file tif_packbits.c.
References PackBitsEncode(), PackBitsPostEncode(), and tiff::tif_data.
Referenced by TIFFInitPackBits().
|
static |
Report the PackBits expansion heuristic.
Returns an empirical ratio without inspecting the handle, allocating, mutating state or doing I/O; not a validity proof or universal bound.
| [in] | tif | Handle (ignored). |
Definition at line 449 of file tif_packbits.c.
Referenced by TIFFInitPackBits().
|
static |
Release the PackBits cached row-size allocation.
Frees non-NULL tif_data using Ext allocation and clears the pointer, so a repeated call is harmless. PackBitsEncodeChunk() also calls it when encoding fails, because the caller then skips tif_postencode. No payload flush, I/O or separate diagnostic status.
| [in,out] | tif | Non-NULL live handle whose tif_data allocation, if any, is freed and reset to NULL; serialise access. |
Definition at line 87 of file tif_packbits.c.
References _TIFFfreeExt(), and tiff::tif_data.
Referenced by PackBitsEncodeChunk(), and TIFFInitPackBits().
|
static |
Allocate and cache the PackBits row byte extent.
Allocates a handle-owned tmsize_t slot and computes tile-row or scanline size. Requires no previous unreleased tif_data allocation. The calculated size is not checked here; chunk encoding requires it positive. No payload I/O.
| [in,out] | tif | Non-NULL live handle with matching validated geometry and codec methods; serialise access. |
| [in] | s | Sample plane (ignored). |
Definition at line 57 of file tif_packbits.c.
References _TIFFmallocExt(), isTiled, tiff::tif_data, TIFFScanlineSize(), and TIFFTileRowSize().
Referenced by TIFFInitPackBits().
Expand one ThunderScan row into packed four-bit samples.
Consumes raw/delta/run codes, writes high nibble first, and bounds emitted pixels by maxpixels. Updates raw cursor/counts; diagnoses too few/many pixels and clears the remaining packed tail on rejection. Requires nonnegative representable pixel count and ceil(maxpixels/2) destination bytes. No allocation/client I/O or ownership transfer.
| [in,out] | tif | Non-NULL live handle whose raw cursor and count are consumed and updated; serialise access. |
| [out] | op0 | Borrowed writable packed four-bit output for maxpixels pixels. |
| [in] | maxpixels | Nonnegative target pixel count with representable rounded packed size. |
Definition at line 198 of file tif_thunder.c.
References DELTA2_SKIP, DELTA3_SKIP, SETPIXEL, TIFFDirectory::td_row, threebitdeltas, THUNDER_2BITDELTAS, THUNDER_3BITDELTAS, THUNDER_CODE, THUNDER_RAW, THUNDER_RUN, tiff::tif_dir, tiff::tif_rawcc, tiff::tif_rawcp, TIFFErrorExtR(), and twobitdeltas.
Referenced by ThunderDecodeRow().
Decode complete ThunderScan scanlines into caller storage.
Requires positive cached scanline size, nonnegative extent divisible by it, and validated four-bit geometry. Calls ThunderDecode per row. On a failed row clears that entire row and the remaining requested output, leaving earlier rows and raw progress. No allocation/client I/O or ownership transfer.
| [in,out] | tif | Non-NULL live handle with validated four-bit geometry whose raw cursor and count are consumed; serialise access. |
| [out] | buf | Borrowed writable decoded output covering the requested byte extent. |
| [in] | occ | Nonnegative decoded output byte extent. |
| [in] | s | Sample plane (ignored). |
Definition at line 305 of file tif_thunder.c.
References TIFFDirectory::td_imagewidth, TIFFDirectory::td_scanlinesize, ThunderDecode(), tiff::tif_dir, and TIFFErrorExtR().
Referenced by TIFFInitThunderScan().
|
static |
Validate four-bit single-plane ThunderScan decoding.
Requires BitsPerSample four and either one sample or separate planes. Diagnoses unsupported settings; no allocation, I/O, buffer changes or ownership transfer.
| [in] | tif | Non-NULL live handle whose BitsPerSample, SamplesPerPixel and PlanarConfiguration are checked; serialise access. |
Definition at line 155 of file tif_thunder.c.
References PLANARCONFIG_SEPARATE, TIFFDirectory::td_bitspersample, TIFFDirectory::td_planarconfig, TIFFDirectory::td_samplesperpixel, tiff::tif_dir, and TIFFErrorExtR().
Referenced by TIFFInitThunderScan().
|
extern |
Install uncompressed transfer callbacks.
Requires prior default compression state and cleanup of any previous codec. Assigns supported callbacks without allocating outer state or touching payload. Installs direct-copy encoding/decoding and buffered forward row seek. No ownership transfer; later transfer callbacks have their own state and I/O effects.
| [in,out] | tif | Non-NULL live handle whose codec methods are overwritten; geometry is not consulted. Serialise access. |
| [in] | scheme | Unused compatibility compression identifier. |
Definition at line 192 of file tif_dumpmode.c.
References DumpFixupTags(), DumpModeDecode(), DumpModeEncode(), DumpModeSeek(), tiff::tif_decoderow, tiff::tif_decodestrip, tiff::tif_decodetile, tiff::tif_encoderow, tiff::tif_encodestrip, tiff::tif_encodetile, tiff::tif_fixuptags, and tiff::tif_seek.
|
extern |
Install NeXT transfer callbacks.
Requires prior default compression state and cleanup of any previous codec. Assigns supported callbacks without allocating outer state or touching payload. NeXT installs decode-only row/strip/tile methods. No ownership transfer; later transfer callbacks have their own state and I/O effects.
| [in,out] | tif | Non-NULL live handle whose codec methods are overwritten; geometry is not consulted. Serialise access. |
| [in] | scheme | Unused compatibility compression identifier. |
Definition at line 262 of file tif_next.c.
References NeXTDecode(), NeXTPreDecode(), tiff::tif_decoderow, tiff::tif_decodestrip, tiff::tif_decodetile, and tiff::tif_predecode.
|
extern |
Install PackBits transfer callbacks.
Requires prior default compression state and cleanup of any previous codec. Assigns supported callbacks without allocating outer state or touching payload. PackBits encoding callbacks are omitted in PACKBITS_READ_ONLY builds. No ownership transfer; later transfer callbacks have their own state and I/O effects.
| [in,out] | tif | Non-NULL live handle whose codec methods are overwritten; geometry is not consulted. Serialise access. |
| [in] | scheme | Unused compatibility compression identifier. |
Definition at line 459 of file tif_packbits.c.
References PackBitsDecode(), PackBitsEncode(), PackBitsEncodeChunk(), PackBitsGetMaxCompressionRatio(), PackBitsPostEncode(), PackBitsPreEncode(), tiff::tif_decoderow, tiff::tif_decodestrip, tiff::tif_decodetile, tiff::tif_encoderow, tiff::tif_encodestrip, tiff::tif_encodetile, tiff::tif_getmaxcompressionratio, tiff::tif_postencode, and tiff::tif_preencode.
|
extern |
Install ThunderScan transfer callbacks.
Requires prior default compression state and cleanup of any previous codec. Assigns supported callbacks without allocating outer state or touching payload. ThunderScan installs row/strip decoding only; no tile encoder/decoder is installed. No ownership transfer; later transfer callbacks have their own state and I/O effects.
| [in,out] | tif | Non-NULL live handle whose codec methods are overwritten; geometry is not consulted. Serialise access. |
| [in] | scheme | Unused compatibility compression identifier. |
Definition at line 335 of file tif_thunder.c.
References ThunderDecodeRow(), ThunderSetupDecode(), tiff::tif_decoderow, tiff::tif_decodestrip, and tiff::tif_setupdecode.
|
static |
Map three-bit delta codes to signed pixel increments.
Indexed by a 3-bit delta field; index DELTA3_SKIP is never looked up.
Definition at line 111 of file tif_thunder.c.
Referenced by ThunderDecode().
|
static |
Map two-bit delta codes to signed pixel increments.
Indexed by a 2-bit delta field; index DELTA2_SKIP is never looked up.
Definition at line 104 of file tif_thunder.c.
Referenced by ThunderDecode().