Blame man/TIFFWriteScanline.3tiff

Packit 994f1a
.\" $Id: TIFFWriteScanline.3tiff,v 1.2 2005/11/02 11:07:18 dron Exp $
Packit 994f1a
.\"
Packit 994f1a
.\" Copyright (c) 1988-1997 Sam Leffler
Packit 994f1a
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
Packit 994f1a
.\"
Packit 994f1a
.\" Permission to use, copy, modify, distribute, and sell this software and 
Packit 994f1a
.\" its documentation for any purpose is hereby granted without fee, provided
Packit 994f1a
.\" that (i) the above copyright notices and this permission notice appear in
Packit 994f1a
.\" all copies of the software and related documentation, and (ii) the names of
Packit 994f1a
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit 994f1a
.\" publicity relating to the software without the specific, prior written
Packit 994f1a
.\" permission of Sam Leffler and Silicon Graphics.
Packit 994f1a
.\" 
Packit 994f1a
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
Packit 994f1a
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
Packit 994f1a
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
Packit 994f1a
.\" 
Packit 994f1a
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit 994f1a
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit 994f1a
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit 994f1a
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
Packit 994f1a
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
Packit 994f1a
.\" OF THIS SOFTWARE.
Packit 994f1a
.\"
Packit 994f1a
.if n .po 0
Packit 994f1a
.TH TIFFWriteScanline 3TIFF "December 16, 1991" "libtiff"
Packit 994f1a
.SH NAME
Packit 994f1a
TIFFWriteScanline \- write a scanline to an open
Packit 994f1a
.SM TIFF
Packit 994f1a
file
Packit 994f1a
.SH SYNOPSIS
Packit 994f1a
.B "#include <tiffio.h>"
Packit 994f1a
.sp
Packit 994f1a
.BI "int TIFFWriteScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")"
Packit 994f1a
.SH DESCRIPTION
Packit 994f1a
Write data to a file at the specified row. The
Packit 994f1a
.I sample
Packit 994f1a
parameter is used only if data are organized in separate planes (\c
Packit 994f1a
.IR PlanarConfiguration =2).
Packit 994f1a
The data are assumed to be uncompressed and in the native bit- and byte-order
Packit 994f1a
of the host machine. The data written to the file is compressed according to
Packit 994f1a
the compression scheme of the current
Packit 994f1a
.SM TIFF
Packit 994f1a
directory (see further below). If the current scanline is past the end of the
Packit 994f1a
current subfile, the
Packit 994f1a
.I ImageLength
Packit 994f1a
field is automatically increased to include the scanline (except
Packit 994f1a
for
Packit 994f1a
.IR PlanarConfiguration =2,
Packit 994f1a
where the
Packit 994f1a
.I ImageLength
Packit 994f1a
cannot be changed once the first data are written). If the
Packit 994f1a
.I ImageLength
Packit 994f1a
is increased, the
Packit 994f1a
.I StripOffsets
Packit 994f1a
and
Packit 994f1a
.I StripByteCounts
Packit 994f1a
fields are similarly enlarged to reflect data written past the previous end of
Packit 994f1a
image.
Packit 994f1a
.SH NOTES
Packit 994f1a
The library writes encoded data using the native machine byte order. Correctly
Packit 994f1a
implemented
Packit 994f1a
.SM TIFF
Packit 994f1a
readers are expected to do any necessary byte-swapping to correctly process
Packit 994f1a
image data with BitsPerSample greater than 8. The library attempts to hide
Packit 994f1a
bit-ordering differences between the image and the native machine by
Packit 994f1a
converting data from the native machine order.
Packit 994f1a
.PP
Packit 994f1a
In C++ the
Packit 994f1a
.I sample
Packit 994f1a
parameter defaults to 0.
Packit 994f1a
.PP
Packit 994f1a
Once data are written to a file for the current directory, the values of
Packit 994f1a
certain tags may not be altered; see
Packit 994f1a
.IR TIFFSetField (3TIFF)
Packit 994f1a
for more information.
Packit 994f1a
.PP
Packit 994f1a
It is not possible to write scanlines to a file that uses a tiled
Packit 994f1a
organization.  The routine
Packit 994f1a
.IR TIFFIsTiled
Packit 994f1a
can be used to determine if the file is organized as tiles or strips.
Packit 994f1a
.SH "RETURN VALUES"
Packit 994f1a
.IR TIFFWriteScanline
Packit 994f1a
returns \-1 if it immediately detects an error and 1 for a successful write.
Packit 994f1a
.SH DIAGNOSTICS
Packit 994f1a
All error messages are directed to the
Packit 994f1a
.IR TIFFError (3TIFF)
Packit 994f1a
routine.
Packit 994f1a
.PP
Packit 994f1a
.BR "%s: File not open for writing .
Packit 994f1a
The file was opened for reading, not writing.
Packit 994f1a
.PP
Packit 994f1a
.BR "Can not write scanlines to a tiled image" .
Packit 994f1a
An attempt was made to write a scanline to a tiled image. The image is assumed
Packit 994f1a
to be organized in tiles because the
Packit 994f1a
.I TileWidth
Packit 994f1a
and
Packit 994f1a
.I TileLength
Packit 994f1a
tags have been set with
Packit 994f1a
.IR TIFFSetField (3TIFF).
Packit 994f1a
.PP
Packit 994f1a
.BR "Compression algorithm does not support random access" .
Packit 994f1a
Data was written in a non-sequential order to a file that uses a compression
Packit 994f1a
algorithm and that has
Packit 994f1a
.I RowsPerStrip
Packit 994f1a
greater than one. That is, data in the image is to be stored in a compressed
Packit 994f1a
form, and with multiple rows packed into a strip. In this case, the library
Packit 994f1a
does not support random access to the data. The data should either be written
Packit 994f1a
as entire strips, sequentially by rows, or the value of
Packit 994f1a
.I RowsPerStrip
Packit 994f1a
should be set to one.
Packit 994f1a
.PP
Packit 994f1a
\fB%s: Must set "ImageWidth" before writing data\fP.
Packit 994f1a
The image's width has not be set before the first write.
Packit 994f1a
See
Packit 994f1a
.BR TIFFSetField (3TIFF)
Packit 994f1a
for information on how to do this.
Packit 994f1a
.PP
Packit 994f1a
\fB%s: Must set "PlanarConfiguration" before writing data\fP.
Packit 994f1a
The organization of data has not be defined before the first write.
Packit 994f1a
See
Packit 994f1a
.BR TIFFSetField (3TIFF)
Packit 994f1a
for information on how to do this.
Packit 994f1a
.PP
Packit 994f1a
\fBCan not change "ImageLength" when using separate planes\fP. Separate image
Packit 994f1a
planes are being used (\c
Packit 994f1a
.IR PlanarConfiguration =2),
Packit 994f1a
but the number of rows has not been specified before the first write. The
Packit 994f1a
library supports the dynamic growth of an image only when data are organized
Packit 994f1a
in a contiguous manner (\c
Packit 994f1a
.IR PlanarConfiguration =1).
Packit 994f1a
.PP
Packit 994f1a
.BR "%d: Sample out of range, max %d" .
Packit 994f1a
The
Packit 994f1a
.I sample
Packit 994f1a
parameter was greater than the value of the SamplesPerPixel tag.
Packit 994f1a
.PP
Packit 994f1a
.BR "%s: No space for strip arrays .
Packit 994f1a
There was not enough space for the arrays that hold strip offsets and byte
Packit 994f1a
counts.
Packit 994f1a
.SH BUGS
Packit 994f1a
Writing subsampled YCbCR data does not work correctly because, for 
Packit 994f1a
.IR PlanarConfiguration =2
Packit 994f1a
the size of a scanline is not calculated on a per-sample basis, and for
Packit 994f1a
.IR PlanarConfiguration =1
Packit 994f1a
the library does not pack the block-interleaved samples.
Packit 994f1a
.SH "SEE ALSO"
Packit 994f1a
.BR TIFFOpen (3TIFF),
Packit 994f1a
.BR TIFFWriteEncodedStrip (3TIFF),
Packit 994f1a
.BR TIFFWriteRawStrip (3TIFF),
Packit 994f1a
.BR libtiff (3TIFF)
Packit 994f1a
.PP
Packit 994f1a
Libtiff library home page:
Packit 994f1a
.BR http://www.remotesensing.org/libtiff/