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 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,
67       sequentially  by  rows,  or  the value of RowsPerStrip should be set to
68       one.
69
70       %s: Must set "ImageWidth" before writing data.  The image's  width  has
71       not  be set before the first write.  See TIFFSetField(3TIFF) for infor‐
72       mation on how to do this.
73
74       %s: Must set "PlanarConfiguration" before writing data.  The  organiza‐
75       tion  of  data has not be defined before the first write.  See TIFFSet‐
76       Field(3TIFF) for information on how to do this.
77
78       Can not change "ImageLength" when using separate planes. Separate image
79       planes  are  being used (PlanarConfiguration=2), but the number of rows
80       has not been specified before the first write. The library supports the
81       dynamic growth of an image only when data are organized in a contiguous
82       manner (PlanarConfiguration=1).
83
84       %d: Sample out of range, max %d.  The sample parameter was greater than
85       the value of the SamplesPerPixel tag.
86
87       %s:  No  space  for  strip arrays .  There was not enough space for the
88       arrays that hold strip offsets and byte counts.
89

BUGS

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

SEE ALSO

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