roentgen b75cab
.\" $Id: TIFFReadScanline.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
roentgen b75cab
.\"
roentgen b75cab
.\" Copyright (c) 1988-1997 Sam Leffler
roentgen b75cab
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
roentgen b75cab
.\"
roentgen b75cab
.\" Permission to use, copy, modify, distribute, and sell this software and 
roentgen b75cab
.\" its documentation for any purpose is hereby granted without fee, provided
roentgen b75cab
.\" that (i) the above copyright notices and this permission notice appear in
roentgen b75cab
.\" all copies of the software and related documentation, and (ii) the names of
roentgen b75cab
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
roentgen b75cab
.\" publicity relating to the software without the specific, prior written
roentgen b75cab
.\" permission of Sam Leffler and Silicon Graphics.
roentgen b75cab
.\" 
roentgen b75cab
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
roentgen b75cab
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
roentgen b75cab
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
roentgen b75cab
.\" 
roentgen b75cab
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
roentgen b75cab
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
roentgen b75cab
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
roentgen b75cab
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
roentgen b75cab
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
roentgen b75cab
.\" OF THIS SOFTWARE.
roentgen b75cab
.\"
roentgen b75cab
.if n .po 0
roentgen b75cab
.TH TIFFReadScanline 3TIFF "October 15, 1995" "libtiff"
roentgen b75cab
.SH NAME
roentgen b75cab
TIFFReadScanline \- read and decode a scanline of data from an open
roentgen b75cab
.SM TIFF
roentgen b75cab
file
roentgen b75cab
.SH SYNOPSIS
roentgen b75cab
.B "#include <tiffio.h>"</tiffio.h>
roentgen b75cab
.sp
roentgen b75cab
.BI "int TIFFReadScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")"
roentgen b75cab
.SH DESCRIPTION
roentgen b75cab
Read the data for the specified row into the (user supplied) data buffer
roentgen b75cab
.IR buf .
roentgen b75cab
The data are returned decompressed and, in the native byte- and bit-ordering,
roentgen b75cab
but are otherwise packed (see further below). The buffer must be large enough
roentgen b75cab
to hold an entire scanline of data. Applications should call the routine
roentgen b75cab
.IR TIFFScanlineSize
roentgen b75cab
to find out the size (in bytes) of a scanline buffer.
roentgen b75cab
The
roentgen b75cab
.I row
roentgen b75cab
parameter is always used by
roentgen b75cab
.IR TIFFReadScanline ;
roentgen b75cab
the
roentgen b75cab
.I sample
roentgen b75cab
parameter is used only if data are organized in separate planes (\c
roentgen b75cab
.IR PlanarConfiguration =2).
roentgen b75cab
.SH NOTES
roentgen b75cab
The library attempts to hide bit- and byte-ordering differences between the
roentgen b75cab
image and the native machine by converting data to the native machine order.
roentgen b75cab
Bit reversal is done if the
roentgen b75cab
.I FillOrder
roentgen b75cab
tag is opposite to the native machine bit order. 16- and 32-bit samples are
roentgen b75cab
automatically byte-swapped if the file was written with a byte order opposite
roentgen b75cab
to the native machine byte order,
roentgen b75cab
.PP
roentgen b75cab
In C++ the
roentgen b75cab
.I sample
roentgen b75cab
parameter defaults to 0.
roentgen b75cab
.SH "RETURN VALUES"
roentgen b75cab
.IR TIFFReadScanline
roentgen b75cab
returns \-1 if it detects an error; otherwise 1 is returned.
roentgen b75cab
.SH DIAGNOSTICS
roentgen b75cab
All error messages are directed to the
roentgen b75cab
.IR TIFFError (3TIFF)
roentgen b75cab
routine.
roentgen b75cab
.PP
roentgen b75cab
.BR "Compression algorithm does not support random access" .
roentgen b75cab
Data was requested in a non-sequential order from a file that uses a
roentgen b75cab
compression algorithm and that has
roentgen b75cab
.I RowsPerStrip
roentgen b75cab
greater than one.
roentgen b75cab
That is, data in the image is stored in a compressed form, and with multiple
roentgen b75cab
rows packed into a strip. In this case, the library does not support random
roentgen b75cab
access to the data. The data should either be accessed sequentially, or the
roentgen b75cab
file should be converted so that each strip is made up of one row of data.
roentgen b75cab
.SH BUGS
roentgen b75cab
Reading subsampled YCbCR data does not work correctly because, for 
roentgen b75cab
.IR PlanarConfiguration =2
roentgen b75cab
the size of a scanline is not calculated on a per-sample basis, and for
roentgen b75cab
.IR PlanarConfiguration =1
roentgen b75cab
the library does not unpack the block-interleaved samples; use the strip- and
roentgen b75cab
tile-based interfaces to read these formats.
roentgen b75cab
.SH "SEE ALSO"
roentgen b75cab
.BR TIFFOpen (3TIFF),
roentgen b75cab
.BR TIFFReadEncodedStrip (3TIFF),
roentgen b75cab
.BR TIFFReadRawStrip (3TIFF),
roentgen b75cab
.BR libtiff (3TIFF)
roentgen b75cab
.PP
roentgen b75cab
Libtiff library home page:
roentgen b75cab
.BR http://www.remotesensing.org/libtiff/