2 .\" Copyright (c) 1988-1997 Sam Leffler
3 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
5 .\" Permission to use, copy, modify, distribute, and sell this software and
6 .\" its documentation for any purpose is hereby granted without fee, provided
7 .\" that (i) the above copyright notices and this permission notice appear in
8 .\" all copies of the software and related documentation, and (ii) the names of
9 .\" Sam Leffler and Silicon Graphics may not be used in any advertising or
10 .\" publicity relating to the software without the specific, prior written
11 .\" permission of Sam Leffler and Silicon Graphics.
13 .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14 .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15 .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
17 .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18 .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19 .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21 .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
25 .TH TIFFWriteScanline 3TIFF "December 16, 1991" "libtiff"
27 TIFFWriteScanline \- write a scanline to an open
31 .B "#include <tiffio.h>"
33 .BI "int TIFFWriteScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")"
35 Write data to a file at the specified row. The
37 parameter is used only if data are organized in separate planes (\c
38 .IR PlanarConfiguration =2).
39 The data are assumed to be uncompressed and in the native bit- and byte-order
40 of the host machine. The data written to the file is compressed according to
41 the compression scheme of the current
43 directory (see further below). If the current scanline is past the end of the
46 field is automatically increased to include the scanline (except
48 .IR PlanarConfiguration =2,
51 cannot be changed once the first data are written). If the
57 fields are similarly enlarged to reflect data written past the previous end of
60 The library writes encoded data using the native machine byte order. Correctly
63 readers are expected to do any necessary byte-swapping to correctly process
64 image data with BitsPerSample greater than 8. The library attempts to hide
65 bit-ordering differences between the image and the native machine by
66 converting data from the native machine order.
70 parameter defaults to 0.
72 Once data are written to a file for the current directory, the values of
73 certain tags may not be altered; see
74 .IR TIFFSetField (3TIFF)
77 It is not possible to write scanlines to a file that uses a tiled
78 organization. The routine
80 can be used to determine if the file is organized as tiles or strips.
83 returns \-1 if it immediately detects an error and 1 for a successful write.
85 All error messages are directed to the
89 .BR "%s: File not open for writing .
90 The file was opened for reading, not writing.
92 .BR "Can not write scanlines to a tiled image" .
93 An attempt was made to write a scanline to a tiled image. The image is assumed
94 to be organized in tiles because the
98 tags have been set with
99 .IR TIFFSetField (3TIFF).
101 .BR "Compression algorithm does not support random access" .
102 Data was written in a non-sequential order to a file that uses a compression
103 algorithm and that has
105 greater than one. That is, data in the image is to be stored in a compressed
106 form, and with multiple rows packed into a strip. In this case, the library
107 does not support random access to the data. The data should either be written
108 as entire strips, sequentially by rows, or the value of
110 should be set to one.
112 \fB%s: Must set "ImageWidth" before writing data\fP.
113 The image's width has not be set before the first write.
115 .BR TIFFSetField (3TIFF)
116 for information on how to do this.
118 \fB%s: Must set "PlanarConfiguration" before writing data\fP.
119 The organization of data has not be defined before the first write.
121 .BR TIFFSetField (3TIFF)
122 for information on how to do this.
124 \fBCan not change "ImageLength" when using separate planes\fP. Separate image
125 planes are being used (\c
126 .IR PlanarConfiguration =2),
127 but the number of rows has not been specified before the first write. The
128 library supports the dynamic growth of an image only when data are organized
129 in a contiguous manner (\c
130 .IR PlanarConfiguration =1).
132 .BR "%d: Sample out of range, max %d" .
135 parameter was greater than the value of the SamplesPerPixel tag.
137 .BR "%s: No space for strip arrays .
138 There was not enough space for the arrays that hold strip offsets and byte
141 Writing subsampled YCbCR data does not work correctly because, for
142 .IR PlanarConfiguration =2
143 the size of a scanline is not calculated on a per-sample basis, and for
144 .IR PlanarConfiguration =1
145 the library does not pack the block-interleaved samples.
147 .BR TIFFOpen (3TIFF),
148 .BR TIFFWriteEncodedStrip (3TIFF),
149 .BR TIFFWriteRawStrip (3TIFF),
152 Libtiff library home page:
153 .BR http://www.remotesensing.org/libtiff/