Debian Codegraph @

texk/xdvipsk/thirdparty/libtiff/doc/functions/TIFFStrileQuery.rst

raw
1 TIFFStrileQuery
2 ===============
3
4 Synopsis
5 --------
6
7 .. highlight:: c
8
9 ::
10
11 #include <tiffio.h>
12
13 .. c:function:: uint64_t TIFFGetStrileByteCount(TIFF* tif, uint32_t strile);
14
15 .. c:function:: uint64_t TIFFGetStrileOffset(TIFF* tif, uint32_t strile);
16
17 .. c:function:: uint64_t TIFFGetStrileByteCountWithErr(TIFF* tif, uint32_t strile, int *pbErr);
18
19 .. c:function:: uint64_t TIFFGetStrileOffsetWithErr(TIFF* tif, uint32_t strile, int *pbErr);
20
21 Description
22 -----------
23
24 Make defer strile offset/bytecount loading available at runtime
25 and add per-strile offset/bytecount loading capabilities. Part of
26 this commit makes the behaviour that was previously met when ``libtiff``
27 was compiled with ``-DDEFER_STRILE_LOAD`` available for default builds.
28
29 When specifying the new ``D`` (Deferred) :c:func:`TIFFOpen` flag,
30 the loading of strile offset/bytecount is defered.
31 In that mode, the ``StripOffsets`` / ``StripByteCounts`` or
32 ``TileOffsets`` / ``TileByteCounts`` arrays are only loaded when first
33 accessed. This can speed-up the opening of files stored on the network
34 when just metadata retrieval is needed.
35
36 Another addition is the capability of loading only the values of
37 the offset/bytecount of the strile of interest instead of the
38 whole array. This is enabled with the new ``O`` (Ondemand) flag of
39 :c:func:`TIFFOpen` (which implies ``D``).
40
41 The public :c:func:`TIFFGetStrileOffset`, :c:func:`TIFFGetStrileOffsetWithErr`,
42 :c:func:`TIFFGetStrileByteCount` and :c:func:`TIFFGetStrileByteCountWithErr`
43 functions have been added to API.
44 They are of particular interest when using sparse files (with
45 ``offset == bytecount == 0``) and you want to detect if a strile is
46 present or not without decompressing the data, or updating an
47 existing sparse file.
48
49 :c:func:`TIFFGetStrileByteCount` returns the value of the TileByteCounts /
50 StripByteCounts array for the specified tile/strile.
51
52 :c:func:`TIFFGetStrileByteCountWithErr` additionally provides *pbErr*
53 as an *int* pointer to an error return variable,
54 which is set to "0" for successful return or to "1" for an error return.
55
56 :c:func:`TIFFGetStrileOffset` returns the value of the TileOffsets /
57 StripOffsets array for the specified tile/strile.
58
59 :c:func:`TIFFGetStrileOffsetWithErr` additionally provides *pbErr*
60 as an *int* pointer to an error return variable,
61 which is set to "0" for successful return or to "1" for an error return.
62
63 Diagnostics
64 -----------
65
66 All error messages are directed to the :c:func:`TIFFErrorExtR` routine.
67 Likewise, warning messages are directed to the :c:func:`TIFFWarningExtR` routine.
68
69 Note
70 ----
71
72 This functionality was introduced with libtiff 4.1.
73
74 See also
75 --------
76
77 :doc:`libtiff` (3tiff),
78 :doc:`TIFFOpen` (3tiff),
79 :doc:`TIFFDeferStrileArrayWriting` (3tiff)
80