1<!-- Creator     : groff version 1.19.2 -->
2<!-- CreationDate: Mon Jan  2 17:41:49 2006 -->
3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4"http://www.w3.org/TR/html4/loose.dtd">
5<html>
6<head>
7<meta name="generator" content="groff -Thtml, see www.gnu.org">
8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9<meta name="Content-Style" content="text/css">
10<style type="text/css">
11       p     { margin-top: 0; margin-bottom: 0; }
12       pre   { margin-top: 0; margin-bottom: 0; }
13       table { margin-top: 0; margin-bottom: 0; }
14</style>
15<title>TIFFWriteScanline</title>
16
17</head>
18<body>
19
20<h1 align=center>TIFFWriteScanline</h1>
21
22<a href="#NAME">NAME</a><br>
23<a href="#SYNOPSIS">SYNOPSIS</a><br>
24<a href="#DESCRIPTION">DESCRIPTION</a><br>
25<a href="#NOTES">NOTES</a><br>
26<a href="#RETURN VALUES">RETURN VALUES</a><br>
27<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br>
28<a href="#BUGS">BUGS</a><br>
29<a href="#SEE ALSO">SEE ALSO</a><br>
30
31<hr>
32
33
34<a name="NAME"></a>
35<h2>NAME</h2>
36
37
38
39<p style="margin-left:11%; margin-top: 1em">TIFFWriteScanline
40&minus; write a scanline to an open <small>TIFF</small>
41file</p>
42
43<a name="SYNOPSIS"></a>
44<h2>SYNOPSIS</h2>
45
46
47<p style="margin-left:11%; margin-top: 1em"><b>#include
48&lt;tiffio.h&gt;</b></p>
49
50<p style="margin-left:11%; margin-top: 1em"><b>int
51TIFFWriteScanline(TIFF *</b><i>tif</i><b>, tdata_t</b>
52<i>buf</i><b>, uint32</b> <i>row</i><b>, tsample_t</b>
53<i>sample</i><b>)</b></p>
54
55<a name="DESCRIPTION"></a>
56<h2>DESCRIPTION</h2>
57
58
59<p style="margin-left:11%; margin-top: 1em">Write data to a
60file at the specified row. The <i>sample</i> parameter is
61used only if data are organized in separate planes
62(<i>PlanarConfiguration</i>=2). The data are assumed to be
63uncompressed and in the native bit- and byte-order of the
64host machine. The data written to the file is compressed
65according to the compression scheme of the current
66<small>TIFF</small> directory (see further below). If the
67current scanline is past the end of the current subfile, the
68<i>ImageLength</i> field is automatically increased to
69include the scanline (except for
70<i>PlanarConfiguration</i>=2, where the <i>ImageLength</i>
71cannot be changed once the first data are written). If the
72<i>ImageLength</i> is increased, the <i>StripOffsets</i> and
73<i>StripByteCounts</i> fields are similarly enlarged to
74reflect data written past the previous end of image.</p>
75
76<a name="NOTES"></a>
77<h2>NOTES</h2>
78
79
80<p style="margin-left:11%; margin-top: 1em">The library
81writes encoded data using the native machine byte order.
82Correctly implemented <small>TIFF</small> readers are
83expected to do any necessary byte-swapping to correctly
84process image data with BitsPerSample greater than 8. The
85library attempts to hide bit-ordering differences between
86the image and the native machine by converting data from the
87native machine order.</p>
88
89<p style="margin-left:11%; margin-top: 1em">In C++ the
90<i>sample</i> parameter defaults to 0.</p>
91
92<p style="margin-left:11%; margin-top: 1em">Once data are
93written to a file for the current directory, the values of
94certain tags may not be altered; see
95<i>TIFFSetField</i>(3TIFF) for more information.</p>
96
97<p style="margin-left:11%; margin-top: 1em">It is not
98possible to write scanlines to a file that uses a tiled
99organization. The routine <i>TIFFIsTiled</i> can be used to
100determine if the file is organized as tiles or strips.</p>
101
102<a name="RETURN VALUES"></a>
103<h2>RETURN VALUES</h2>
104
105
106
107<p style="margin-left:11%; margin-top: 1em"><i>TIFFWriteScanline</i>
108returns &minus;1 if it immediately detects an error and 1
109for a successful write.</p>
110
111<a name="DIAGNOSTICS"></a>
112<h2>DIAGNOSTICS</h2>
113
114
115<p style="margin-left:11%; margin-top: 1em">All error
116messages are directed to the <i>TIFFError</i>(3TIFF)
117routine.</p>
118
119<p style="margin-left:11%; margin-top: 1em"><b>%s: File not
120open for writing .</b> The file was opened for reading, not
121writing.</p>
122
123<p style="margin-left:11%; margin-top: 1em"><b>Can not
124write scanlines to a tiled image</b>. An attempt was made to
125write a scanline to a tiled image. The image is assumed to
126be organized in tiles because the <i>TileWidth</i> and
127<i>TileLength</i> tags have been set with
128<i>TIFFSetField</i>(3TIFF).</p>
129
130<p style="margin-left:11%; margin-top: 1em"><b>Compression
131algorithm does not support random access</b>. Data was
132written in a non-sequential order to a file that uses a
133compression algorithm and that has <i>RowsPerStrip</i>
134greater than one. That is, data in the image is to be stored
135in a compressed form, and with multiple rows packed into a
136strip. In this case, the library does not support random
137access to the data. The data should either be written as
138entire strips, sequentially by rows, or the value of
139<i>RowsPerStrip</i> should be set to one.</p>
140
141<p style="margin-left:11%; margin-top: 1em"><b>%s: Must set
142&quot;ImageWidth&quot; before writing data</b>. The
143image&rsquo;s width has not be set before the first write.
144See <b>TIFFSetField</b>(3TIFF) for information on how to do
145this.</p>
146
147<p style="margin-left:11%; margin-top: 1em"><b>%s: Must set
148&quot;PlanarConfiguration&quot; before writing data</b>. The
149organization of data has not be defined before the first
150write. See <b>TIFFSetField</b>(3TIFF) for information on how
151to do this.</p>
152
153<p style="margin-left:11%; margin-top: 1em"><b>Can not
154change &quot;ImageLength&quot; when using separate
155planes</b>. Separate image planes are being used
156(<i>PlanarConfiguration</i>=2), but the number of rows has
157not been specified before the first write. The library
158supports the dynamic growth of an image only when data are
159organized in a contiguous manner
160(<i>PlanarConfiguration</i>=1).</p>
161
162<p style="margin-left:11%; margin-top: 1em"><b>%d: Sample
163out of range, max %d</b>. The <i>sample</i> parameter was
164greater than the value of the SamplesPerPixel tag.</p>
165
166<p style="margin-left:11%; margin-top: 1em"><b>%s: No space
167for strip arrays .</b> There was not enough space for the
168arrays that hold strip offsets and byte counts.</p>
169
170<a name="BUGS"></a>
171<h2>BUGS</h2>
172
173
174<p style="margin-left:11%; margin-top: 1em">Writing
175subsampled YCbCR data does not work correctly because, for
176<i>PlanarConfiguration</i>=2 the size of a scanline is not
177calculated on a per-sample basis, and for
178<i>PlanarConfiguration</i>=1 the library does not pack the
179block-interleaved samples.</p>
180
181<a name="SEE ALSO"></a>
182<h2>SEE ALSO</h2>
183
184
185
186<p style="margin-left:11%; margin-top: 1em"><b>TIFFOpen</b>(3TIFF),
187<b>TIFFWriteEncodedStrip</b>(3TIFF),
188<b>TIFFWriteRawStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
189
190<p style="margin-left:11%; margin-top: 1em">Libtiff library
191home page: <b>http://www.remotesensing.org/libtiff/</b></p>
192<hr>
193</body>
194</html>
195