Blame man/TIFFReadScanline.3tiff

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