1
<!-- Creator : groff version 1.18.1 -->
2
<!-- CreationDate: Fri Jul 13 17:43:16 2007 -->
5
<meta name="generator" content="groff -Thtml, see www.gnu.org">
6
<meta name="Content-Style" content="text/css">
7
<title>TIFFReadScanline</title>
11
<h1 align=center>TIFFReadScanline</h1>
12
<a href="#NAME">NAME</a><br>
13
<a href="#SYNOPSIS">SYNOPSIS</a><br>
14
<a href="#DESCRIPTION">DESCRIPTION</a><br>
15
<a href="#NOTES">NOTES</a><br>
16
<a href="#RETURN VALUES">RETURN VALUES</a><br>
17
<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br>
18
<a href="#BUGS">BUGS</a><br>
19
<a href="#SEE ALSO">SEE ALSO</a><br>
25
<table width="100%" border=0 rules="none" frame="void"
26
cols="2" cellspacing="0" cellpadding="0">
27
<tr valign="top" align="left">
30
<p>TIFFReadScanline − read and decode a scanline of
31
data from an open <small>TIFF</small> file</p>
34
<a name="SYNOPSIS"></a>
37
<table width="100%" border=0 rules="none" frame="void"
38
cols="2" cellspacing="0" cellpadding="0">
39
<tr valign="top" align="left">
42
<p><b>#include <tiffio.h></b></p>
44
<p><b>int TIFFReadScanline(TIFF *</b><i>tif</i><b>,
45
tdata_t</b> <i>buf</i><b>, uint32</b> <i>row</i><b>,
46
tsample_t</b> <i>sample</i><b>)</b></p>
49
<a name="DESCRIPTION"></a>
52
<table width="100%" border=0 rules="none" frame="void"
53
cols="2" cellspacing="0" cellpadding="0">
54
<tr valign="top" align="left">
57
<p>Read the data for the specified row into the (user
58
supplied) data buffer <i>buf</i>. The data are returned
59
decompressed and, in the native byte- and bit-ordering, but
60
are otherwise packed (see further below). The buffer must be
61
large enough to hold an entire scanline of data.
62
Applications should call the routine <i>TIFFScanlineSize</i>
63
to find out the size (in bytes) of a scanline buffer. The
64
<i>row</i> parameter is always used by
65
<i>TIFFReadScanline</i>; the <i>sample</i> parameter is used
66
only if data are organized in separate planes
67
(<i>PlanarConfiguration</i>=2).</p>
73
<table width="100%" border=0 rules="none" frame="void"
74
cols="2" cellspacing="0" cellpadding="0">
75
<tr valign="top" align="left">
78
<p>The library attempts to hide bit- and byte-ordering
79
differences between the image and the native machine by
80
converting data to the native machine order. Bit reversal is
81
done if the <i>FillOrder</i> tag is opposite to the native
82
machine bit order. 16- and 32-bit samples are automatically
83
byte-swapped if the file was written with a byte order
84
opposite to the native machine byte order,</p>
86
<p>In C++ the <i>sample</i> parameter defaults to 0.</p>
89
<a name="RETURN VALUES"></a>
90
<h2>RETURN VALUES</h2>
92
<table width="100%" border=0 rules="none" frame="void"
93
cols="2" cellspacing="0" cellpadding="0">
94
<tr valign="top" align="left">
97
<p><i>TIFFReadScanline</i> returns −1 if it detects an
98
error; otherwise 1 is returned.</p>
101
<a name="DIAGNOSTICS"></a>
104
<table width="100%" border=0 rules="none" frame="void"
105
cols="2" cellspacing="0" cellpadding="0">
106
<tr valign="top" align="left">
109
<p>All error messages are directed to the
110
<i>TIFFError</i>(3TIFF) routine.</p>
112
<p><b>Compression algorithm does not support random
113
access</b>. Data was requested in a non-sequential order
114
from a file that uses a compression algorithm and that has
115
<i>RowsPerStrip</i> greater than one. That is, data in the
116
image is stored in a compressed form, and with multiple rows
117
packed into a strip. In this case, the library does not
118
support random access to the data. The data should either be
119
accessed sequentially, or the file should be converted so
120
that each strip is made up of one row of data.</p>
126
<table width="100%" border=0 rules="none" frame="void"
127
cols="2" cellspacing="0" cellpadding="0">
128
<tr valign="top" align="left">
131
<p>Reading subsampled YCbCR data does not work correctly
132
because, for <i>PlanarConfiguration</i>=2 the size of a
133
scanline is not calculated on a per-sample basis, and for
134
<i>PlanarConfiguration</i>=1 the library does not unpack the
135
block-interleaved samples; use the strip- and tile-based
136
interfaces to read these formats.</p>
139
<a name="SEE ALSO"></a>
142
<table width="100%" border=0 rules="none" frame="void"
143
cols="2" cellspacing="0" cellpadding="0">
144
<tr valign="top" align="left">
147
<p><b>TIFFOpen</b>(3TIFF),
148
<b>TIFFReadEncodedStrip</b>(3TIFF),
149
<b>TIFFReadRawStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
151
<p>Libtiff library home page:
152
<b>http://www.remotesensing.org/libtiff/</b></p>