1TIFFWriteScanline(3TIFF)                              TIFFWriteScanline(3TIFF)
2
3
4

NAME

6       TIFFWriteScanline - write a scanline to an open TIFF file
7

SYNOPSIS

9       #include <tiffio.h>
10
11       int  TIFFWriteScanline(TIFF  *tif, tdata_t buf, uint32_t row, tsample_t
12       sample)
13

DESCRIPTION

15       Write data to a file at the specified row. The sample parameter is used
16       only  if data are organized in separate planes (PlanarConfiguration=2).
17       The data are assumed to be uncompressed and  in  the  native  bit-  and
18       byte-order  of  the  host machine. The data written to the file is com‐
19       pressed according to the compression scheme of the current TIFF  direc‐
20       tory  (see  further  below). If the current scanline is past the end of
21       the current subfile, the ImageLength field is  automatically  increased
22       to  include  the  scanline (except for PlanarConfiguration=2, where the
23       ImageLength cannot be changed once the first data are written). If  the
24       ImageLength  is  increased, the StripOffsets and StripByteCounts fields
25       are similarly enlarged to reflect data written past the previous end of
26       image.
27

NOTES

29       The  library  writes  encoded data using the native machine byte order.
30       Correctly implemented TIFF readers are expected  to  do  any  necessary
31       byte-swapping  to  correctly  process  image  data  with  BitsPerSample
32       greater than 8. The library attempts to hide  bit-ordering  differences
33       between  the  image  and the native machine by converting data from the
34       native machine order.
35
36       In C++ the sample parameter defaults to 0.
37
38       Once data are written to a file for the current directory,  the  values
39       of  certain  tags  may not be altered; see TIFFSetField(3TIFF) for more
40       information.
41
42       It is not possible to write scanlines to a file that uses a tiled orga‐
43       nization.  The routine TIFFIsTiled can be used to determine if the file
44       is organized as tiles or strips.
45

RETURN VALUES

47       TIFFWriteScanline returns -1 if it immediately detects an error  and  1
48       for a successful write.
49

DIAGNOSTICS

51       All error messages are directed to the TIFFError(3TIFF) routine.
52
53       %s:  File  not open for writing .  The file was opened for reading, not
54       writing.
55
56       Can not write scanlines to a tiled image.  An attempt was made to write
57       a  scanline  to  a tiled image. The image is assumed to be organized in
58       tiles because the TileWidth and TileLength  tags  have  been  set  with
59       TIFFSetField(3TIFF).
60
61       Compression algorithm does not support random access.  Data was written
62       in a non-sequential order to a file that uses a  compression  algorithm
63       and  that has RowsPerStrip greater than one. That is, data in the image
64       is to be stored in a compressed form, and  with  multiple  rows  packed
65       into  a strip. In this case, the library does not support random access
66       to the data. The data should either be written as  entire  strips,  se‐
67       quentially by rows, or the value of RowsPerStrip should be set to one.
68
69       %s:  Must  set "ImageWidth" before writing data.  The image's width has
70       not be set before the first write.  See TIFFSetField(3TIFF) for  infor‐
71       mation on how to do this.
72
73       %s:  Must set "PlanarConfiguration" before writing data.  The organiza‐
74       tion of data has not be defined before the first write.   See  TIFFSet‐
75       Field(3TIFF) for information on how to do this.
76
77       Can not change "ImageLength" when using separate planes. Separate image
78       planes are being used (PlanarConfiguration=2), but the number  of  rows
79       has not been specified before the first write. The library supports the
80       dynamic growth of an image only when data are organized in a contiguous
81       manner (PlanarConfiguration=1).
82
83       %d: Sample out of range, max %d.  The sample parameter was greater than
84       the value of the SamplesPerPixel tag.
85
86       %s: No space for strip arrays .  There was not enough space for the ar‐
87       rays that hold strip offsets and byte counts.
88

BUGS

90       Writing subsampled YCbCR data does not work correctly because, for Pla‐
91       narConfiguration=2 the size of a scanline is not calculated on  a  per-
92       sample  basis,  and for PlanarConfiguration=1 the library does not pack
93       the block-interleaved samples.
94

SEE ALSO

96       TIFFOpen(3TIFF),      TIFFWriteEncodedStrip(3TIFF),       TIFFWriteRaw‐
97       Strip(3TIFF), libtiff(3TIFF)
98
99       Libtiff library home page: http://www.simplesystems.org/libtiff/
100
101
102
103libtiff                        December 16, 1991      TIFFWriteScanline(3TIFF)
Impressum