Blame man/TIFFReadScanline.3tiff

Packit 994f1a
.\" $Id: TIFFReadScanline.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 TIFFReadScanline 3TIFF "October 15, 1995" "libtiff"
Packit 994f1a
.SH NAME
Packit 994f1a
TIFFReadScanline \- read and decode a scanline of data from 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 TIFFReadScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")"
Packit 994f1a
.SH DESCRIPTION
Packit 994f1a
Read the data for the specified row into the (user supplied) data buffer
Packit 994f1a
.IR buf .
Packit 994f1a
The data are returned decompressed and, in the native byte- and bit-ordering,
Packit 994f1a
but are otherwise packed (see further below). The buffer must be large enough
Packit 994f1a
to hold an entire scanline of data. Applications should call the routine
Packit 994f1a
.IR TIFFScanlineSize
Packit 994f1a
to find out the size (in bytes) of a scanline buffer.
Packit 994f1a
The
Packit 994f1a
.I row
Packit 994f1a
parameter is always used by
Packit 994f1a
.IR TIFFReadScanline ;
Packit 994f1a
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
.SH NOTES
Packit 994f1a
The library attempts to hide bit- and byte-ordering differences between the
Packit 994f1a
image and the native machine by converting data to the native machine order.
Packit 994f1a
Bit reversal is done if the
Packit 994f1a
.I FillOrder
Packit 994f1a
tag is opposite to the native machine bit order. 16- and 32-bit samples are
Packit 994f1a
automatically byte-swapped if the file was written with a byte order opposite
Packit 994f1a
to the native machine byte order,
Packit 994f1a
.PP
Packit 994f1a
In C++ the
Packit 994f1a
.I sample
Packit 994f1a
parameter defaults to 0.
Packit 994f1a
.SH "RETURN VALUES"
Packit 994f1a
.IR TIFFReadScanline
Packit 994f1a
returns \-1 if it detects an error; otherwise 1 is returned.
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 "Compression algorithm does not support random access" .
Packit 994f1a
Data was requested in a non-sequential order from a file that uses a
Packit 994f1a
compression algorithm and that has
Packit 994f1a
.I RowsPerStrip
Packit 994f1a
greater than one.
Packit 994f1a
That is, data in the image is stored in a compressed form, and with multiple
Packit 994f1a
rows packed into a strip. In this case, the library does not support random
Packit 994f1a
access to the data. The data should either be accessed sequentially, or the
Packit 994f1a
file should be converted so that each strip is made up of one row of data.
Packit 994f1a
.SH BUGS
Packit 994f1a
Reading 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 unpack the block-interleaved samples; use the strip- and
Packit 994f1a
tile-based interfaces to read these formats.
Packit 994f1a
.SH "SEE ALSO"
Packit 994f1a
.BR TIFFOpen (3TIFF),
Packit 994f1a
.BR TIFFReadEncodedStrip (3TIFF),
Packit 994f1a
.BR TIFFReadRawStrip (3TIFF),
Packit 994f1a
.BR libtiff (3TIFF)
Packit 994f1a
.PP
Packit 994f1a
Libtiff library home page:
Packit 994f1a
.BR http://www.remotesensing.org/libtiff/