1 .\" $Id: TIFFReadScanline.3tiff,v 1.2 2005/11/02 11:07:18 dron Exp $
 
   3 .\" Copyright (c) 1988-1997 Sam Leffler
 
   4 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
 
   6 .\" Permission to use, copy, modify, distribute, and sell this software and 
 
   7 .\" its documentation for any purpose is hereby granted without fee, provided
 
   8 .\" that (i) the above copyright notices and this permission notice appear in
 
   9 .\" all copies of the software and related documentation, and (ii) the names of
 
  10 .\" Sam Leffler and Silicon Graphics may not be used in any advertising or
 
  11 .\" publicity relating to the software without the specific, prior written
 
  12 .\" permission of Sam Leffler and Silicon Graphics.
 
  14 .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
 
  15 .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
 
  16 .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
 
  18 .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
 
  19 .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
 
  20 .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 
  21 .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
 
  22 .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
 
  26 .TH TIFFReadScanline 3TIFF "October 15, 1995" "libtiff"
 
  28 TIFFReadScanline \- read and decode a scanline of data from an open
 
  32 .B "#include <tiffio.h>"
 
  34 .BI "int TIFFReadScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")"
 
  36 Read the data for the specified row into the (user supplied) data buffer
 
  38 The data are returned decompressed and, in the native byte- and bit-ordering,
 
  39 but are otherwise packed (see further below). The buffer must be large enough
 
  40 to hold an entire scanline of data. Applications should call the routine
 
  42 to find out the size (in bytes) of a scanline buffer.
 
  45 parameter is always used by
 
  46 .IR TIFFReadScanline ;
 
  49 parameter is used only if data are organized in separate planes (\c
 
  50 .IR PlanarConfiguration =2).
 
  52 The library attempts to hide bit- and byte-ordering differences between the
 
  53 image and the native machine by converting data to the native machine order.
 
  54 Bit reversal is done if the
 
  56 tag is opposite to the native machine bit order. 16- and 32-bit samples are
 
  57 automatically byte-swapped if the file was written with a byte order opposite
 
  58 to the native machine byte order,
 
  62 parameter defaults to 0.
 
  65 returns \-1 if it detects an error; otherwise 1 is returned.
 
  67 All error messages are directed to the
 
  71 .BR "Compression algorithm does not support random access" .
 
  72 Data was requested in a non-sequential order from a file that uses a
 
  73 compression algorithm and that has
 
  76 That is, data in the image is stored in a compressed form, and with multiple
 
  77 rows packed into a strip. In this case, the library does not support random
 
  78 access to the data. The data should either be accessed sequentially, or the
 
  79 file should be converted so that each strip is made up of one row of data.
 
  81 Reading subsampled YCbCR data does not work correctly because, for 
 
  82 .IR PlanarConfiguration =2
 
  83 the size of a scanline is not calculated on a per-sample basis, and for
 
  84 .IR PlanarConfiguration =1
 
  85 the library does not unpack the block-interleaved samples; use the strip- and
 
  86 tile-based interfaces to read these formats.
 
  89 .BR TIFFReadEncodedStrip (3TIFF),
 
  90 .BR TIFFReadRawStrip (3TIFF),
 
  93 Libtiff library home page:
 
  94 .BR http://www.remotesensing.org/libtiff/