|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Describe per-handle storage, state flags, and basic internal helpers. More...
Data Structures | |
| struct | client_info |
| Link a named client-data association to a TIFF handle. More... | |
| struct | TIFFOffsetAndDirNumber |
| Pair a directory file offset with its main-IFD index. More... | |
| struct | tiff |
| Hold private state for one open TIFF library instance. More... | |
| struct | TIFFOpenOptions |
| Hold allocation limits and diagnostics used when opening a TIFF handle. More... | |
Macros | |
| #define | TIFF_NON_EXISTENT_DIR_NUMBER UINT_MAX |
| Mark an unknown or nonexistent directory index. | |
| #define | streq(a, b) (strcmp(a, b) == 0) |
| Compare two null-terminated strings for equality. | |
| #define | strneq(a, b, n) (strncmp(a, b, n) == 0) |
| Compare up to n bytes of two strings for equality. | |
| #define | TRUE 1 |
| Represent the legacy internal true value. | |
| #define | FALSE 0 |
| Represent the legacy internal false value. | |
| #define | TIFF_FILLORDER 0x00003U |
| Mask the selected data bit-fill-order bits in tif_flags. | |
| #define | TIFF_DIRTYHEADER 0x00004U |
| Mark a file header that needs writing. | |
| #define | TIFF_DIRTYDIRECT 0x00008U |
| Mark a current directory that needs writing. | |
| #define | TIFF_BUFFERSETUP 0x00010U |
| Mark completed data-buffer setup. | |
| #define | TIFF_CODERSETUP 0x00020U |
| Mark completed codec setup. | |
| #define | TIFF_BEENWRITING 0x00040U |
| Record that scanline or image-data writing has begun. | |
| #define | TIFF_SWAB 0x00080U |
| Request swapping multibyte file values to or from host order. | |
| #define | TIFF_NOBITREV 0x00100U |
| Suppress automatic bit reversal. | |
| #define | TIFF_MYBUFFER 0x00200U |
| Mark a raw buffer owned and released by the handle. | |
| #define | TIFF_ISTILED 0x00400U |
| Mark tile-based rather than strip-based image storage. | |
| #define | TIFF_MAPPED 0x00800U |
| Request or record memory-mapped file access. | |
| #define | TIFF_POSTENCODE 0x01000U |
| Request a pending codec postencode call. | |
| #define | TIFF_INSUBIFD 0x02000U |
| Mark writing within a SubIFD sequence. | |
| #define | TIFF_UPSAMPLED 0x04000U |
| Mark codec output that has already been upsampled. | |
| #define | TIFF_STRIPCHOP 0x08000U |
| Enable internal chopping of a large uncompressed strip. | |
| #define | TIFF_HEADERONLY 0x10000U |
| Request header-only opening without reading the first IFD. | |
| #define | TIFF_NOREADRAW 0x20000U |
| Suppress the normal raw-data read path. | |
| #define | TIFF_INCUSTOMIFD 0x40000U |
| Mark writing of a custom IFD. | |
| #define | TIFF_BIGTIFF 0x80000U |
| Mark the BigTIFF file format. | |
| #define | TIFF_BUF4WRITE 0x100000U |
| Interpret the raw buffer and its byte count as pending output. | |
| #define | TIFF_DIRTYSTRIP 0x200000U |
| Mark strip/tile offset or byte-count arrays that need writing. | |
| #define | TIFF_PERSAMPLE 0x400000U |
| Select per-sample arrays for supported sample-valued fields. | |
| #define | TIFF_BUFFERMMAP 0x800000U |
| Mark raw data that borrows mapped-file storage. | |
| #define | TIFF_DEFERSTRILELOAD 0x1000000U |
| Defer loading strip/tile offset and byte-count arrays. | |
| #define | TIFF_LAZYSTRILELOAD_DONE 0x2000000U |
| Record a switch from on-demand to full strip/tile-array loading. | |
| #define | TIFF_CHOPPEDUPARRAYS 0x4000000U |
| Mark strip arrays replaced by the strip-chopping operation. | |
| #define | TIFF_LAZYSTRILELOAD_ASKED 0x8000000U |
| Record a lazy strip/tile loading request from the O open flag. | |
| #define | isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */ |
| Test whether a tag identifier is outside the on-disk 16-bit range. | |
| #define | isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0) |
| Test whether a handle uses tiled storage. | |
| #define | isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0) |
| Test whether TIFF_MAPPED is set on a handle. | |
| #define | isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0) |
| Test whether selected bit-fill-order bits are present in a handle. | |
| #define | isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0) |
| Test whether the codec reports upsampled output. | |
| #define | TIFFReadFile(tif, buf, size) ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size))) |
| Invoke the handle's client read callback. | |
| #define | TIFFWriteFile(tif, buf, size) ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size))) |
| Invoke the handle's client write callback. | |
| #define | TIFFSeekFile(tif, off, whence) ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence))) |
| Invoke the handle's client seek callback. | |
| #define | TIFFCloseFile(tif) ((*(tif)->tif_closeproc)((tif)->tif_clientdata)) |
| Invoke the handle's client close callback. | |
| #define | TIFFGetFileSize(tif) ((*(tif)->tif_sizeproc)((tif)->tif_clientdata)) |
| Invoke the handle's client size callback. | |
| #define | TIFFMapFileContents(tif, paddr, psize) ((*(tif)->tif_mapproc)((tif)->tif_clientdata, (paddr), (psize))) |
| Invoke the handle's client mapping callback. | |
| #define | TIFFUnmapFileContents(tif, addr, size) ((*(tif)->tif_unmapproc)((tif)->tif_clientdata, (addr), (size))) |
| Invoke the handle's client unmapping callback. | |
| #define | ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (tmsize_t)(size)) |
| Test whether one client read transfers the entire requested byte count. | |
| #define | SeekOK(tif, off) _TIFFSeekOK(tif, off) |
| Test whether an absolute seek reaches the requested file position. | |
| #define | WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (tmsize_t)(size)) |
| Test whether one client write transfers the entire requested byte count. | |
| #define | TIFFhowmany_32(x, y) |
| Compute a guarded 32-bit ceiling quotient. | |
| #define | TIFFhowmany_32_maxuint_compat(x, y) |
| Compute a 32-bit ceiling quotient without adding x and y first. | |
| #define | TIFFhowmany8_32(x) (((x) & 0x07) ? ((uint32_t)(x) >> 3) + 1 : (uint32_t)(x) >> 3) |
| Compute the byte count needed to hold a 32-bit bit count. | |
| #define | TIFFroundup_32(x, y) ((uint32_t)(TIFFhowmany_32(x, y) * (uint32_t)(y))) |
| Round a 32-bit value up to a multiple using the guarded quotient. | |
| #define | TIFFhowmany_64(x, y) ((((uint64_t)(x)) + (((uint64_t)(y)) - 1)) / ((uint64_t)(y))) |
| Compute a 64-bit ceiling quotient using an unchecked addition. | |
| #define | TIFFhowmany8_64(x) (((x) & 0x07) ? ((uint64_t)(x) >> 3) + 1 : (uint64_t)(x) >> 3) |
| Compute the byte count needed to hold a 64-bit bit count. | |
| #define | TIFFroundup_64(x, y) ((uint64_t)(TIFFhowmany_64(x, y) * (uint64_t)(y))) |
| Round a 64-bit value up to a multiple without overflow checks. | |
| #define | TIFFSafeMultiply(t, v, m) |
| Multiply in a caller-selected unsigned type with a reverse-division check. | |
| #define | TIFFSafeModMul32(tif, module, index, count, dimension, result) |
| Compute (index modulo count) times dimension with a checked product. | |
| #define | TIFFmax(A, B) ((A) > (B) ? (A) : (B)) |
| Select the first operand if it is greater, otherwise the second. | |
| #define | TIFFmin(A, B) ((A) < (B) ? (A) : (B)) |
| Select the first operand if it is smaller, otherwise the second. | |
| #define | TIFFArrayCount(a) (sizeof(a) / sizeof((a)[0])) |
| Compute the element count of an actual array. | |
| #define | TIFF_FLOAT_EQ(x, y) (!(fabsf((x) - (y)) > 0.0f)) |
| Test whether a float difference is not greater than zero in magnitude. | |
| #define | TIFF_DOUBLE_EQ(x, y) (!(fabs((x) - (y)) > 0.0)) |
| Test whether a double difference is not greater than zero in magnitude. | |
| #define | _TIFF_lseek_f(fildes, offset, whence) lseek(fildes, offset, whence) |
| Seek a file descriptor through the platform large-file interface. | |
| #define | _TIFF_fseek_f(stream, offset, whence) fseek(stream, offset, whence) |
| Seek a stream through the platform large-file interface. | |
| #define | _TIFF_fstat_f(fildes, stat_buff) fstat(fildes, stat_buff) |
| Query file status through the platform large-file interface. | |
| #define | _TIFF_stat_s struct stat |
| Select the platform file-status structure type. | |
| #define | _TIFF_off_t off_t |
| Select the platform large-file offset type. | |
| #define | TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW |
| Suppress unsigned-overflow instrumentation on supported Clang functions. | |
Typedefs | |
| typedef struct client_info | TIFFClientInfoLink |
| Link a named client-data association to a TIFF handle. | |
| typedef unsigned char | tidataval_t |
| Name a legacy internal image byte. | |
| typedef tidataval_t * | tidata_t |
| Name a legacy pointer to internal image bytes. | |
| typedef struct TIFFOffsetAndDirNumber | TIFFOffsetAndDirNumber |
| Name the TIFFOffsetAndDirNumber record type. | |
| typedef size_t | TIFFIOSize_t |
| Represent a native POSIX I/O byte count. | |
Describe per-handle storage, state flags, and basic internal helpers.
| #define _TIFF_fseek_f | ( | stream, | |
| offset, | |||
| whence | |||
| ) | fseek(stream, offset, whence) |
Seek a stream through the platform large-file interface.
Forwards arguments and results to the selected C runtime interface. File position, errno, output validity after failure, and other effects follow that interface. This wrapper adds no library diagnostics or ownership transfer. Each argument is evaluated once.
| [in,out] | stream | Valid FILE stream. |
| [in] | offset | Offset in bytes interpreted by whence. |
| [in] | whence | Standard seek origin. |
| #define _TIFF_fstat_f | ( | fildes, | |
| stat_buff | |||
| ) | fstat(fildes, stat_buff) |
Query file status through the platform large-file interface.
Forwards arguments and results to the selected C runtime interface. File position, errno, output validity after failure, and other effects follow that interface. This wrapper adds no library diagnostics or ownership transfer. Each argument is evaluated once.
| [in] | fildes | Valid file descriptor. |
| [out] | stat_buff | Non-NULL pointer to the platform status structure. |
| #define _TIFF_lseek_f | ( | fildes, | |
| offset, | |||
| whence | |||
| ) | lseek(fildes, offset, whence) |
Seek a file descriptor through the platform large-file interface.
Forwards arguments and results to the selected C runtime interface. File position, errno, output validity after failure, and other effects follow that interface. This wrapper adds no library diagnostics or ownership transfer. Each argument is evaluated once.
| [in] | fildes | Valid file descriptor. |
| [in] | offset | Offset in bytes interpreted by whence. |
| [in] | whence | Standard seek origin. |
| #define _TIFF_off_t off_t |
| #define _TIFF_stat_s struct stat |
| #define FALSE 0 |
| #define isFillOrder | ( | tif, | |
| o | |||
| ) | (((tif)->tif_flags & (o)) != 0) |
Test whether selected bit-fill-order bits are present in a handle.
Uses a bitwise intersection rather than comparing the masked value for equality. Does not modify state or transfer ownership. Use side-effect-free macro arguments.
| [in] | tif | Non-NULL TIFF handle. |
| [in] | o | Fill-order bit value to test. |
| #define isMapped | ( | tif | ) | (((tif)->tif_flags & TIFF_MAPPED) != 0) |
Test whether TIFF_MAPPED is set on a handle.
See TIFF_MAPPED: during opening the flag may be set before a view exists. Reads handle flags without modifying state or transferring ownership. Use side-effect-free macro arguments.
| [in] | tif | Non-NULL TIFF handle. |
| #define isPseudoTag | ( | t | ) | (t > 0xffff) /* is tag value normal or pseudo */ |
Test whether a tag identifier is outside the on-disk 16-bit range.
The macro does not fully parenthesise its argument. Use a simple value or explicit parentheses around a compound expression. No diagnostics occur. Use side-effect-free macro arguments.
| [in] | t | Unsigned tag identifier; pass a simple value expression. |
| #define isTiled | ( | tif | ) | (((tif)->tif_flags & TIFF_ISTILED) != 0) |
| #define isUpSampled | ( | tif | ) | (((tif)->tif_flags & TIFF_UPSAMPLED) != 0) |
| #define ReadOK | ( | tif, | |
| buf, | |||
| size | |||
| ) | (TIFFReadFile((tif), (buf), (size)) == (tmsize_t)(size)) |
Test whether one client read transfers the entire requested byte count.
Partial transfers and errors both produce zero; partial output remains in buf according to the callback. No retry or extra diagnostic is performed. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL TIFF handle. |
| [out] | buf | Caller-owned destination with at least size writable bytes. |
| [in] | size | Requested nonnegative byte count representable by tmsize_t. |
| #define SeekOK | ( | tif, | |
| off | |||
| ) | _TIFFSeekOK(tif, off) |
Test whether an absolute seek reaches the requested file position.
Rejects offsets above UINT64_MAX / 2 without calling the client. Otherwise performs one SEEK_SET callback and tests that its result equals off. The helper emits no additional diagnostics and does not transfer ownership. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL TIFF handle. |
| [in] | off | Absolute byte offset from the start of the file. |
| #define streq | ( | a, | |
| b | |||
| ) | (strcmp(a, b) == 0) |
Compare two null-terminated strings for equality.
No ownership transfer or library diagnostics occur. Use side-effect-free macro arguments.
| [in] | a | First non-NULL string. |
| [in] | b | Second non-NULL string. |
| #define strneq | ( | a, | |
| b, | |||
| n | |||
| ) | (strncmp(a, b, n) == 0) |
Compare up to n bytes of two strings for equality.
Reads at most n bytes from either argument, stopping at a null byte. No ownership transfer or library diagnostics occur. Use side-effect-free macro arguments.
| [in] | a | First string or byte sequence readable through the comparison. |
| [in] | b | Second string or byte sequence readable through the comparison. |
| [in] | n | Maximum number of bytes to compare. |
| #define TIFF_BEENWRITING 0x00040U |
| #define TIFF_BIGTIFF 0x80000U |
| #define TIFF_BUF4WRITE 0x100000U |
| #define TIFF_BUFFERMMAP 0x800000U |
| #define TIFF_BUFFERSETUP 0x00010U |
| #define TIFF_CHOPPEDUPARRAYS 0x4000000U |
| #define TIFF_CODERSETUP 0x00020U |
| #define TIFF_DEFERSTRILELOAD 0x1000000U |
| #define TIFF_DIRTYDIRECT 0x00008U |
| #define TIFF_DIRTYHEADER 0x00004U |
| #define TIFF_DIRTYSTRIP 0x200000U |
| #define TIFF_DOUBLE_EQ | ( | x, | |
| y | |||
| ) | (!(fabs((x) - (y)) > 0.0)) |
Test whether a double difference is not greater than zero in magnitude.
This is not a general IEEE equality test: a NaN difference also yields nonzero. Normal floating-point exception behaviour applies; no library diagnostic or ownership transfer occurs. Use side-effect-free macro arguments.
| [in] | x | First floating-point value. |
| [in] | y | Second floating-point value. |
| #define TIFF_FILLORDER 0x00003U |
| #define TIFF_FLOAT_EQ | ( | x, | |
| y | |||
| ) | (!(fabsf((x) - (y)) > 0.0f)) |
Test whether a float difference is not greater than zero in magnitude.
This is not a general IEEE equality test: a NaN difference also yields nonzero. Normal floating-point exception behaviour applies; no library diagnostic or ownership transfer occurs. Use side-effect-free macro arguments.
| [in] | x | First floating-point value. |
| [in] | y | Second floating-point value. |
| #define TIFF_HEADERONLY 0x10000U |
| #define TIFF_INCUSTOMIFD 0x40000U |
| #define TIFF_INSUBIFD 0x02000U |
| #define TIFF_ISTILED 0x00400U |
| #define TIFF_LAZYSTRILELOAD_ASKED 0x8000000U |
| #define TIFF_LAZYSTRILELOAD_DONE 0x2000000U |
Record a switch from on-demand to full strip/tile-array loading.
Set by _TIFFFillStriles() when it discards the entries loaded on demand for an 'O'-mode directory so that the full arrays are loaded; cleared by TIFFReadDirectory().
| #define TIFF_MAPPED 0x00800U |
Request or record memory-mapped file access.
Set during opening for read-only modes (unless 'm' is given) before mapping is attempted, and cleared if mapping fails, so it can be set while tif_base is still NULL. After a successful open it is set only while tif_base and tif_size describe a view. TIFFInitJBIG() clears it without unmapping.
| #define TIFF_MYBUFFER 0x00200U |
| #define TIFF_NOBITREV 0x00100U |
| #define TIFF_NON_EXISTENT_DIR_NUMBER UINT_MAX |
| #define TIFF_NOREADRAW 0x20000U |
| #define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW |
| #define TIFF_PERSAMPLE 0x400000U |
| #define TIFF_POSTENCODE 0x01000U |
| #define TIFF_STRIPCHOP 0x08000U |
| #define TIFF_SWAB 0x00080U |
| #define TIFF_UPSAMPLED 0x04000U |
| #define TIFFArrayCount | ( | a | ) | (sizeof(a) / sizeof((a)[0])) |
Compute the element count of an actual array.
Does not validate that the argument is an array. Normal sizeof rules apply, including runtime evaluation for variably modified types. No allocation occurs. Use side-effect-free macro arguments.
| [in] | a | Array object, not a pointer to its first element. |
| #define TIFFCloseFile | ( | tif | ) | ((*(tif)->tif_closeproc)((tif)->tif_clientdata)) |
Invoke the handle's client close callback.
May release the underlying client I/O resource. This does not free the TIFF handle and adds no diagnostics or error handling. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL handle with an installed close callback. |
| #define TIFFGetFileSize | ( | tif | ) | ((*(tif)->tif_sizeproc)((tif)->tif_clientdata)) |
Invoke the handle's client size callback.
Client-state and file-position effects follow the callback implementation. The wrapper adds no diagnostics or ownership transfer. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL handle with an installed size callback. |
| #define TIFFhowmany8_32 | ( | x | ) | (((x) & 0x07) ? ((uint32_t)(x) >> 3) + 1 : (uint32_t)(x) >> 3) |
Compute the byte count needed to hold a 32-bit bit count.
No allocation, library-state changes, or error reporting occurs. Use side-effect-free macro arguments.
| [in] | x | Nonnegative bit count representable by uint32_t. |
| #define TIFFhowmany8_64 | ( | x | ) | (((x) & 0x07) ? ((uint64_t)(x) >> 3) + 1 : (uint64_t)(x) >> 3) |
Compute the byte count needed to hold a 64-bit bit count.
No allocation, library-state changes, or error reporting occurs. Use side-effect-free macro arguments.
| [in] | x | Nonnegative bit count representable by uint64_t. |
| #define TIFFhowmany_32 | ( | x, | |
| y | |||
| ) |
Compute a guarded 32-bit ceiling quotient.
Uses the strict guard x < UINT32_MAX - (y - 1), so the equality boundary also returns zero. A zero result is not a unique error sentinel. The guard does not parenthesise x and subtracts one from y before conversion to uint32_t, so pass simple uint32_t-typed expressions. No diagnostic or ownership transfer occurs. Use side-effect-free macro arguments.
| [in] | x | Nonnegative value representable by uint32_t. |
| [in] | y | Positive divisor representable by uint32_t. |
| #define TIFFhowmany_32_maxuint_compat | ( | x, | |
| y | |||
| ) |
Compute a 32-bit ceiling quotient without adding x and y first.
Handles x near UINT32_MAX, but multiplying the result by y can still overflow. No diagnostic or ownership transfer occurs. Use side-effect-free macro arguments.
| [in] | x | Nonnegative value representable by uint32_t. |
| [in] | y | Positive divisor representable by uint32_t. |
| #define TIFFhowmany_64 | ( | x, | |
| y | |||
| ) | ((((uint64_t)(x)) + (((uint64_t)(y)) - 1)) / ((uint64_t)(y))) |
Compute a 64-bit ceiling quotient using an unchecked addition.
The caller must ensure x + y - 1 fits uint64_t. Overflow wraps without diagnostics. No allocation or ownership transfer occurs. Use side-effect-free macro arguments.
| [in] | x | Nonnegative value representable by uint64_t. |
| [in] | y | Positive divisor representable by uint64_t. |
| #define TIFFMapFileContents | ( | tif, | |
| paddr, | |||
| psize | |||
| ) | ((*(tif)->tif_mapproc)((tif)->tif_clientdata, (paddr), (psize))) |
Invoke the handle's client mapping callback.
On success the returned view has the lifetime and release contract of the client mapping callback. On failure output validity is defined by that callback. The wrapper performs no independent allocation or error handling. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL handle with an installed mapping callback. |
| [out] | paddr | Non-NULL output pointer for the mapped-file base. |
| [out] | psize | Non-NULL output pointer for the mapped length in bytes. |
| #define TIFFmax | ( | A, | |
| B | |||
| ) | ((A) > (B) ? (A) : (B)) |
Select the first operand if it is greater, otherwise the second.
The selected operand is evaluated again after comparison. No library diagnostic or ownership transfer occurs. Use side-effect-free macro arguments.
| [in] | A | First comparable value. |
| [in] | B | Second comparable value. |
| #define TIFFmin | ( | A, | |
| B | |||
| ) | ((A) < (B) ? (A) : (B)) |
Select the first operand if it is smaller, otherwise the second.
The selected operand is evaluated again after comparison. No library diagnostic or ownership transfer occurs. Use side-effect-free macro arguments.
| [in] | A | First comparable value. |
| [in] | B | Second comparable value. |
| #define TIFFReadFile | ( | tif, | |
| buf, | |||
| size | |||
| ) | ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size))) |
Invoke the handle's client read callback.
The callback may advance file position and modify client state. This wrapper adds no diagnostics, retry, or ownership transfer. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL handle with an installed read callback. |
| [out] | buf | Caller-owned destination with at least size writable bytes. |
| [in] | size | Requested nonnegative byte count. |
| #define TIFFroundup_32 | ( | x, | |
| y | |||
| ) | ((uint32_t)(TIFFhowmany_32(x, y) * (uint32_t)(y))) |
Round a 32-bit value up to a multiple using the guarded quotient.
Inherits the conservative guard and ambiguous zero result of TIFFhowmany_32(). No allocation or diagnostic occurs. Use side-effect-free macro arguments.
| [in] | x | Nonnegative value representable by uint32_t. |
| [in] | y | Positive alignment representable by uint32_t. |
| #define TIFFroundup_64 | ( | x, | |
| y | |||
| ) | ((uint64_t)(TIFFhowmany_64(x, y) * (uint64_t)(y))) |
Round a 64-bit value up to a multiple without overflow checks.
The caller must ensure x + y - 1 and the final product fit uint64_t. Overflow wraps without diagnostics. No allocation occurs. Use side-effect-free macro arguments.
| [in] | x | Nonnegative value representable by uint64_t. |
| [in] | y | Positive alignment representable by uint64_t. |
| #define TIFFSafeModMul32 | ( | tif, | |
| module, | |||
| index, | |||
| count, | |||
| dimension, | |||
| result | |||
| ) |
Compute (index modulo count) times dimension with a checked product.
If dimension is zero or index % count is zero, sets result to zero and returns zero without calling _TIFFMultiply32(); count must be nonzero unless dimension is zero. index and count may be evaluated twice. On overflow _TIFFMultiply32() emits an error and result becomes zero. Does not allocate or transfer storage ownership. Use side-effect-free macro arguments.
| [in,out] | tif | Handle used by _TIFFMultiply32() for error reporting. |
| [in] | module | Non-NULL diagnostic module name. |
| [in] | index | Unsigned 32-bit index. |
| [in] | count | Positive unsigned divisor unless dimension is zero. |
| [in] | dimension | Unsigned 32-bit multiplier. |
| [out] | result | Assignable uint32_t lvalue receiving the product or zero. |
| #define TIFFSafeMultiply | ( | t, | |
| v, | |||
| m | |||
| ) |
Multiply in a caller-selected unsigned type with a reverse-division check.
Use an unsigned type of at least unsigned-int rank. Signed types and narrow unsigned types subject to signed integer promotion are not covered by this check. Zero can be a valid product and is not a unique error sentinel. The macro emits no diagnostic and transfers no ownership. Use side-effect-free macro arguments.
| [in] | t | Unsigned integer type whose multiplication is performed unsigned. |
| [in] | v | First operand, representable in t. |
| [in] | m | Second operand, representable in t. |
| #define TIFFSeekFile | ( | tif, | |
| off, | |||
| whence | |||
| ) | ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence))) |
Invoke the handle's client seek callback.
May change file position and client state. The wrapper adds no error handling or ownership transfer. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL handle with an installed seek callback. |
| [in] | off | Byte offset interpreted according to whence. |
| [in] | whence | SEEK_SET, SEEK_CUR, or SEEK_END as supported by the callback. |
| #define TIFFUnmapFileContents | ( | tif, | |
| addr, | |||
| size | |||
| ) | ((*(tif)->tif_unmapproc)((tif)->tif_clientdata, (addr), (size))) |
Invoke the handle's client unmapping callback.
Invalidates the mapped view according to the callback contract. Adds no independent diagnostics or error handling. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL handle with an installed unmapping callback. |
| [in] | addr | Mapped-file base, or NULL during early failed-open cleanup. |
| [in] | size | Mapped length in bytes, or zero during no-view cleanup. |
| #define TIFFWriteFile | ( | tif, | |
| buf, | |||
| size | |||
| ) | ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size))) |
Invoke the handle's client write callback.
The callback may write data, advance file position, and modify client state. This wrapper adds no diagnostics, retry, or ownership transfer. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL handle with an installed write callback. |
| [in] | buf | Caller-owned source containing at least size readable bytes. |
| [in] | size | Requested nonnegative byte count. |
| #define WriteOK | ( | tif, | |
| buf, | |||
| size | |||
| ) | (TIFFWriteFile((tif), (buf), (size)) == (tmsize_t)(size)) |
Test whether one client write transfers the entire requested byte count.
Partial transfers and errors both produce zero; partial writes are not rolled back. No retry or extra diagnostic is performed. Use side-effect-free macro arguments.
| [in,out] | tif | Non-NULL TIFF handle. |
| [in] | buf | Caller-owned source with at least size readable bytes. |
| [in] | size | Requested nonnegative byte count representable by tmsize_t. |
| typedef tidataval_t* tidata_t |
Name a legacy pointer to internal image bytes.
| typedef unsigned char tidataval_t |
Name a legacy internal image byte.
| typedef struct client_info TIFFClientInfoLink |
Link a named client-data association to a TIFF handle.
TIFFSetClientInfo() allocates the node and copies its name, but retains the payload pointer without taking ownership. TIFFCleanup() frees the name and node; the client remains responsible for payload lifetime and release.
| typedef size_t TIFFIOSize_t |
| typedef struct TIFFOffsetAndDirNumber TIFFOffsetAndDirNumber |
Name the TIFFOffsetAndDirNumber record type.