1 <!-- Creator : groff version 1.18.1 -->
2 <!-- CreationDate: Sat Feb 24 18:37:20 2007 -->
5 <meta name=
"generator" content=
"groff -Thtml, see www.gnu.org">
6 <meta name=
"Content-Style" content=
"text/css">
11 <h1 align=center
>INTRO
</h1>
12 <a href=
"#NAME">NAME
</a><br>
13 <a href=
"#SYNOPSIS">SYNOPSIS
</a><br>
14 <a href=
"#DESCRIPTION">DESCRIPTION
</a><br>
15 <a href=
"#DATA TYPES">DATA TYPES
</a><br>
16 <a href=
"#LIST OF ROUTINES">LIST OF ROUTINES
</a><br>
17 <a href=
"#TAG USAGE">TAG USAGE
</a><br>
18 <a href=
"#PSEUDO TAGS">PSEUDO TAGS
</a><br>
19 <a href=
"#DIAGNOSTICS">DIAGNOSTICS
</a><br>
20 <a href=
"#SEE ALSO">SEE ALSO
</a><br>
21 <a href=
"#BUGS">BUGS
</a><br>
27 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
28 cols=
"2" cellspacing=
"0" cellpadding=
"0">
29 <tr valign=
"top" align=
"left">
32 <p><big>libtiff
− introduction to
<i>libtiff
</i>, a
33 library for reading and writing
</big> TIFF
37 <a name=
"SYNOPSIS"></a>
40 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
41 cols=
"2" cellspacing=
"0" cellpadding=
"0">
42 <tr valign=
"top" align=
"left">
45 <p><big><b>#include
<tiffio.h
></b></big></p>
47 <p><big>cc file.c
<b>-ltiff
</b></big></p>
50 <a name=
"DESCRIPTION"></a>
53 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
54 cols=
"2" cellspacing=
"0" cellpadding=
"0">
55 <tr valign=
"top" align=
"left">
58 <p><big><i>libtiff
</i> is a library for reading and writing
59 data files encoded with the
<i>Tag Image File
</i> format,
60 Revision
6.0 (or revision
5.0 or revision
4.0). This file
61 format is suitable for archiving multi-color and
62 monochromatic image data.
</big></p>
64 <p><big>The library supports several compression algorithms,
65 as indicated by the
<i>Compression
</i> field, including: no
66 compression (
1),
</big> CCITT
<big>1D Huffman compression
67 (
2),
</big> CCITT
<big>Group
3 Facsimile compression
68 (
3),
</big> CCITT
<big>Group
4 Facsimile compression (
4),
69 Lempel-Ziv
& Welch compression (
5), baseline JPEG
70 compression (
7), word-aligned
1D Huffman compression
71 (
32771), and PackBits compression (
32773). In addition,
72 several nonstandard compression algorithms are supported:
73 the
4-bit compression algorithm used by the
74 <i>ThunderScan
</i> program (
32809) (decompression only),
75 NeXT
’s
2-bit compression algorithm (
32766)
76 (decompression only), an experimental LZ-style algorithm
77 known as Deflate (
32946), and an experimental CIE LogLuv
78 compression scheme designed for images with high dynamic
79 range (
32845 for LogL and
32845 for LogLuv). Directory
80 information may be in either little- or big-endian byte
81 order
−byte swapping is automatically done by the
82 library. Data bit ordering may be either Most Significant
83 Bit (
</big> MSB
<big>) to Least Significant Bit (
</big> LSB
84 <big>) or
</big> LSB
<big>to
</big> MSB.
<big>Finally, the
85 library does not support files in which the
86 <i>BitsPerSample
</i>,
<i>Compression
</i>,
87 <i>MinSampleValue
</i>, or
<i>MaxSampleValue
</i> fields are
88 defined differently on a per-sample basis (in Rev.
6.0 the
89 <i>Compression
</i> tag is not defined on a per-sample basis,
90 so this is immaterial).
</big></p>
93 <a name=
"DATA TYPES"></a>
96 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
97 cols=
"2" cellspacing=
"0" cellpadding=
"0">
98 <tr valign=
"top" align=
"left">
101 <p><big>The library makes extensive use of C typedefs to
102 promote portability. Two sets of typedefs are used, one for
103 communication with clients of the library and one for
104 internal data structures and parsing of the
</big> TIFF
105 <big>format. The following typedefs are exposed to users
106 either through function definitions or through parameters
107 passed through the varargs interfaces.
</big></p></td>
110 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
111 cols=
"3" cellspacing=
"0" cellpadding=
"0">
112 <tr valign=
"top" align=
"left">
113 <td width=
"15%"></td>
116 <p><big>typedef unsigned short uint16;
</big></p>
120 <p><big>16-bit unsigned integer
</big></p>
122 <tr valign=
"top" align=
"left">
123 <td width=
"15%"></td>
126 <p><big>typedef unsigned
<<i>thing
</i>>
131 <p><big>32-bit unsigned integer
</big></p>
133 <tr valign=
"top" align=
"left">
134 <td width=
"15%"></td>
137 <p><big>typedef unsigned int ttag_t;
</big></p>
141 <p><big>directory tag
</big></p>
143 <tr valign=
"top" align=
"left">
144 <td width=
"15%"></td>
147 <p><big>typedef uint16 tdir_t;
</big></p>
151 <p><big>directory index
</big></p>
153 <tr valign=
"top" align=
"left">
154 <td width=
"15%"></td>
157 <p><big>typedef uint16 tsample_t;
</big></p>
161 <p><big>sample number
</big></p>
163 <tr valign=
"top" align=
"left">
164 <td width=
"15%"></td>
167 <p><big>typedef uint32 tstrip_t;
</big></p>
171 <p><big>strip number
</big></p>
173 <tr valign=
"top" align=
"left">
174 <td width=
"15%"></td>
177 <p><big>typedef uint32 ttile_t;
</big></p>
181 <p><big>tile number
</big></p>
183 <tr valign=
"top" align=
"left">
184 <td width=
"15%"></td>
187 <p><big>typedef int32 tsize_t;
</big></p>
191 <p><big>i/o size in bytes
</big></p>
193 <tr valign=
"top" align=
"left">
194 <td width=
"15%"></td>
197 <p><big>typedef void* tdata_t;
</big></p>
201 <p><big>image data ref
</big></p>
203 <tr valign=
"top" align=
"left">
204 <td width=
"15%"></td>
207 <p><big>typedef void* thandle_t;
</big></p>
211 <p><big>client data handle
</big></p>
213 <tr valign=
"top" align=
"left">
214 <td width=
"15%"></td>
217 <p><big>typedef int32 toff_t;
</big></p>
221 <p><big>file offset
</big></p>
225 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
226 cols=
"2" cellspacing=
"0" cellpadding=
"0">
227 <tr valign=
"top" align=
"left">
230 <p><big>Note that
<i>tstrip_t
</i>,
<i>ttile_t
</i>, and
231 <i>tsize_t
</i> are constrained to be no more than
32-bit
232 quantities by
32-bit fields they are stored in in the
</big>
233 TIFF
<big>image. Likewise
<i>tsample_t
</i> is limited by the
234 16-bit field used to store the
<i>SamplesPerPixel
</i> tag.
235 <i>tdir_t
</i> constrains the maximum number of
</big> IFDs
236 <big>that may appear in an image and may be an arbitrary
237 size (w/o penalty).
<i>ttag_t
</i> must be either int,
238 unsigned int, pointer, or double because the library uses a
239 varargs interface and
</big> ANSI C
<big>restricts the type
240 of the parameter before an ellipsis to be a promoted type.
241 <i>toff_t
</i> is defined as int32 because TIFF file offsets
242 are (unsigned)
32-bit quantities. A signed value is used
243 because some interfaces return
−1 on error. Finally,
244 note that user-specified data references are passed as
245 opaque handles and only cast at the lowest layers where
246 their type is presumed.
</big></p>
249 <a name=
"LIST OF ROUTINES"></a>
250 <h2>LIST OF ROUTINES
</h2>
252 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
253 cols=
"2" cellspacing=
"0" cellpadding=
"0">
254 <tr valign=
"top" align=
"left">
257 <p><big>The following routines are part of the library.
258 Consult specific manual pages for details on their
259 operation; on most systems doing
‘‘man
260 function-name
’’ will work.
</big></p></td>
264 <p><big><i>Name Description
</i></big></p>
266 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
267 cols=
"3" cellspacing=
"0" cellpadding=
"0">
268 <tr valign=
"top" align=
"left">
272 <p><big>TIFFCheckpointDirectory
</big></p>
276 <p><big>writes the current state of the directory
</big></p>
278 <tr valign=
"top" align=
"left">
282 <p><big>TIFFCheckTile
</big></p>
286 <p><big>very x,y,z,sample is within image
</big></p>
288 <tr valign=
"top" align=
"left">
292 <p><big>TIFFCIELabToRGBInit
</big></p>
296 <p><big>initialize CIE L*a*b*
1976 to RGB conversion
299 <tr valign=
"top" align=
"left">
303 <p><big>TIFFCIELabToXYZ
</big></p>
307 <p><big>perform CIE L*a*b*
1976 to CIE XYZ
310 <tr valign=
"top" align=
"left">
314 <p><big>TIFFClientOpen
</big></p>
318 <p><big>open a file for reading or writing
</big></p>
320 <tr valign=
"top" align=
"left">
324 <p><big>TIFFClose
</big></p>
328 <p><big>close an open file
</big></p>
330 <tr valign=
"top" align=
"left">
334 <p><big>TIFFComputeStrip
</big></p>
338 <p><big>return strip containing y,sample
</big></p>
340 <tr valign=
"top" align=
"left">
344 <p><big>TIFFComputeTile
</big></p>
348 <p><big>return tile containing x,y,z,sample
</big></p>
350 <tr valign=
"top" align=
"left">
354 <p><big>TIFFCurrentDirectory
</big></p>
358 <p><big>return index of current directory
</big></p>
360 <tr valign=
"top" align=
"left">
364 <p><big>TIFFCurrentRow
</big></p>
368 <p><big>return index of current scanline
</big></p>
370 <tr valign=
"top" align=
"left">
374 <p><big>TIFFCurrentStrip
</big></p>
378 <p><big>return index of current strip
</big></p>
380 <tr valign=
"top" align=
"left">
384 <p><big>TIFFCurrentTile
</big></p>
388 <p><big>return index of current tile
</big></p>
390 <tr valign=
"top" align=
"left">
394 <p><big>TIFFDataWidth
</big></p>
398 <p><big>return the size of TIFF data types
</big></p>
400 <tr valign=
"top" align=
"left">
404 <p><big>TIFFError
</big></p>
408 <p><big>library error handler
</big></p>
410 <tr valign=
"top" align=
"left">
414 <p><big>TIFFFdOpen
</big></p>
418 <p><big>open a file for reading or writing
</big></p>
420 <tr valign=
"top" align=
"left">
424 <p><big>TIFFFileName
</big></p>
428 <p><big>return name of open file
</big></p>
430 <tr valign=
"top" align=
"left">
434 <p><big>TIFFFileno
</big></p>
438 <p><big>return open file descriptor
</big></p>
440 <tr valign=
"top" align=
"left">
444 <p><big>TIFFFindCODEC
</big></p>
448 <p><big>find standard codec for the specific
451 <tr valign=
"top" align=
"left">
455 <p><big>TIFFFlush
</big></p>
459 <p><big>flush all pending writes
</big></p>
461 <tr valign=
"top" align=
"left">
465 <p><big>TIFFFlushData
</big></p>
469 <p><big>flush pending data writes
</big></p>
471 <tr valign=
"top" align=
"left">
475 <p><big>TIFFGetBitRevTable
</big></p>
479 <p><big>return bit reversal table
</big></p>
481 <tr valign=
"top" align=
"left">
485 <p><big>TIFFGetField
</big></p>
489 <p><big>return tag value in current directory
</big></p>
491 <tr valign=
"top" align=
"left">
495 <p><big>TIFFGetFieldDefaulted
</big></p>
499 <p><big>return tag value in current directory
</big></p>
501 <tr valign=
"top" align=
"left">
505 <p><big>TIFFGetMode
</big></p>
509 <p><big>return open file mode
</big></p>
511 <tr valign=
"top" align=
"left">
515 <p><big>TIFFGetVersion
</big></p>
519 <p><big>return library version string
</big></p>
521 <tr valign=
"top" align=
"left">
525 <p><big>TIFFIsCODECConfigured
</big></p>
529 <p><big>check, whether we have working codec
</big></p>
531 <tr valign=
"top" align=
"left">
535 <p><big>TIFFIsMSB2LSB
</big></p>
539 <p><big>return true if image data is being
542 <tr valign=
"top" align=
"left">
544 <td width=
"23%"></td>
547 <p><big>with bit
0 as the most significant bit
</big></p>
549 <tr valign=
"top" align=
"left">
553 <p><big>TIFFIsTiled
</big></p>
557 <p><big>return true if image data is tiled
</big></p>
559 <tr valign=
"top" align=
"left">
563 <p><big>TIFFIsByteSwapped
</big></p>
567 <p><big>return true if image data is byte-swapped
</big></p>
569 <tr valign=
"top" align=
"left">
573 <p><big>TIFFNumberOfStrips
</big></p>
577 <p><big>return number of strips in an image
</big></p>
579 <tr valign=
"top" align=
"left">
583 <p><big>TIFFNumberOfTiles
</big></p>
587 <p><big>return number of tiles in an image
</big></p>
589 <tr valign=
"top" align=
"left">
593 <p><big>TIFFOpen
</big></p>
597 <p><big>open a file for reading or writing
</big></p>
599 <tr valign=
"top" align=
"left">
603 <p><big>TIFFPrintDirectory
</big></p>
607 <p><big>print description of the current
610 <tr valign=
"top" align=
"left">
614 <p><big>TIFFReadBufferSetup
</big></p>
618 <p><big>specify i/o buffer for reading
</big></p>
620 <tr valign=
"top" align=
"left">
624 <p><big>TIFFReadDirectory
</big></p>
628 <p><big>read the next directory
</big></p>
630 <tr valign=
"top" align=
"left">
634 <p><big>TIFFReadEncodedStrip
</big></p>
638 <p><big>read and decode a strip of data
</big></p>
640 <tr valign=
"top" align=
"left">
644 <p><big>TIFFReadEncodedTile
</big></p>
648 <p><big>read and decode a tile of data
</big></p>
650 <tr valign=
"top" align=
"left">
654 <p><big>TIFFReadRawStrip
</big></p>
658 <p><big>read a raw strip of data
</big></p>
660 <tr valign=
"top" align=
"left">
664 <p><big>TIFFReadRawTile
</big></p>
668 <p><big>read a raw tile of data
</big></p>
670 <tr valign=
"top" align=
"left">
674 <p><big>TIFFReadRGBAImage
</big></p>
678 <p><big>read an image into a fixed format raster
</big></p>
680 <tr valign=
"top" align=
"left">
684 <p><big>TIFFReadScanline
</big></p>
688 <p><big>read and decode a row of data
</big></p>
690 <tr valign=
"top" align=
"left">
694 <p><big>TIFFReadTile
</big></p>
698 <p><big>read and decode a tile of data
</big></p>
700 <tr valign=
"top" align=
"left">
704 <p><big>TIFFRegisterCODEC
</big></p>
708 <p><big>override standard codec for the specific
711 <tr valign=
"top" align=
"left">
715 <p><big>TIFFReverseBits
</big></p>
719 <p><big>reverse bits in an array of bytes
</big></p>
721 <tr valign=
"top" align=
"left">
725 <p><big>TIFFRGBAImageBegin
</big></p>
729 <p><big>setup decoder state for TIFFRGBAImageGet
</big></p>
731 <tr valign=
"top" align=
"left">
735 <p><big>TIFFRGBAImageEnd
</big></p>
739 <p><big>release TIFFRGBAImage decoder state
</big></p>
741 <tr valign=
"top" align=
"left">
745 <p><big>TIFFRGBAImageGet
</big></p>
749 <p><big>read and decode an image
</big></p>
751 <tr valign=
"top" align=
"left">
755 <p><big>TIFFRGBAImageOK
</big></p>
759 <p><big>is image readable by TIFFRGBAImageGet
</big></p>
761 <tr valign=
"top" align=
"left">
765 <p><big>TIFFScanlineSize
</big></p>
769 <p><big>return size of a scanline
</big></p>
771 <tr valign=
"top" align=
"left">
775 <p><big>TIFFSetDirectory
</big></p>
779 <p><big>set the current directory
</big></p>
781 <tr valign=
"top" align=
"left">
785 <p><big>TIFFSetSubDirectory
</big></p>
789 <p><big>set the current directory
</big></p>
791 <tr valign=
"top" align=
"left">
795 <p><big>TIFFSetErrorHandler
</big></p>
799 <p><big>set error handler function
</big></p>
801 <tr valign=
"top" align=
"left">
805 <p><big>TIFFSetField
</big></p>
809 <p><big>set a tag
’s value in the current
812 <tr valign=
"top" align=
"left">
816 <p><big>TIFFSetWarningHandler
</big></p>
820 <p><big>set warning handler function
</big></p>
822 <tr valign=
"top" align=
"left">
826 <p><big>TIFFStripSize
</big></p>
830 <p><big>returns size of a strip
</big></p>
832 <tr valign=
"top" align=
"left">
836 <p><big>TIFFRawStripSize
</big></p>
840 <p><big>returns the number of bytes in a raw
843 <tr valign=
"top" align=
"left">
847 <p><big>TIFFSwabShort
</big></p>
851 <p><big>swap bytes of short
</big></p>
853 <tr valign=
"top" align=
"left">
857 <p><big>TIFFSwabLong
</big></p>
861 <p><big>swap bytes of long
</big></p>
863 <tr valign=
"top" align=
"left">
867 <p><big>TIFFSwabArrayOfShort
</big></p>
871 <p><big>swap bytes of an array of shorts
</big></p>
873 <tr valign=
"top" align=
"left">
877 <p><big>TIFFSwabArrayOfLong
</big></p>
881 <p><big>swap bytes of an array of longs
</big></p>
883 <tr valign=
"top" align=
"left">
887 <p><big>TIFFTileRowSize
</big></p>
891 <p><big>return size of a row in a tile
</big></p>
893 <tr valign=
"top" align=
"left">
897 <p><big>TIFFTileSize
</big></p>
901 <p><big>return size of a tile
</big></p>
903 <tr valign=
"top" align=
"left">
907 <p><big>TIFFUnRegisterCODEC
</big></p>
911 <p><big>unregisters the codec
</big></p>
913 <tr valign=
"top" align=
"left">
917 <p><big>TIFFVGetField
</big></p>
921 <p><big>return tag value in current directory
</big></p>
923 <tr valign=
"top" align=
"left">
927 <p><big>TIFFVGetFieldDefaulted
</big></p>
931 <p><big>return tag value in current directory
</big></p>
933 <tr valign=
"top" align=
"left">
937 <p><big>TIFFVSetField
</big></p>
941 <p><big>set a tag
’s value in the current
944 <tr valign=
"top" align=
"left">
948 <p><big>TIFFVStripSize
</big></p>
952 <p><big>returns the number of bytes in a strip
</big></p>
954 <tr valign=
"top" align=
"left">
958 <p><big>TIFFWarning
</big></p>
962 <p><big>library warning handler
</big></p>
964 <tr valign=
"top" align=
"left">
968 <p><big>TIFFWriteDirectory
</big></p>
972 <p><big>write the current directory
</big></p>
974 <tr valign=
"top" align=
"left">
978 <p><big>TIFFWriteEncodedStrip
</big></p>
982 <p><big>compress and write a strip of data
</big></p>
984 <tr valign=
"top" align=
"left">
988 <p><big>TIFFWriteEncodedTile
</big></p>
992 <p><big>compress and write a tile of data
</big></p>
994 <tr valign=
"top" align=
"left">
998 <p><big>TIFFWriteRawStrip
</big></p>
1002 <p><big>write a raw strip of data
</big></p>
1004 <tr valign=
"top" align=
"left">
1005 <td width=
"8%"></td>
1008 <p><big>TIFFWriteRawTile
</big></p>
1012 <p><big>write a raw tile of data
</big></p>
1014 <tr valign=
"top" align=
"left">
1015 <td width=
"8%"></td>
1018 <p><big>TIFFWriteScanline
</big></p>
1022 <p><big>write a scanline of data
</big></p>
1024 <tr valign=
"top" align=
"left">
1025 <td width=
"8%"></td>
1028 <p><big>TIFFWriteTile
</big></p>
1032 <p><big>compress and write a tile of data
</big></p>
1034 <tr valign=
"top" align=
"left">
1035 <td width=
"8%"></td>
1038 <p><big>TIFFXYZToRGB
</big></p>
1042 <p><big>perform CIE XYZ to RGB conversion
</big></p>
1044 <tr valign=
"top" align=
"left">
1045 <td width=
"8%"></td>
1048 <p><big>TIFFYCbCrToRGBInit
</big></p>
1052 <p><big>initialize YCbCr to RGB conversion state
</big></p>
1054 <tr valign=
"top" align=
"left">
1055 <td width=
"8%"></td>
1058 <p><big>TIFFYCbCrtoRGB
</big></p>
1062 <p><big>perform YCbCr to RGB conversion
</big></p>
1065 <!-- INDENTATION -->
1066 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1067 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1068 <tr valign=
"top" align=
"left">
1069 <td width=
"8%"></td>
1071 <p><big>Auxiliary functions:
</big></p></td>
1074 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1075 cols=
"3" cellspacing=
"0" cellpadding=
"0">
1076 <tr valign=
"top" align=
"left">
1077 <td width=
"8%"></td>
1080 <p><big>_TIFFfree
</big></p>
1084 <p><big>free memory buffer
</big></p>
1086 <tr valign=
"top" align=
"left">
1087 <td width=
"8%"></td>
1090 <p><big>_TIFFmalloc
</big></p>
1094 <p><big>dynamically allocate memory buffer
</big></p>
1096 <tr valign=
"top" align=
"left">
1097 <td width=
"8%"></td>
1100 <p><big>_TIFFmemcmp
</big></p>
1104 <p><big>compare contents of the memory buffers
</big></p>
1106 <tr valign=
"top" align=
"left">
1107 <td width=
"8%"></td>
1110 <p><big>_TIFFmemcpy
</big></p>
1114 <p><big>copy contents of the one buffer to
1117 <tr valign=
"top" align=
"left">
1118 <td width=
"8%"></td>
1121 <p><big>_TIFFmemset
</big></p>
1125 <p><big>fill memory buffer with a constant byte
</big></p>
1127 <tr valign=
"top" align=
"left">
1128 <td width=
"8%"></td>
1131 <p><big>_TIFFrealloc
</big></p>
1135 <p><big>dynamically reallocate memory buffer
</big></p>
1138 <a name=
"TAG USAGE"></a>
1140 <!-- INDENTATION -->
1141 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1142 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1143 <tr valign=
"top" align=
"left">
1144 <td width=
"8%"></td>
1146 <p><big>The table below lists the
</big> TIFF
<big>tags that
1147 are recognized and handled by the library. If no use is
1148 indicated in the table, then the library reads and writes
1149 the tag, but does not use it internally. Note that some tags
1150 are meaningful only when a particul