<!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 synp-tt "SYNOPSIS">
<!ENTITY cmd "TIFFswab">
<!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="TIFFswab-3tiff">
<!-- %Z%%M% %I% %E% SMI; -->
<refmeta><refentrytitle>TIFFswab</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>TIFFswab</primary></indexterm><indexterm><primary>byte-
and bit-swapping routines</primary></indexterm>
<refnamediv id="TIFFswab-3tiff-name"><refdescriptor>TIFFswab</refdescriptor>
<refname>TIFFGetBitRevTable<?Pub Caret></refname><refname>TIFFReverseBits
</refname><refname>TIFFSwabShort</refname><refname>TIFFSwabLong</refname>
<refname>TIFFSwabArrayOfShort</refname><refname>TIFFSwabArrayOfLong</refname>
<refpurpose>byte- and bit-swapping routines</refpurpose></refnamediv>
<refsect1 id="TIFFswab-3tiff-synp"><title>&synp-tt;</title>
<programlisting>#include &lt;tiffio.h>
const unsigned char* TIFFGetBitRevTable(int reversed);
void TIFFReverseBits(u_char* data, unsigned long nbytes)
void TIFFSwabShort(uint16* data)
void TIFFSwabLong(uint32* data)
void TIFFSwabArrayOfShort(uint16* data, unsigned long nshorts)
void TIFFSwabArrayOfLong(uint32* data, unsigned long nlongs)
</programlisting>
</refsect1>
<refsect1 id="TIFFswab-3tiff-desc"><title>&desc-tt;</title>
<para>The following routines are used by the library to swap 16- and 32-bit
data and to reverse the order of bits in bytes.</para>
<para><literal>TIFFSwabShort</literal> and <literal>TIFFSwabLong</literal>
swap the bytes in a single 16-bit and 32-bit item, respectively.</para>
<para><literal>TIFFSwabArrayOfShort</literal> and <literal>TIFFSwabArrayOfLong
</literal> swap the bytes in an array of 16-bit and 32-bit items, respectively.
</para>
<para><literal>TIFFReverseBits</literal> replaces each byte in data with the
equivalent bit-reversed value. This operation is done with a lookup table, <literal>
TIFFBitRevTable</literal>, which is declared public. A second table, <literal>
TIFFNoBitRevTable</literal>, is also declared public, and is a lookup table
that can be used as an identity function. That is, <literal>TIFFNoBitRevTable[n]
== n</literal>.</para>
</refsect1>
<refsect1 id="TIFFswab-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="TIFFswab-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></para>
</refsect1>
<refsect1 id="TIFFswab-3tiff-note"><title>&note-tt;</title>
<para>This man page was originally written by Sam Leffler. Updated by Breda
McColgan, Sun Microsystems Inc., 2004.</para>
</refsect1>
</refentry>
<?Pub *0000004161>