10139N/A<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
10139N/A<!--ArborText, Inc., 1988-1999, v.4002-->
13666N/A<!--ARC : LSARC 2003/085 libtiff, libjpeg, and libpng-->
10139N/A<!ENTITY synp-tt "SYNOPSIS">
10139N/A<!ENTITY cmd "TIFFWriteScanline">
10139N/A<!ENTITY % commonents SYSTEM "smancommon.ent">
10139N/A%commonents;
10139N/A<!ENTITY % gnomecommonents SYSTEM "gnomecommon.ent">
10139N/A%gnomecommonents;
10139N/A<!ENTITY % booktitles SYSTEM "booktitles.ent">
10139N/A%booktitles;
10139N/A<!ENTITY suncopy "Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.">
10139N/A]>
10139N/A<?Pub UDT _bookmark _target>
10139N/A<?Pub Inc>
10139N/A<?PubInc>
10139N/A<refentry id="TIFFWriteScanline-3tiff">
10139N/A<!-- %Z%%M% %I% %E% SMI; -->
10139N/A<refmeta><refentrytitle>TIFFWriteScanline</refentrytitle><manvolnum>3tiff
10139N/A</manvolnum>
10139N/A<refmiscinfo class="date">05 Apr 2004</refmiscinfo>
10139N/A<refmiscinfo class="sectdesc">&man3;</refmiscinfo>
10139N/A<refmiscinfo class="software">&release;</refmiscinfo>
10139N/A<refmiscinfo class="arch">generic</refmiscinfo>
10139N/A<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
10139N/A</refmeta>
10139N/A<indexterm><primary>TIFFWriteScanline</primary></indexterm><indexterm><primary>
10139N/Awrite a scanline to an open TIFF file</primary></indexterm>
10139N/A<refnamediv id="TIFFWriteScanline-3tiff-name"><refname>TIFFWriteScanline</refname>
10139N/A<refpurpose>write a scanline to an open TIFF file</refpurpose></refnamediv>
10139N/A<refsect1 id="TIFFWriteScanline-3tiff-synp"><title>&synp-tt;</title>
10139N/A<programlisting>#include &lt;tiffio.h>
10139N/Aint TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row,
10139N/Atsample_t sample);
10139N/A
10139N/A</programlisting>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFWriteScanline-3tiff-desc"><title>&desc-tt;</title>
10139N/A<para>Write data to a file at the specified row. The <literal>sample</literal>
10139N/Aparameter is used only if data is organized in separate planes (PlanarConfiguration=2).
10139N/AThe data is assumed to be uncompressed and in the native bit- and byte-order
10139N/Aof the host machine. The data written to the file is compressed according
10139N/Ato the compression scheme of the current TIFF directory as described below.
10139N/AIf the current scanline is past the end of the current subfile, the <literal>
10139N/AImageLength</literal> field is automatically increased to include the scanline
10139N/A(except for PlanarConfiguration=2, where the <literal>ImageLength</literal>
10139N/Acannot be changed once the first data is written). If the <literal>ImageLength
10139N/A</literal> is increased, the <literal>StripOffsets</literal> and <literal>
10139N/AStripByteCounts</literal> fields are similarly enlarged to reflect data written
10139N/Apast the previous end of image.</para>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFWriteRawTile-3tiff-exde"><title>&exde-tt;</title>
10139N/A<para>The library writes encoded data using the native machine byte order.
10139N/ACorrectly implemented TIFF readers are expected to do any necessary byte-swapping
10139N/Ato correctly process image data with <literal>BitsPerSample</literal> greater
10139N/Athan 8. The library attempts to hide bit-ordering differences between the
10139N/Aimage and the native machine by converting data from the native machine order.
10139N/A</para>
10139N/A<refsect2 id="TIFFWriteRawTile-3tiff-exde-diags">
10139N/A<title>Diagnostics</title>
10139N/A<para>All error messages are directed to the <literal>TIFFError(3tiff)</literal>
10139N/Aroutine.</para>
10139N/A<variablelist>
10139N/A<varlistentry><term>%s: File not open for writing.</term><listitem><para>
10139N/AThe file was opened for reading, not writing.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>Can not write scanlines to a tiled image.</term><listitem>
10139N/A<para>An attempt was made to write a scanline to a tiled image. The image
10139N/Ais assumed to be organized in tiles because the <literal>TileWidth</literal>
10139N/Aand <literal>TileLength</literal> tags have been set with <literal>TIFFSetField(3tiff)
10139N/A</literal>.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>Compression algorithm does not support random access.
10139N/A</term><listitem><para>Data was written in a non-sequential order to a file
10139N/Athat uses a compression algorithm and that has <literal>RowsPerStrip</literal>
10139N/Agreater than one. That is, data in the image is to be stored in a compressed
10139N/Aform, and with multiple rows packed into a strip. In this case, the library
10139N/Adoes not support random access to the data. The data should either be written
10139N/Aas entire strips, sequentially by rows, or the value of <literal>RowsPerStrip
10139N/A</literal> should be set to one.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>%s: Must set "ImageWidth" before writing data.</term>
10139N/A<listitem><para>The image width has not been set before the first write. See <literal>
10139N/ATIFFSetField(3tiff)</literal> for information on how to do this.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>%s: Must set "PlanarConfiguration" before writing data.
10139N/A</term><listitem><para>The organization of data has not been defined before
10139N/Athe first write. See <literal>TIFFSetField(3tiff)</literal> for information on
10139N/Ahow to do this.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>Can not change "ImageLength" when using separate planes.
10139N/A</term><listitem><para>Separate image planes are being used (PlanarConfiguration=2),
10139N/Abut the number of rows has not been specified before the first write. The
10139N/Alibrary supports the dynamic growth of an image only when data is organized
10139N/Ain a contiguous manner (PlanarConfiguration=1).</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>%d: Sample out of range, max %d.</term><listitem><para>
10139N/AThe <literal>sample</literal> parameter was greater than the value of the <literal>
10139N/ASamplesPerPixel</literal> tag.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>%s: No space for strip arrays".</term><listitem><para>
10139N/AThere was not enough space for the arrays that hold strip offsets and byte
10139N/Acounts.</para>
10139N/A</listitem></varlistentry>
10139N/A</variablelist></refsect2>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFWriteScanline-3tiff-rtrn"><title>&rtrn-tt;</title>
10139N/A<para>Returns &mdash;1 if it immediately detects an error, and 1 for a successful
10139N/Awrite.</para>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFWriteScanline-3tiff-attr"><title>&attr-tt;</title>
10139N/A<para>See <olink targetdocent="REFMAN5" localinfo="attributes-5"><citerefentry>
10139N/A<refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>
10139N/Afor descriptions of the following attributes:</para>
10139N/A<informaltable frame="all">
10139N/A<tgroup cols="2" colsep="1" rowsep="1"><colspec colname="COLSPEC0" colwidth="1*">
10139N/A<colspec colname="COLSPEC1" colwidth="1*">
10139N/A<thead>
10139N/A<row><entry align="center" valign="middle">ATTRIBUTE TYPE</entry><entry align="center"
10139N/Avalign="middle">ATTRIBUTE VALUE</entry></row>
10139N/A</thead>
10139N/A<tbody>
18745N/A<row><entry><para>Availability</para></entry><entry><para>image/library/libtiff</para></entry>
10139N/A</row>
10139N/A<row><entry colname="COLSPEC0"><para>Interface stability</para></entry><entry
13623N/Acolname="COLSPEC1"><para>Uncommitted</para></entry></row>
10139N/A</tbody>
10139N/A</tgroup>
10139N/A</informaltable>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFWriteScanline-3tiff-also"><title>&also-tt;</title>
10139N/A<!--Reference to another man page-->
10139N/A<!--Reference to a Help manual-->
10139N/A<!--Reference to a book.-->
10139N/A<para><citerefentry><refentrytitle>libtiff</refentrytitle><manvolnum>3</manvolnum>
10139N/A</citerefentry>, <citerefentry><refentrytitle>TIFFOpen</refentrytitle><manvolnum>
10139N/A3tiff</manvolnum></citerefentry>, <citerefentry><refentrytitle>TIFFWriteEncodedStrip
10139N/A</refentrytitle><manvolnum>3tiff</manvolnum></citerefentry>, <citerefentry>
10139N/A<refentrytitle>TIFFWriteRawStrip</refentrytitle><manvolnum>3tiff</manvolnum>
10139N/A</citerefentry></para>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFWriteScanline-3tiff-note"><title>&note-tt;</title>
10139N/A<para>In C++, the sample parameter defaults to 0.</para>
10139N/A<para>Once data is written to a file for the current directory, the values
10139N/Aof certain tags may not be altered. See <literal>TIFFSetField(3tiff)</literal>
10139N/Afor more information.</para>
10139N/A<para>It is not possible to write scanlines to a file that uses a tiled organization.
10139N/AThe routine <literal>TIFFIsTiled</literal> can be used to determine if the
10139N/Afile is organized as tiles or strips.</para>
10139N/A<para>Writ<?Pub Caret>ing subsampled YCbCR data does not work correctly because:
10139N/A</para>
10139N/A<itemizedlist>
10139N/A<listitem><para>For PlanarConfiguration=2, the size of a scanline is not calculated
10139N/Aon a per-sample basis.</para></listitem>
10139N/A<listitem><para>For PlanarConfiguration=1, the library does not unpack the
10139N/Ablock-interleaved samples.</para></listitem>
10139N/A</itemizedlist>
10139N/A<para>This man page was originally written by Sam Leffler. Updated by Breda
10139N/AMcColgan, Sun Microsystems Inc., 2004.</para>
10139N/A</refsect1>
10139N/A</refentry>
10139N/A<?Pub *0000008302>