1TIFFReadScanline(3TIFF) TIFFReadScanline(3TIFF)
2
3
4
6 TIFFReadScanline - read and decode a scanline of data from an open TIFF
7 file
8
10 #include <tiffio.h>
11
12 int TIFFReadScanline(TIFF *tif, tdata_t buf, uint32 row, tsample_t sam‐
13 ple)
14
16 Read the data for the specified row into the (user supplied) data buf‐
17 fer buf. The data are returned decompressed and, in the native byte-
18 and bit-ordering, but are otherwise packed (see further below). The
19 buffer must be large enough to hold an entire scanline of data. Appli‐
20 cations should call the routine TIFFScanlineSize to find out the size
21 (in bytes) of a scanline buffer. The row parameter is always used by
22 TIFFReadScanline; the sample parameter is used only if data are orga‐
23 nized in separate planes (PlanarConfiguration=2).
24
26 The library attempts to hide bit- and byte-ordering differences between
27 the image and the native machine by converting data to the native
28 machine order. Bit reversal is done if the FillOrder tag is opposite
29 to the native machine bit order. 16- and 32-bit samples are automati‐
30 cally byte-swapped if the file was written with a byte order opposite
31 to the native machine byte order,
32
33 In C++ the sample parameter defaults to 0.
34
36 TIFFReadScanline returns -1 if it detects an error; otherwise 1 is
37 returned.
38
40 All error messages are directed to the TIFFError(3TIFF) routine.
41
42 Compression algorithm does not support random access. Data was
43 requested in a non-sequential order from a file that uses a compression
44 algorithm and that has RowsPerStrip greater than one. That is, data in
45 the image is stored in a compressed form, and with multiple rows packed
46 into a strip. In this case, the library does not support random access
47 to the data. The data should either be accessed sequentially, or the
48 file should be converted so that each strip is made up of one row of
49 data.
50
52 Reading subsampled YCbCR data does not work correctly because, for Pla‐
53 narConfiguration=2 the size of a scanline is not calculated on a per-
54 sample basis, and for PlanarConfiguration=1 the library does not unpack
55 the block-interleaved samples; use the strip- and tile-based interfaces
56 to read these formats.
57
59 TIFFOpen(3TIFF), TIFFReadEncodedStrip(3TIFF), TIFFReadRawStrip(3TIFF),
60 libtiff(3TIFF)
61
62 Libtiff library home page: http://www.remotesensing.org/libtiff/
63
64
65
66libtiff October 15, 1995 TIFFReadScanline(3TIFF)