Debian Codegraph @

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

raw
1 TIFFReadEncodedTile
2 ===================
3
4 Synopsis
5 --------
6
7 .. highlight:: c
8
9 ::
10
11 #include <tiffio.h>
12
13 .. c:function:: int TIFFReadEncodedTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size)
14
15 Description
16 -----------
17
18 Read the specified tile of data and place up to *size* bytes of decompressed
19 information in the (user supplied) data buffer.
20
21 Notes
22 -----
23
24 The value of *tile* is a "raw tile number". That is, the caller must take
25 into account whether or not the data are organized in separate planes
26 (``PlanarConfiguration`` = 2).
27 :c:func:`TIFFComputeTile` automatically does this when converting an
28 (x,y,z,sample) coordinate quadruple to a tile number. To read a full tile
29 of data the data buffer should be at least as large as the value returned by
30 :c:func:`TIFFTileSize`.
31
32 The library attempts to hide bit- and byte-ordering differences between the
33 image and the native machine by converting data to the native machine order.
34 Bit reversal is done if the ``FillOrder`` tag is opposite to the native
35 machine bit order. 16- and 32-bit samples are automatically byte-swapped if
36 the file was written with a byte order opposite to the native machine byte
37 order.
38
39 Return values
40 -------------
41
42 The actual number of bytes of data that were placed in *buf* is returned;
43 :c:func:`TIFFReadEncodedTile` returns -1 if an error was encountered.
44
45 Diagnostics
46 -----------
47
48 All error messages are directed to the :c:func:`TIFFErrorExtR` routine.
49
50 See also
51 --------
52
53 :doc:`TIFFOpen` (3tiff),
54 :doc:`TIFFReadRawTile` (3tiff),
55 :doc:`TIFFReadTile` (3tiff),
56 :doc:`TIFFReadEncodedStrip` (3tiff),
57 :doc:`libtiff` (3tiff)