kusano 7d535a
.\" $Id: TIFFswab.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
kusano 7d535a
.\"
kusano 7d535a
.\" Copyright (c) 1988-1997 Sam Leffler
kusano 7d535a
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
kusano 7d535a
.\"
kusano 7d535a
.\" Permission to use, copy, modify, distribute, and sell this software and 
kusano 7d535a
.\" its documentation for any purpose is hereby granted without fee, provided
kusano 7d535a
.\" that (i) the above copyright notices and this permission notice appear in
kusano 7d535a
.\" all copies of the software and related documentation, and (ii) the names of
kusano 7d535a
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
kusano 7d535a
.\" publicity relating to the software without the specific, prior written
kusano 7d535a
.\" permission of Sam Leffler and Silicon Graphics.
kusano 7d535a
.\" 
kusano 7d535a
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
kusano 7d535a
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
kusano 7d535a
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
kusano 7d535a
.\" 
kusano 7d535a
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
kusano 7d535a
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
kusano 7d535a
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
kusano 7d535a
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
kusano 7d535a
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
kusano 7d535a
.\" OF THIS SOFTWARE.
kusano 7d535a
.\"
kusano 7d535a
.if n .po 0
kusano 7d535a
.TH SWAB 3TIFF "November 04, 2004" "libtiff"
kusano 7d535a
.SH NAME
kusano 7d535a
TIFFGetBitRevTable, TIFFReverseBits, TIFFSwabShort, TIFFSwabLong,
kusano 7d535a
TIFFSwabArrayOfShort, TIFFSwabArrayOfLong \- byte- and bit-swapping routines
kusano 7d535a
.SH SYNOPSIS
kusano 7d535a
.B "#include <tiffio.h>"</tiffio.h>
kusano 7d535a
.sp
kusano 7d535a
.BI "const unsigned char* TIFFGetBitRevTable(int " reversed ")"
kusano 7d535a
.br
kusano 7d535a
.BI "void TIFFReverseBits(u_char *" data ", unsigned long " nbytes ")"
kusano 7d535a
.br
kusano 7d535a
.BI "void TIFFSwabShort(uint16 *" data ")"
kusano 7d535a
.br
kusano 7d535a
.BI "void TIFFSwabLong(uint32 *" data ")"
kusano 7d535a
.br
kusano 7d535a
.BI "void TIFFSwabArrayOfShort(uint16 *" data ", unsigned long " nshorts ")"
kusano 7d535a
.br
kusano 7d535a
.BI "void TIFFSwabArrayOfLong(uint32 *" data ", unsigned long " nlongs ")"
kusano 7d535a
.SH DESCRIPTION
kusano 7d535a
The following routines are used by the library to swap
kusano 7d535a
16- and 32-bit data and to reverse the order of bits in bytes.
kusano 7d535a
.PP
kusano 7d535a
.IR TIFFSwabShort
kusano 7d535a
and
kusano 7d535a
.IR TIFFSwabLong
kusano 7d535a
swap the bytes in a single 16-bit and 32-bit item, respectively.
kusano 7d535a
.IR TIFFSwabArrayOfShort
kusano 7d535a
and
kusano 7d535a
.IR TIFFSwabArrayOfLong
kusano 7d535a
swap the bytes in an array of 16-bit and 32-bit items, respectively.
kusano 7d535a
.PP
kusano 7d535a
.IR TIFFReverseBits
kusano 7d535a
replaces each byte in
kusano 7d535a
.I data
kusano 7d535a
with the equivalent bit-reversed value. This operation is performed with a
kusano 7d535a
lookup table, which is returned using the
kusano 7d535a
.IR TIFFGetBitRevTable
kusano 7d535a
function.
kusano 7d535a
.I reversed
kusano 7d535a
parameter specifies which table should be returned. Supply
kusano 7d535a
.I 1
kusano 7d535a
if you want bit reversal table. Supply
kusano 7d535a
.I 0
kusano 7d535a
to get the table that do not reverse bit values. It is a lookup table that can
kusano 7d535a
be used as an
kusano 7d535a
.IR "identity function" ;
kusano 7d535a
i.e.
kusano 7d535a
.IR "TIFFNoBitRevTable[n] == n" .
kusano 7d535a
.SH DIAGNOSTICS
kusano 7d535a
None.
kusano 7d535a
.SH "SEE ALSO"
kusano 7d535a
.BR libtiff (3TIFF)
kusano 7d535a
.PP
kusano 7d535a
Libtiff library home page:
kusano 7d535a
.BR http://www.remotesensing.org/libtiff/