<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
<!--ArborText, Inc., 1988-1999, v.4002-->
<!--ARC : LSARC 2003/085 libtiff, libjpeg, and libpng-->
<!ENTITY exde-tt "EXTENDED DESCRIPTION">
<!ENTITY synp-tt "SYNOPSIS">
<!ENTITY cmd "TIFFReadScanline">
<!ENTITY % commonents SYSTEM "smancommon.ent">
%commonents;
<!ENTITY % gnomecommonents SYSTEM "gnomecommon.ent">
%gnomecommonents;
<!ENTITY % booktitles SYSTEM "booktitles.ent">
%booktitles;
<!ENTITY suncopy "Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.">
]>
<?Pub UDT _bookmark _target>
<?Pub Inc>
<?PubInc>
<refentry id="TIFFReadScanline-3tiff">
<!-- %Z%%M% %I% %E% SMI; -->
<refmeta><refentrytitle>TIFFReadScanline</refentrytitle><manvolnum>3tiff</manvolnum>
<refmiscinfo class="date">05 Apr 2004</refmiscinfo>
<refmiscinfo class="sectdesc">&man3;</refmiscinfo>
<refmiscinfo class="software">&release;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
</refmeta>
<indexterm><primary>TIFFReadScanline</primary></indexterm><indexterm><primary>
read and decode a scanline of data from an open TIFF file</primary></indexterm>
<refnamediv id="TIFFReadScanline-3tiff-name"><refname>TIFFReadScanline</refname>
<refpurpose>read and decode a scanline of data from an open TIFF file</refpurpose>
</refnamediv>
<refsect1 id="TIFFReadScanline-3tiff-synp"><title>&synp-tt;</title>
<programlisting>#include &lt;tiffio.h>
int TIFFReadScanline(TIFF* tif, tdata_t buf, uint32 row,
tsample_t sample)</programlisting>
</refsect1>
<refsect1 id="TIFFReadScanline-3tiff-desc"><title>&desc-tt;</title>
<para>Read the data for the specified row into the user-supplied data buffer.
</para>
</refsect1>
<refsect1 id="TIFFReadScanline-3tiff-exde"><title>&exde-tt;</title>
<para>The data is returned decompressed and in the native byte- and bit-ordering,
but is otherwise packed as described below. The buffer must be large enough
to hold an entire scanline of data. Applications should call the routine <literal>
TIFFScanlineSize</literal> to find out the size in bytes of a scanline buffer.
The <literal>row</literal> parameter is always used by <literal>TIFFReadScanline
</literal>. The <literal>sample</literal> parameter is used only if data is
organized in separate planes (PlanarConfiguration=2).</para>
<para>The library attempts to hide bit- and byte-ordering differences between
the image and the native machine by converting data to the native machine
order. Bit reversal is performed if the <literal>FillOrder</literal> tag is
opposite to the native machine bit order. 16- and 32-bit samples are automatically
byte-swapped if the file was written with a byte order opposite to the native
machine byte order.</para>
<refsect2 id="TIFFReadScanline-3tiff-exde-diags">
<title>Diagnostics</title>
<para>All error messages are directed to the <literal>TIFFError(3tiff)</literal>
routine.</para>
<variablelist>
<varlistentry><term>Compression algorithm does not support random access.
</term><listitem><para>Data was requested in a non-sequential order from a
file that uses a compression algorithm and that has <literal>RowsPerStrip
</literal> greater than one. That is, data in the image is stored in a compressed
form, and with multiple rows packed into a strip. In this case, the library
does not support random access to the data. The data should either be accessed
sequentially, or the file should be converted so that each strip is made up
of one row of data.</para>
</listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1 id="TIFFReadScanline-3tiff-rtrn"><title>&rtrn-tt;</title>
<para>Returns -1 if an error was encountered. Otherwise, returns 1.</para>
</refsect1>
<refsect1 id="TIFFReadScanline-3tiff-attr"><title>&attr-tt;</title>
<para>See <olink targetdocent="REFMAN5" localinfo="attributes-5"><citerefentry>
<refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>
for descriptions of the following attributes:</para>
<informaltable frame="all">
<tgroup cols="2" colsep="1" rowsep="1"><colspec colname="COLSPEC0" colwidth="1*">
<colspec colname="COLSPEC1" colwidth="1*">
<thead>
<row><entry align="center" valign="middle">ATTRIBUTE TYPE</entry><entry align="center"
valign="middle">ATTRIBUTE VALUE</entry></row>
</thead>
<tbody>
<row><entry><para>Availability</para></entry><entry><para>image/library/libtiff</para></entry>
</row>
<row><entry colname="COLSPEC0"><para>Interface stability</para></entry><entry
colname="COLSPEC1"><para>Uncommitted</para></entry></row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="TIFFReadScanline-3tiff-also"><title>&also-tt;</title>
<!--Reference to another man page-->
<!--Reference to a Help manual-->
<!--Reference to a book.-->
<para><citerefentry><refentrytitle>libtiff</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>, <citerefentry><refentrytitle>TIFFOpen</refentrytitle><manvolnum>
3tiff</manvolnum></citerefentry>, <citerefentry><refentrytitle>TIFFReadEncodedStrip
</refentrytitle><manvolnum>3tiff</manvolnum></citerefentry><?Pub Caret>, <citerefentry>
<refentrytitle>TIFFReadRawStrip</refentrytitle><manvolnum>3tiff</manvolnum>
</citerefentry></para>
</refsect1>
<refsect1 id="TIFFReadScanline-3tiff-note"><title>&note-tt;</title>
<para>In C++, the <literal>sample</literal> parameter defaults to 0.</para>
<para>Reading subsampled YCbCR data does not work correctly because:</para>
<itemizedlist>
<listitem><para>For PlanarConfiguration=2, the size of a scanline is not calculated
on a per-sample basis.</para></listitem>
<listitem><para>For PlanarConfiguration=1, the library does not unpack the
block-interleaved samples.</para></listitem>
</itemizedlist>
<para>Use the strip- and tile-based interfaces to read these formats.</para>
<para>This man page was originally written by Sam Leffler. Updated by Breda
McColgan, Sun Microsystems Inc., 2004.</para>
</refsect1>
</refentry>
<?Pub *0000005924>
