|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
<meta content="groff -Thtml, see www.gnu.org" name="generator">
|
|
kusano |
7d535a |
<meta content="text/css" name="Content-Style">
|
|
kusano |
7d535a |
<title>TIFFWriteScanline</title>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFWriteScanline
|
|
kusano |
7d535a |
NAME
|
|
kusano |
7d535a |
SYNOPSIS
|
|
kusano |
7d535a |
DESCRIPTION
|
|
kusano |
7d535a |
NOTES
|
|
kusano |
7d535a |
RETURN VALUES
|
|
kusano |
7d535a |
DIAGNOSTICS
|
|
kusano |
7d535a |
BUGS
|
|
kusano |
7d535a |
SEE ALSO
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
NAME
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFWriteScanline − write a scanline to an open
|
|
kusano |
7d535a |
<small>TIFF</small> file
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
SYNOPSIS
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#include <tiffio.h>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
int TIFFWriteScanline(TIFF *tif,
|
|
kusano |
7d535a |
tdata_t buf, uint32 row,
|
|
kusano |
7d535a |
tsample_t sample)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
DESCRIPTION
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Write data to a file at the specified row. The
|
|
kusano |
7d535a |
sample parameter is used only if data are organized
|
|
kusano |
7d535a |
in separate planes (PlanarConfiguration=2). The data
|
|
kusano |
7d535a |
are assumed to be uncompressed and in the native bit- and
|
|
kusano |
7d535a |
byte-order of the host machine. The data written to the file
|
|
kusano |
7d535a |
is compressed according to the compression scheme of the
|
|
kusano |
7d535a |
current <small>TIFF</small> directory (see further below).
|
|
kusano |
7d535a |
If the current scanline is past the end of the current
|
|
kusano |
7d535a |
subfile, the ImageLength field is automatically
|
|
kusano |
7d535a |
increased to include the scanline (except for
|
|
kusano |
7d535a |
PlanarConfiguration=2, where the ImageLength
|
|
kusano |
7d535a |
cannot be changed once the first data are written). If the
|
|
kusano |
7d535a |
ImageLength is increased, the StripOffsets and
|
|
kusano |
7d535a |
StripByteCounts fields are similarly enlarged to
|
|
kusano |
7d535a |
reflect data written past the previous end of image.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
NOTES
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The library writes encoded data using the native machine
|
|
kusano |
7d535a |
byte order. Correctly implemented <small>TIFF</small>
|
|
kusano |
7d535a |
readers are expected to do any necessary byte-swapping to
|
|
kusano |
7d535a |
correctly process image data with BitsPerSample greater than
|
|
kusano |
7d535a |
8. The library attempts to hide bit-ordering differences
|
|
kusano |
7d535a |
between the image and the native machine by converting data
|
|
kusano |
7d535a |
from the native machine order.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
In C++ the sample parameter defaults to 0.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Once data are written to a file for the current
|
|
kusano |
7d535a |
directory, the values of certain tags may not be altered;
|
|
kusano |
7d535a |
see TIFFSetField(3TIFF) for more information.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
It is not possible to write scanlines to a file that uses
|
|
kusano |
7d535a |
a tiled organization. The routine TIFFIsTiled can be
|
|
kusano |
7d535a |
used to determine if the file is organized as tiles or
|
|
kusano |
7d535a |
strips.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
RETURN VALUES
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFWriteScanline returns −1 if it
|
|
kusano |
7d535a |
immediately detects an error and 1 for a successful
|
|
kusano |
7d535a |
write.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
DIAGNOSTICS
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
All error messages are directed to the
|
|
kusano |
7d535a |
TIFFError(3TIFF) routine.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
%s: File not open for writing . The file was
|
|
kusano |
7d535a |
opened for reading, not writing.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Can not write scanlines to a tiled image. An
|
|
kusano |
7d535a |
attempt was made to write a scanline to a tiled image. The
|
|
kusano |
7d535a |
image is assumed to be organized in tiles because the
|
|
kusano |
7d535a |
TileWidth and TileLength tags have been set
|
|
kusano |
7d535a |
with TIFFSetField(3TIFF).
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Compression algorithm does not support random
|
|
kusano |
7d535a |
access. Data was written in a non-sequential order to a
|
|
kusano |
7d535a |
file that uses a compression algorithm and that has
|
|
kusano |
7d535a |
RowsPerStrip greater than one. That is, data in the
|
|
kusano |
7d535a |
image is to be stored in a compressed form, and with
|
|
kusano |
7d535a |
multiple rows packed into a strip. In this case, the library
|
|
kusano |
7d535a |
does not support random access to the data. The data should
|
|
kusano |
7d535a |
either be written as entire strips, sequentially by rows, or
|
|
kusano |
7d535a |
the value of RowsPerStrip should be set to one.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
%s: Must set "ImageWidth" before writing
|
|
kusano |
7d535a |
data. The image’s width has not be set before the
|
|
kusano |
7d535a |
first write. See TIFFSetField(3TIFF) for information
|
|
kusano |
7d535a |
on how to do this.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
%s: Must set "PlanarConfiguration" before
|
|
kusano |
7d535a |
writing data. The organization of data has not be
|
|
kusano |
7d535a |
defined before the first write. See
|
|
kusano |
7d535a |
TIFFSetField(3TIFF) for information on how to do
|
|
kusano |
7d535a |
this.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Can not change "ImageLength" when using
|
|
kusano |
7d535a |
separate planes. Separate image planes are being used
|
|
kusano |
7d535a |
(PlanarConfiguration=2), but the number of rows has
|
|
kusano |
7d535a |
not been specified before the first write. The library
|
|
kusano |
7d535a |
supports the dynamic growth of an image only when data are
|
|
kusano |
7d535a |
organized in a contiguous manner
|
|
kusano |
7d535a |
(PlanarConfiguration=1).
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
%d: Sample out of range, max %d. The sample
|
|
kusano |
7d535a |
parameter was greater than the value of the SamplesPerPixel
|
|
kusano |
7d535a |
tag.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
%s: No space for strip arrays . There was not
|
|
kusano |
7d535a |
enough space for the arrays that hold strip offsets and byte
|
|
kusano |
7d535a |
counts.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
BUGS
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Writing subsampled YCbCR data does not work correctly
|
|
kusano |
7d535a |
because, for PlanarConfiguration=2 the size of a
|
|
kusano |
7d535a |
scanline is not calculated on a per-sample basis, and for
|
|
kusano |
7d535a |
PlanarConfiguration=1 the library does not pack the
|
|
kusano |
7d535a |
block-interleaved samples.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
SEE ALSO
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFOpen(3TIFF),
|
|
kusano |
7d535a |
TIFFWriteEncodedStrip(3TIFF),
|
|
kusano |
7d535a |
TIFFWriteRawStrip(3TIFF), libtiff(3TIFF)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Libtiff library home page:
|
|
kusano |
7d535a |
http://www.remotesensing.org/libtiff/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|