|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Calculate image-data extents, select default geometry, and inspect progress. More...
Functions | |
| uint64_t | TIFFScanlineSize64 (TIFF *tif) |
| Compute the current scanline I/O byte estimate. | |
| tmsize_t | TIFFScanlineSize (TIFF *tif) |
| Compute the current scanline I/O byte estimate. | |
| uint64_t | TIFFRasterScanlineSize64 (TIFF *tif) |
| Compute the packed full-raster row byte count. | |
| tmsize_t | TIFFRasterScanlineSize (TIFF *tif) |
| Compute the packed full-raster row byte count. | |
| uint64_t | TIFFStripSize64 (TIFF *tif) |
| Compute the decoded-size estimate for a nominal strip. | |
| tmsize_t | TIFFStripSize (TIFF *tif) |
| Compute the decoded-size estimate for a nominal strip. | |
| uint64_t | TIFFRawStripSize64 (TIFF *tif, uint32_t strip) |
| Query the stored byte count for one raw strip. | |
| tmsize_t | TIFFRawStripSize (TIFF *tif, uint32_t strip) |
| Convert one raw-strip byte count to the legacy signed-size result. | |
| uint64_t | TIFFVStripSize64 (TIFF *tif, uint32_t nrows) |
| Compute the decoded-size estimate for a requested strip height. | |
| tmsize_t | TIFFVStripSize (TIFF *tif, uint32_t nrows) |
| Compute the decoded-size estimate for a requested strip height. | |
| uint64_t | TIFFTileRowSize64 (TIFF *tif) |
| Compute the packed byte count of one tile row. | |
| tmsize_t | TIFFTileRowSize (TIFF *tif) |
| Compute the packed byte count of one tile row. | |
| uint64_t | TIFFTileSize64 (TIFF *tif) |
| Compute the decoded-size estimate for the configured tile height. | |
| tmsize_t | TIFFTileSize (TIFF *tif) |
| Compute the decoded-size estimate for the configured tile height. | |
| uint64_t | TIFFVTileSize64 (TIFF *tif, uint32_t nrows) |
| Compute the decoded-size estimate for a requested tile height. | |
| tmsize_t | TIFFVTileSize (TIFF *tif, uint32_t nrows) |
| Compute the decoded-size estimate for a requested tile height. | |
| uint32_t | TIFFDefaultStripSize (TIFF *tif, uint32_t request) |
| Ask the installed sizing method for a RowsPerStrip recommendation. | |
| void | TIFFDefaultTileSize (TIFF *tif, uint32_t *tw, uint32_t *th) |
| Ask the installed sizing method to adjust tile width and height. | |
| uint32_t | TIFFCurrentRow (TIFF *tif) |
| Read the cached current scanline index. | |
| uint32_t | TIFFCurrentStrip (TIFF *tif) |
| Read the cached current strip index. | |
| uint32_t | TIFFCurrentTile (TIFF *tif) |
| Read the cached current tile index. | |
| uint32_t | TIFFComputeTile (TIFF *tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s) |
| Compute a tile index from pixel and sample coordinates. | |
| int | TIFFCheckTile (TIFF *tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s) |
| Check pixel and separate-sample coordinates against image bounds. | |
| uint32_t | TIFFNumberOfTiles (TIFF *tif) |
| Compute the tile count across image depth and sample planes. | |
| uint32_t | TIFFComputeStrip (TIFF *tif, uint32_t row, uint16_t sample) |
| Compute a strip index from a row and optional sample plane. | |
| uint32_t | TIFFNumberOfStrips (TIFF *tif) |
| Compute the strip count from current image geometry. | |
Calculate image-data extents, select default geometry, and inspect progress.
See Image layout and sizing for rounding, limits, and the current coverage boundary.
|
extern |
Check pixel and separate-sample coordinates against image bounds.
Checks x<ImageWidth, y<ImageLength, z<ImageDepth, and s<SamplesPerPixel only for separate planes. Unlike TIFFComputeTile(), it does not discard z when ImageDepth is one. On first invalid coordinate dispatches an error and returns zero. Does not validate TileWidth/Length/Depth, organisation, count arithmetic, array capacity, or codec support. Does not allocate, perform I/O, or transfer ownership.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
| [in] | x | Pixel column to check against ImageWidth. |
| [in] | y | Pixel row to check against ImageLength. |
| [in] | z | Depth slice to check against ImageDepth; not ignored when ImageDepth is one. |
| [in] | s | Sample plane checked against SamplesPerPixel only for separate planar configuration. |
Definition at line 118 of file tif_tile.c.
References PLANARCONFIG_SEPARATE, TIFFDirectory::td_imagedepth, TIFFDirectory::td_imagelength, TIFFDirectory::td_imagewidth, TIFFDirectory::td_planarconfig, TIFFDirectory::td_samplesperpixel, tiff::tif_dir, tiff::tif_name, and TIFFErrorExtR().
Referenced by _TIFFReadTileAndAllocBuffer(), TIFFReadTile(), and TIFFWriteTile().
|
extern |
Compute a strip index from a row and optional sample plane.
Uses row/RowsPerStrip and, for separate planes, the cached td_stripsperimage times sample. Requires nonzero RowsPerStrip and a consistent cached strips-per-plane count. Does not validate or clamp row to ImageLength, or verify strip arrays/organisation. sample is checked only for separate planes and ignored otherwise. Invalid separate sample, zero RowsPerStrip, or checked arithmetic/narrowing failures report diagnostics and return zero; a valid first strip is also zero. No allocation, I/O, or ownership effects.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
| [in] | row | Row coordinate; caller must ensure it is inside the image. |
| [in] | sample | Sample plane for separate storage; ignored for contiguous storage. |
Definition at line 41 of file tif_strip.c.
References _TIFFAdd64(), _TIFFCastUInt64ToUInt32(), _TIFFMultiply64(), PLANARCONFIG_SEPARATE, tiff::tif_dir, and TIFFErrorExtR().
Referenced by gtStripContig(), and gtStripSeparate().
|
extern |
Compute a tile index from pixel and sample coordinates.
Substitutes corresponding image extents for UINT32_MAX tile dimensions, then computes x-major, y, z, and separate-plane offsets with checked products/additions. Does not validate or clamp x/y/z to the image; forces z to zero when ImageDepth is one. Checks s only for separate storage. Zero effective tile dimensions return the initial value one silently; arithmetic/sample rejection returns zero, which is also the first valid tile. Conservative ceiling guards can reject large extents. Does not allocate, perform I/O, acquire ownership, or validate tile arrays. Use TIFFCheckTile() for coordinate bounds and establish valid tile geometry separately.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
| [in] | x | Pixel column; not checked against ImageWidth. |
| [in] | y | Pixel row; not checked against ImageLength. |
| [in] | z | Depth slice; forced to zero when ImageDepth is one. |
| [in] | s | Separate sample plane; ignored for contiguous storage. |
Definition at line 40 of file tif_tile.c.
References _TIFFComputeTileExt().
|
extern |
Read the cached current scanline index.
Direct state read with no allocation, I/O, diagnostics, mutation, or ownership transfer. The value reflects traversal/codec progress, which can change even on failure, and does not prove successful pixel access or predict every next operation. Directory reset installs UINT32_MAX as the no-current sentinel. See Image layout and sizing for scope.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Scanline read/write paths can record row + 1 after processing, including some decoder failures; the result can equal ImageLength after the last row.
Definition at line 901 of file tif_open.c.
References TIFFDirectory::td_row, and tiff::tif_dir.
|
extern |
Read the cached current strip index.
Direct state read with no allocation, I/O, diagnostics, mutation, or ownership transfer. The value reflects traversal/codec progress, which can change even on failure, and does not prove successful pixel access or predict every next operation. Directory reset installs UINT32_MAX as the no-current sentinel. See Image layout and sizing for scope.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 911 of file tif_open.c.
References TIFFDirectory::td_curstrip, and tiff::tif_dir.
|
extern |
Read the cached current tile index.
Direct state read with no allocation, I/O, diagnostics, mutation, or ownership transfer. The value reflects traversal/codec progress, which can change even on failure, and does not prove successful pixel access or predict every next operation. Directory reset installs UINT32_MAX as the no-current sentinel. See Image layout and sizing for scope.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 916 of file tif_open.c.
References TIFFDirectory::td_curtile, and tiff::tif_dir.
|
extern |
Ask the installed sizing method for a RowsPerStrip recommendation.
Invokes the current tif_defstripsize callback synchronously; it may apply codec-specific constraints or have additional allocation/state/diagnostic effects. Does not itself set RowsPerStrip, allocate a result, validate the callback recommendation, or report a separate status. Default heuristic semantics, including signed interpretation of high-bit requests, are documented in _TIFFDefaultStripSize(). Callback code/context must remain live during the call.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
| [in] | request | Suggested rows per strip, zero for a heuristic request; codec methods may adjust it. |
Definition at line 258 of file tif_strip.c.
References tiff::tif_defstripsize.
|
extern |
Ask the installed sizing method to adjust tile width and height.
Invokes tif_deftilesize synchronously on caller-owned width/height slots. Does not set TileWidth/TileLength tags, allocate returned storage, or validate recommendations. The normal default supplies 256 for nonpositive signed requests and rounds to multiples of 16; codec overrides can impose additional rules and effects. Callback code/context must remain live during the call. This void interface has no independent error status.
| [in] | tif | Non-NULL live handle with consistent current geometry; the built-in methods only read it. Serialise access externally. |
| [in,out] | tw | Non-NULL writable width request/result in pixels. |
| [in,out] | th | Non-NULL writable height request/result in rows. |
Definition at line 321 of file tif_tile.c.
References tiff::tif_deftilesize.
|
extern |
Compute the strip count from current image geometry.
Uses ceil(ImageLength/RowsPerStrip), multiplying by SamplesPerPixel for separate planes. RowsPerStrip UINT32_MAX produces one strip per plane even for zero ImageLength. RowsPerStrip zero warns and returns zero. The conservative 32-bit ceiling guard can return zero near UINT32_MAX without a direct diagnostic; multiplication overflow is diagnosed. Does not include ImageDepth, check strip-versus-tile organisation, allocate arrays, or return their cached capacity. No I/O or ownership effects.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 82 of file tif_strip.c.
References _TIFFMultiply32(), PLANARCONFIG_SEPARATE, TIFFDirectory::td_imagelength, TIFFDirectory::td_planarconfig, TIFFDirectory::td_rowsperstrip, TIFFDirectory::td_samplesperpixel, tiff::tif_dir, TIFFhowmany_32, and TIFFWarningExtR().
Referenced by JBIGEncode(), JBIGSetupDecode(), JBIGSetupEncode(), TIFFReadDirectory(), and TIFFSetupStrips().
|
extern |
Compute the tile count across image depth and sample planes.
Substitutes image extents for UINT32_MAX tile dimensions, takes ceiling counts in x/y/z, then multiplies, including SamplesPerPixel for separate planes. Zero effective tile dimensions return zero. Products use checked 32-bit arithmetic with diagnostics; conservative ceiling guards can return zero silently near UINT32_MAX. No organisation/array-capacity validation, allocation, I/O, or ownership transfer occurs.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 155 of file tif_tile.c.
References _TIFFMultiply32(), PLANARCONFIG_SEPARATE, TIFFDirectory::td_imagedepth, TIFFDirectory::td_imagelength, TIFFDirectory::td_imagewidth, TIFFDirectory::td_planarconfig, TIFFDirectory::td_samplesperpixel, TIFFDirectory::td_tiledepth, TIFFDirectory::td_tilelength, TIFFDirectory::td_tilewidth, tiff::tif_dir, and TIFFhowmany_32.
Referenced by TIFFReadDirectory(), and TIFFSetupStrips().
Compute the packed full-raster row byte count.
Delegates to TIFFRasterScanlineSize64() and rejects results above TIFF_TMSIZE_T_MAX through _TIFFCastUInt64ToSSize(), returning zero with a diagnostic. Includes all SamplesPerPixel channels. Contiguous storage rounds the complete row once; separate storage rounds each plane first, then multiplies by the sample count. Does not model packed YCbCr sampling groups, codec upsampling, or a tile row. Zero products can return zero silently. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 415 of file tif_strip.c.
References _TIFFCastUInt64ToSSize(), and TIFFRasterScanlineSize64().
|
extern |
Compute the packed full-raster row byte count.
Includes all SamplesPerPixel channels. Contiguous storage rounds the complete row once; separate storage rounds each plane first, then multiplies by the sample count. Does not model packed YCbCr sampling groups, codec upsampling, or a tile row. Zero products can return zero silently. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 397 of file tif_strip.c.
References _TIFFMultiply64(), PLANARCONFIG_CONTIG, tiff::tif_dir, and TIFFhowmany8_64.
Referenced by TIFFRasterScanlineSize().
Convert one raw-strip byte count to the legacy signed-size result.
Queries TIFFGetStrileByteCount() rather than computing decoded geometry. May load/grow deferred metadata caches, allocate and change client I/O position, invalidating old borrowed array views. Does not decode pixels or validate that the range exists in the file. A zero metadata count, including out-of-range/load failures returning zero, is diagnosed and mapped to the raw-size sentinel. Other getter errors are not tracked with a separate WithErr output. No ownership transfers. Maps the uint64_t sentinel to minus one; otherwise uses a cast/unsigned round-trip comparison, not the ordinary checked signed-size helper. A failed round trip reports integer overflow and returns zero. Very large values that round-trip as negative can escape this check, including on 64-bit signed-size hosts; do not treat every nonzero result as a valid allocation length. See Image layout and sizing.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
| [in] | strip | Zero-based strip/strile metadata index. |
Definition at line 208 of file tif_strip.c.
References TIFFErrorExtR(), and TIFFRawStripSize64().
|
extern |
Query the stored byte count for one raw strip.
Queries TIFFGetStrileByteCount() rather than computing decoded geometry. May load/grow deferred metadata caches, allocate and change client I/O position, invalidating old borrowed array views. Does not decode pixels or validate that the range exists in the file. A zero metadata count, including out-of-range/load failures returning zero, is diagnosed and mapped to the raw-size sentinel. Other getter errors are not tracked with a separate WithErr output. No ownership transfers.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
| [in] | strip | Zero-based strip/strile index in the current metadata arrays; intended for strip-organised data. |
Definition at line 193 of file tif_strip.c.
References TIFFErrorExtR(), and TIFFGetStrileByteCount().
Referenced by TIFFRawStripSize().
Compute the current scanline I/O byte estimate.
Delegates to TIFFScanlineSize64() and rejects results above TIFF_TMSIZE_T_MAX through _TIFFCastUInt64ToSSize(), returning zero with a diagnostic. Contiguous data normally rounds width*SamplesPerPixel*BitsPerSample once to bytes; separate planes use one sample plane. Packed contiguous three-sample YCbCr without upsampling instead computes a padded sampling-row byte count and integer-divides by vertical subsampling; this can truncate and must not be used to reconstruct a complete sampling group. Rejects zero computed size and invalid packed subsampling values with diagnostics, but does not uniformly validate every malformed photometric/sample combination. Current ordinary field widths bound the row bit product below the generic byte-rounding addition limit. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
Definition at line 383 of file tif_strip.c.
References _TIFFCastUInt64ToSSize(), and TIFFScanlineSize64().
Referenced by gtStripContig(), gtStripSeparate(), JPEGComputeStrileWidthHeightBytesPerLine(), JPEGResetUpsampled(), LogLuvDecodeStrip(), LogLuvEncodeStrip(), LogLuvVSetField(), PackBitsPreEncode(), PixarLogVSetField(), PredictorSetup(), TIFFReadDirectory(), and TIFFWriteCheck().
|
extern |
Compute the current scanline I/O byte estimate.
Contiguous data normally rounds width*SamplesPerPixel*BitsPerSample once to bytes; separate planes use one sample plane. Packed contiguous three-sample YCbCr without upsampling instead computes a padded sampling-row byte count and integer-divides by vertical subsampling; this can truncate and must not be used to reconstruct a complete sampling group. Rejects zero computed size and invalid packed subsampling values with diagnostics, but does not uniformly validate every malformed photometric/sample combination. Current ordinary field widths bound the row bit product below the generic byte-rounding addition limit. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
Definition at line 297 of file tif_strip.c.
References _TIFFMultiply64(), isUpSampled, PHOTOMETRIC_YCBCR, PLANARCONFIG_CONTIG, tiff::tif_dir, TIFFErrorExtR(), TIFFGetFieldDefaulted(), TIFFhowmany_32, TIFFhowmany_64, TIFFroundup_32, and TIFFTAG_YCBCRSUBSAMPLING.
Referenced by _TIFFDefaultStripSize(), _TIFFStrileSize64(), ByteCountLooksBad(), EstimateStripByteCounts(), and TIFFScanlineSize().
Compute the decoded-size estimate for a nominal strip.
Delegates to TIFFStripSize64() and rejects results above TIFF_TMSIZE_T_MAX through _TIFFCastUInt64ToSSize(), returning zero with a diagnostic. Uses min(RowsPerStrip, ImageLength), then TIFFVStripSize64(). Last individual strips may be shorter; this is not an encoded byte-count query. Packed YCbCr rowblock and diagnostic rules follow _TIFFStrileSize64(). Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
Definition at line 244 of file tif_strip.c.
References _TIFFCastUInt64ToSSize(), and TIFFStripSize64().
Referenced by gtStripContig(), gtStripSeparate(), TIFFFillStrip(), TIFFReadDirectory(), and TIFFWriteBufferSetup().
|
extern |
Compute the decoded-size estimate for a nominal strip.
Uses min(RowsPerStrip, ImageLength), then TIFFVStripSize64(). Last individual strips may be shorter; this is not an encoded byte-count query. Packed YCbCr rowblock and diagnostic rules follow _TIFFStrileSize64(). Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
Definition at line 236 of file tif_strip.c.
References TIFFDirectory::td_imagelength, TIFFDirectory::td_rowsperstrip, tiff::tif_dir, and TIFFVStripSize64().
Referenced by _TIFFRewriteField(), TIFFReadDirectory(), TIFFStripSize(), TIFFWriteDirectoryTagLongLong8Array(), and TryChopUpUncompressedBigTiff().
Compute the packed byte count of one tile row.
Delegates to TIFFTileRowSize64() and rejects results above TIFF_TMSIZE_T_MAX through _TIFFCastUInt64ToSSize(), returning zero with a diagnostic. Uses TileWidth*BitsPerSample and, for contiguous storage, SamplesPerPixel; rounds once to bytes. Packed contiguous three-sample YCbCr without upsampling follows the TIFFTileRowSize64() sampling-block rule, so the result times TileLength equals TIFFTileSize() but is not the size of one visual row. Requires nonzero TileWidth/TileLength and nonzero contiguous sample count, diagnosing invalid/zero results. Does not multiply by TileDepth. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 276 of file tif_tile.c.
References _TIFFCastUInt64ToSSize(), and TIFFTileRowSize64().
Referenced by gtTileContig(), gtTileSeparate(), JPEGComputeStrileWidthHeightBytesPerLine(), LogLuvDecodeTile(), LogLuvEncodeTile(), and PackBitsPreEncode().
|
extern |
Compute the packed byte count of one tile row.
Uses TileWidth*BitsPerSample and, for contiguous storage, SamplesPerPixel; rounds once to bytes. Packed contiguous three-sample YCbCr without upsampling instead computes the byte count of one row of sampling blocks and divides by vertical subsampling, as TIFFScanlineSize64() does, so that TIFFTileSize64() equals this value times TileLength; the result is then not the size of one visual row and is only meaningful multiplied by a multiple of the vertical subsampling. Invalid packed subsampling values are rejected with a diagnostic. Requires nonzero TileWidth/TileLength and nonzero contiguous sample count, diagnosing invalid/zero results. Does not multiply by TileDepth. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in] | tif | Non-NULL live handle with consistent current geometry; no ownership transfer. |
Definition at line 187 of file tif_tile.c.
References _TIFFMultiply64(), isUpSampled, PHOTOMETRIC_YCBCR, PLANARCONFIG_CONTIG, tiff::tif_dir, TIFFErrorExtR(), TIFFGetFieldDefaulted(), TIFFhowmany8_64, TIFFhowmany_32, and TIFFTAG_YCBCRSUBSAMPLING.
Referenced by _TIFFStrileSize64(), and TIFFTileRowSize().
Compute the decoded-size estimate for the configured tile height.
Delegates to TIFFTileSize64() and rejects results above TIFF_TMSIZE_T_MAX through _TIFFCastUInt64ToSSize(), returning zero with a diagnostic. Calls TIFFVTileSize64() with TileLength, so its YCbCr rules apply, including rejection of contiguous non-upsampled YCbCr with SamplesPerPixel other than three. Requires nonzero tile width/length/depth. TileDepth is checked but not multiplied into the result; this implementation computes row-count times row storage or YCbCr sampling groups. Do not infer a multi-depth volume allocation from this result alone. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
Definition at line 307 of file tif_tile.c.
References _TIFFCastUInt64ToSSize(), and TIFFTileSize64().
Referenced by gtTileContig(), gtTileSeparate(), JPEGResetUpsampled(), LogLuvVSetField(), PixarLogVSetField(), TIFFFillTile(), TIFFReadDirectory(), and TIFFWriteCheck().
|
extern |
Compute the decoded-size estimate for the configured tile height.
Calls TIFFVTileSize64() with TileLength, so its YCbCr rules apply, including rejection of contiguous non-upsampled YCbCr with SamplesPerPixel other than three. Requires nonzero tile width/length/depth. TileDepth is checked but not multiplied into the result; this implementation computes row-count times row storage or YCbCr sampling groups. Do not infer a multi-depth volume allocation from this result alone. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
Definition at line 303 of file tif_tile.c.
References TIFFDirectory::td_tilelength, tiff::tif_dir, and TIFFVTileSize64().
Referenced by _TIFFRewriteField(), EstimateStripByteCounts(), TIFFTileSize(), TIFFWriteDirectoryTagLongLong8Array(), ZIPDecode(), and ZIPEncode().
Compute the decoded-size estimate for a requested strip height.
Delegates to TIFFVStripSize64() and rejects results above TIFF_TMSIZE_T_MAX through _TIFFCastUInt64ToSSize(), returning zero with a diagnostic. Uses the requested row count, with UINT32_MAX meaning current ImageLength. Does not clamp other row counts to ImageLength. Contiguous non-upsampled YCbCr counts complete sampling blocks and rounds the complete horizontal sampling row once; with SamplesPerPixel other than three it is rejected with a diagnostic and zero (unlike TIFFScanlineSize64(), which treats it as ordinary data). Ordinary data multiplies the scanline estimate by row count. Does not include an ImageDepth multiplier. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count overflow path is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
| [in] | nrows | Requested row count; UINT32_MAX selects ImageLength. |
Definition at line 182 of file tif_strip.c.
References _TIFFCastUInt64ToSSize(), and TIFFVStripSize64().
Referenced by gtStripContig(), and TIFFReadEncodedStripGetStripSize().
|
extern |
Compute the decoded-size estimate for a requested strip height.
Uses the requested row count, with UINT32_MAX meaning current ImageLength. Does not clamp other row counts to ImageLength. Contiguous non-upsampled YCbCr counts complete sampling blocks and rounds the complete horizontal sampling row once; with SamplesPerPixel other than three it is rejected with a diagnostic and zero (unlike TIFFScanlineSize64(), which treats it as ordinary data). Ordinary data multiplies the scanline estimate by row count. Does not include an ImageDepth multiplier. Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count overflow path is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
| [in] | nrows | Requested row count; UINT32_MAX selects ImageLength. |
Definition at line 177 of file tif_strip.c.
References _TIFFStrileSize64(), and TRUE.
Referenced by TIFFStripSize64(), TIFFVStripSize(), TryChopUpUncompressedBigTiff(), ZIPDecode(), and ZIPEncode().
Compute the decoded-size estimate for a requested tile height.
Delegates to TIFFVTileSize64() and rejects results above TIFF_TMSIZE_T_MAX through _TIFFCastUInt64ToSSize(), returning zero with a diagnostic. Requires nonzero TileWidth/TileLength/TileDepth and uses the requested nrows without clipping to TileLength. UINT32_MAX is an ordinary row count here, not the strip all-image sentinel. TileDepth is checked but not multiplied. Contiguous non-upsampled YCbCr uses complete sampling blocks and, with SamplesPerPixel other than three, is rejected with a diagnostic and zero; ordinary data uses TIFFTileRowSize64(). Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
| [in] | nrows | Requested row count, not clipped to TileLength; UINT32_MAX is an ordinary count here. |
Definition at line 292 of file tif_tile.c.
References _TIFFCastUInt64ToSSize(), and TIFFVTileSize64().
|
extern |
Compute the decoded-size estimate for a requested tile height.
Requires nonzero TileWidth/TileLength/TileDepth and uses the requested nrows without clipping to TileLength. UINT32_MAX is an ordinary row count here, not the strip all-image sentinel. TileDepth is checked but not multiplied. Contiguous non-upsampled YCbCr uses complete sampling blocks and, with SamplesPerPixel other than three, is rejected with a diagnostic and zero; ordinary data uses TIFFTileRowSize64(). Returns a scalar without acquiring input/output storage or allocating an output buffer. Does not read/decode pixels, validate actual buffer capacity, or persist tag values. Arithmetic/geometry failures may dispatch diagnostics; zero can mean an empty result or rejection. Not every rounding/count rejection is separately diagnosed; see Image layout and sizing. There is no general errno/status channel.
| [in,out] | tif | Non-NULL live handle with consistent current geometry; queries may use getters/callbacks. Serialise access externally. |
| [in] | nrows | Requested row count, not clipped to TileLength; UINT32_MAX is an ordinary count here. |
Definition at line 287 of file tif_tile.c.
References _TIFFStrileSize64(), and FALSE.
Referenced by ChopUpSingleUncompressedStrip(), TIFFTileSize64(), and TIFFVTileSize().