]> git.saurik.com Git - wxWidgets.git/blame - src/tiff/man/libtiff.3tiff
Add virtual ~wxAnyScrollHelperBase() to fix compiler warning.
[wxWidgets.git] / src / tiff / man / libtiff.3tiff
CommitLineData
8414a40c
VZ
1.\"
2.\" Copyright (c) 1988-1997 Sam Leffler
3.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
4.\"
5.\" Permission to use, copy, modify, distribute, and sell this software and
6.\" its documentation for any purpose is hereby granted without fee, provided
7.\" that (i) the above copyright notices and this permission notice appear in
8.\" all copies of the software and related documentation, and (ii) the names of
9.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
10.\" publicity relating to the software without the specific, prior written
11.\" permission of Sam Leffler and Silicon Graphics.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16.\"
17.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22.\" OF THIS SOFTWARE.
23.\"
24.if n .po 0
25.TH INTRO 3TIFF "November 2, 2005" "libtiff"
26.SH NAME
27libtiff \- introduction to
28.IR libtiff ,
29a library for reading and writing
30.SM TIFF
31files
32.SH SYNOPSIS
33.B "#include <tiffio.h>"
34.sp
35cc file.c
36.B -ltiff
37.SH DESCRIPTION
38.I libtiff
39is a library for reading and writing data files encoded with the
40.I "Tag Image File"
41format, Revision 6.0 (or revision 5.0 or revision 4.0). This file format is
42suitable for archiving multi-color and monochromatic image data.
43.PP
44The library supports several compression algorithms, as indicated by the
45.I Compression
46field, including:
47no compression (1),
48.SM CCITT
491D Huffman compression (2),
50.SM CCITT
51Group 3 Facsimile compression (3),
52.SM CCITT
53Group 4 Facsimile compression (4),
54Lempel-Ziv & Welch compression (5),
55baseline JPEG compression (7),
56word-aligned 1D Huffman compression (32771),
57and
58PackBits compression (32773).
59In addition, several nonstandard compression algorithms are supported: the
604-bit compression algorithm used by the
61.I ThunderScan
62program (32809) (decompression only), NeXT's 2-bit compression algorithm
63(32766) (decompression only), an experimental LZ-style algorithm known as
64Deflate (32946), and an experimental CIE LogLuv compression scheme designed
65for images with high dynamic range (32845 for LogL and 32845 for LogLuv).
66Directory information may be in either little- or big-endian byte order\-byte
67swapping is automatically done by the library. Data bit ordering may be either
68Most Significant Bit (\c
69.SM MSB\c
70) to Least Significant Bit (\c
71.SM LSB\c
72) or
73.SM LSB
74to
75.SM MSB.
76Finally, the library does not support files in which the
77.IR BitsPerSample ,
78.IR Compression ,
79.IR MinSampleValue ,
80or
81.IR MaxSampleValue
82fields are defined differently on a per-sample basis
83(in Rev. 6.0 the
84.I Compression
85tag is not defined on a per-sample basis, so this is immaterial).
86.SH "DATA TYPES"
87The library makes extensive use of C typedefs to promote portability.
88Two sets of typedefs are used, one for communication with clients
89of the library and one for internal data structures and parsing of the
90.SM TIFF
91format.
92The following typedefs are exposed to users either through function
93definitions or through parameters passed through the varargs interfaces.
94.in +.5i
95.sp 5p
96.ta +\w'typedef unsigned <\fIthing\fP> uint32; 'u
97.nf
98typedef unsigned short uint16; 16-bit unsigned integer
99typedef unsigned <\fIthing\fP> uint32; 32-bit unsigned integer
100.sp 5p
101typedef unsigned int ttag_t; directory tag
102typedef uint16 tdir_t; directory index
103typedef uint16 tsample_t; sample number
104typedef uint32 tstrip_t; strip number
105typedef uint32 ttile_t; tile number
106typedef int32 tsize_t; i/o size in bytes
107typedef void* tdata_t; image data ref
108typedef void* thandle_t; client data handle
109typedef int32 toff_t; file offset
110.fi
111.sp 5p
112.in -.5i
113Note that
114.IR tstrip_t ,
115.IR ttile_t ,
116and
117.I tsize_t
118are constrained to be no more than 32-bit quantities by 32-bit fields they are
119stored in in the
120.SM TIFF
121image.
122Likewise
123.I tsample_t
124is limited by the 16-bit field used to store the
125.I SamplesPerPixel
126tag.
127.I tdir_t
128constrains the maximum number of
129.SM IFDs
130that may appear in an image and may be an arbitrary size (w/o penalty).
131.I ttag_t
132must be either int, unsigned int, pointer, or double because the library uses
133a varargs interface and
134.SM "ANSI C"
135restricts the type of the parameter before an ellipsis to be a promoted type.
136.I toff_t
137is defined as int32 because TIFF file offsets are (unsigned) 32-bit
138quantities. A signed value is used because some interfaces return \-1 on
139error. Finally, note that user-specified data references are passed as opaque
140handles and only cast at the lowest layers where their type is presumed.
141.SH "LIST OF ROUTINES"
142The following routines are part of the library. Consult specific manual pages
143for details on their operation; on most systems doing ``man function-name''
144will work.
145.sp
146.nf
147.ta \w'TIFFCheckpointDirectory'u+2n
148\fIName\fP \fIDescription\fP
149.sp 5p
150TIFFCheckpointDirectory writes the current state of the directory
151TIFFCheckTile very x,y,z,sample is within image
152TIFFCIELabToRGBInit initialize CIE L*a*b* 1976 to RGB conversion state
153TIFFCIELabToXYZ perform CIE L*a*b* 1976 to CIE XYZ conversion
154TIFFClientOpen open a file for reading or writing
155TIFFClose close an open file
156TIFFComputeStrip return strip containing y,sample
157TIFFComputeTile return tile containing x,y,z,sample
158TIFFCurrentDirectory return index of current directory
159TIFFCurrentRow return index of current scanline
160TIFFCurrentStrip return index of current strip
161TIFFCurrentTile return index of current tile
162TIFFDataWidth return the size of TIFF data types
163TIFFError library error handler
164TIFFFdOpen open a file for reading or writing
80ed523f
VZ
165TIFFFieldDataType get data type from field information
166TIFFFieldName get field name from field information
167TIFFFieldPassCount get whether to pass a value count to Get/SetField
168TIFFFieldReadCount get number of values to be read from field
169TIFFFieldTag get tag value from field information
170TIFFFieldWithName get field information given field name
171TIFFFieldWithTag get field information given tag
172TIFFFieldWriteCount get number of values to be written to field
8414a40c
VZ
173TIFFFileName return name of open file
174TIFFFileno return open file descriptor
175TIFFFindCODEC find standard codec for the specific scheme
80ed523f 176TIFFFindField get field information given tag and data type
8414a40c
VZ
177TIFFFlush flush all pending writes
178TIFFFlushData flush pending data writes
179TIFFGetBitRevTable return bit reversal table
180TIFFGetField return tag value in current directory
181TIFFGetFieldDefaulted return tag value in current directory
182TIFFGetMode return open file mode
183TIFFGetVersion return library version string
184TIFFIsCODECConfigured check, whether we have working codec
185TIFFIsMSB2LSB return true if image data is being returned
186 with bit 0 as the most significant bit
187TIFFIsTiled return true if image data is tiled
188TIFFIsByteSwapped return true if image data is byte-swapped
189TIFFNumberOfStrips return number of strips in an image
190TIFFNumberOfTiles return number of tiles in an image
191TIFFOpen open a file for reading or writing
192TIFFPrintDirectory print description of the current directory
193TIFFReadBufferSetup specify i/o buffer for reading
194TIFFReadDirectory read the next directory
195TIFFReadEncodedStrip read and decode a strip of data
196TIFFReadEncodedTile read and decode a tile of data
197TIFFReadRawStrip read a raw strip of data
198TIFFReadRawTile read a raw tile of data
199TIFFReadRGBAImage read an image into a fixed format raster
200TIFFReadScanline read and decode a row of data
201TIFFReadTile read and decode a tile of data
202TIFFRegisterCODEC override standard codec for the specific scheme
203TIFFReverseBits reverse bits in an array of bytes
204TIFFRGBAImageBegin setup decoder state for TIFFRGBAImageGet
205TIFFRGBAImageEnd release TIFFRGBAImage decoder state
206TIFFRGBAImageGet read and decode an image
207TIFFRGBAImageOK is image readable by TIFFRGBAImageGet
208TIFFScanlineSize return size of a scanline
209TIFFSetDirectory set the current directory
210TIFFSetSubDirectory set the current directory
211TIFFSetErrorHandler set error handler function
212TIFFSetField set a tag's value in the current directory
213TIFFSetWarningHandler set warning handler function
214TIFFStripSize returns size of a strip
215TIFFRawStripSize returns the number of bytes in a raw strip
216TIFFSwabShort swap bytes of short
217TIFFSwabLong swap bytes of long
218TIFFSwabArrayOfShort swap bytes of an array of shorts
219TIFFSwabArrayOfLong swap bytes of an array of longs
220TIFFTileRowSize return size of a row in a tile
221TIFFTileSize return size of a tile
222TIFFUnRegisterCODEC unregisters the codec
223TIFFVGetField return tag value in current directory
224TIFFVGetFieldDefaulted return tag value in current directory
225TIFFVSetField set a tag's value in the current directory
226TIFFVStripSize returns the number of bytes in a strip
227TIFFWarning library warning handler
228TIFFWriteDirectory write the current directory
229TIFFWriteEncodedStrip compress and write a strip of data
230TIFFWriteEncodedTile compress and write a tile of data
231TIFFWriteRawStrip write a raw strip of data
232TIFFWriteRawTile write a raw tile of data
233TIFFWriteScanline write a scanline of data
234TIFFWriteTile compress and write a tile of data
235TIFFXYZToRGB perform CIE XYZ to RGB conversion
236TIFFYCbCrToRGBInit initialize YCbCr to RGB conversion state
237TIFFYCbCrtoRGB perform YCbCr to RGB conversion
238.sp
239Auxiliary functions:
240_TIFFfree free memory buffer
241_TIFFmalloc dynamically allocate memory buffer
242_TIFFmemcmp compare contents of the memory buffers
243_TIFFmemcpy copy contents of the one buffer to another
244_TIFFmemset fill memory buffer with a constant byte
245_TIFFrealloc dynamically reallocate memory buffer
246
247.fi
248.SH "TAG USAGE"
249The table below lists the
250.SM TIFF
251tags that are recognized and handled by the library.
252If no use is indicated in the table, then the library
253reads and writes the tag, but does not use it internally.
254Note that some tags are meaningful only when a particular
255compression scheme is being used; e.g.
256.I Group3Options
257is only useful if
258.I Compression
259is set to
260.SM CCITT
261Group 3 encoding.
262Tags of this sort are considered
263.I codec-specific
264tags and the library does not recognize them except when the
265.I Compression
266tag has been previously set to the relevant compression scheme.
267.sp
268.nf
269.ta \w'TIFFTAG_JPEGTABLESMODE'u+2n +\w'Value'u+2n +\w'R/W'u+2n
270\fITag Name\fP \fIValue\fP \fIR/W\fP \fILibrary Use/Notes\fP
271.sp 5p
272.nf
273Artist 315 R/W
274BadFaxLines 326 R/W
275BitsPerSample 258 R/W lots
276CellLength 265 parsed but ignored
277CellWidth 264 parsed but ignored
278CleanFaxData 327 R/W
279ColorMap 320 R/W
280ColorResponseUnit 300 parsed but ignored
281Compression 259 R/W choosing codec
282ConsecutiveBadFaxLines 328 R/W
283Copyright 33432 R/W
284DataType 32996 R obsoleted by SampleFormat tag
285DateTime 306 R/W
286DocumentName 269 R/W
287DotRange 336 R/W
288ExtraSamples 338 R/W lots
289FaxRecvParams 34908 R/W
290FaxSubAddress 34909 R/W
291FaxRecvTime 34910 R/W
292FillOrder 266 R/W control bit order
293FreeByteCounts 289 parsed but ignored
294FreeOffsets 288 parsed but ignored
295GrayResponseCurve 291 parsed but ignored
296GrayResponseUnit 290 parsed but ignored
297Group3Options 292 R/W used by Group 3 codec
298Group4Options 293 R/W
299HostComputer 316 R/W
300ImageDepth 32997 R/W tile/strip calculations
301ImageDescription 270 R/W
302ImageLength 257 R/W lots
303ImageWidth 256 R/W lots
304InkNames 333 R/W
305InkSet 332 R/W
306JPEGTables 347 R/W used by JPEG codec
307Make 271 R/W
308Matteing 32995 R obsoleted by ExtraSamples tag
309MaxSampleValue 281 R/W
310MinSampleValue 280 R/W
311Model 272 R/W
312NewSubFileType 254 R/W called SubFileType in spec
313NumberOfInks 334 R/W
314Orientation 274 R/W
315PageName 285 R/W
316PageNumber 297 R/W
317PhotometricInterpretation 262 R/W used by Group 3 and JPEG codecs
318PlanarConfiguration 284 R/W data i/o
319Predictor 317 R/W used by LZW and Deflate codecs
320PrimaryChromacities 319 R/W
321ReferenceBlackWhite 532 R/W
322ResolutionUnit 296 R/W used by Group 3 codec
323RowsPerStrip 278 R/W data i/o
324SampleFormat 339 R/W
325SamplesPerPixel 277 R/W lots
326SMinSampleValue 340 R/W
327SMaxSampleValue 341 R/W
328Software 305 R/W
329StoNits 37439 R/W
330StripByteCounts 279 R/W data i/o
331StripOffsets 273 R/W data i/o
332SubFileType 255 R/W called OSubFileType in spec
333TargetPrinter 337 R/W
334Thresholding 263 R/W
335TileByteCounts 324 R/W data i/o
336TileDepth 32998 R/W tile/strip calculations
337TileLength 323 R/W data i/o
338TileOffsets 324 R/W data i/o
339TileWidth 322 R/W data i/o
340TransferFunction 301 R/W
341WhitePoint 318 R/W
342XPosition 286 R/W
343XResolution 282 R/W
344YCbCrCoefficients 529 R/W used by TIFFRGBAImage support
345YCbCrPositioning 531 R/W tile/strip size calulcations
346YCbCrSubsampling 530 R/W
347YPosition 286 R/W
348YResolution 283 R/W used by Group 3 codec
349.SH "PSEUDO TAGS"
350In addition to the normal
351.SM TIFF
352tags the library supports a collection of
353tags whose values lie in a range outside the valid range of
354.SM TIFF
355tags.
356These tags are termed
357.I pseud-tags
358and are used to control various codec-specific functions within the library.
359The table below summarizes the defined pseudo-tags.
360.sp
361.nf
362.ta \w'TIFFTAG_JPEGTABLESMODE'u+2n +\w'Codec'u+2n +\w'R/W'u+2n
363\fITag Name\fP \fICodec\fP \fIR/W\fP \fILibrary Use/Notes\fP
364.sp 5p
365.nf
366TIFFTAG_FAXMODE G3 R/W general codec operation
367TIFFTAG_FAXFILLFUNC G3/G4 R/W bitmap fill function
368TIFFTAG_JPEGQUALITY JPEG R/W compression quality control
369TIFFTAG_JPEGCOLORMODE JPEG R/W control colorspace conversions
370TIFFTAG_JPEGTABLESMODE JPEG R/W control contents of \fIJPEGTables\fP tag
371TIFFTAG_ZIPQUALITY Deflate R/W compression quality level
372TIFFTAG_PIXARLOGDATAFMT PixarLog R/W user data format
373TIFFTAG_PIXARLOGQUALITY PixarLog R/W compression quality level
374TIFFTAG_SGILOGDATAFMT SGILog R/W user data format
375.fi
376.TP
377.B TIFFTAG_FAXMODE
378Control the operation of the Group 3 codec.
379Possible values (independent bits that can be combined by
380or'ing them together) are:
381FAXMODE_CLASSIC
382(enable old-style format in which the
383.SM RTC
384is written at the end of the last strip),
385FAXMODE_NORTC
386(opposite of
387FAXMODE_CLASSIC;
388also called
389FAXMODE_CLASSF),
390FAXMODE_NOEOL
391(do not write
392.SM EOL
393codes at the start of each row of data),
394FAXMODE_BYTEALIGN
395(align each encoded row to an 8-bit boundary),
396FAXMODE_WORDALIGN
397(align each encoded row to an 16-bit boundary),
398The default value is dependent on the compression scheme; this
399pseudo-tag is used by the various G3 and G4 codecs to share code.
400.TP
401.B TIFFTAG_FAXFILLFUNC
402Control the function used to convert arrays of black and white
403runs to packed bit arrays.
404This hook can be used to image decoded scanlines in multi-bit
405depth rasters (e.g. for display in colormap mode)
406or for other purposes.
407The default value is a pointer to a builtin function that images
408packed bilevel data.
409.TP
410.B TIFFTAG_IPTCNEWSPHOTO
411Tag contaings image metadata per the IPTC newsphoto spec: Headline,
412captioning, credit, etc... Used by most wire services.
413.TP
414.B TIFFTAG_PHOTOSHOP
415Tag contains Photoshop captioning information and metadata. Photoshop
416uses in parallel and redundantly alongside IPTCNEWSPHOTO information.
417.TP
418.B TIFFTAG_JPEGQUALITY
419Control the compression quality level used in the baseline algorithm.
420Note that quality levels are in the range 0-100 with a default value of 75.
421.TP
422.B TIFFTAG_JPEGCOLORMODE
423Control whether or not conversion is done between
424RGB and YCbCr colorspaces.
425Possible values are:
426JPEGCOLORMODE_RAW
427(do not convert), and
428JPEGCOLORMODE_RGB
429(convert to/from RGB)
430The default value is JPEGCOLORMODE_RAW.
431.TP
432.B TIFFTAG_JPEGTABLESMODE
433Control the information written in the
434.I JPEGTables
435tag.
436Possible values (independent bits that can be combined by
437or'ing them together) are:
438JPEGTABLESMODE_QUANT
439(include quantization tables),
440and
441JPEGTABLESMODE_HUFF
442(include Huffman encoding tables).
443The default value is JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF.
444.TP
445.B TIFFTAG_ZIPQUALITY
446Control the compression technique used by the Deflate codec.
447Quality levels are in the range 1-9 with larger numbers yielding better
448compression at the cost of more computation.
449The default quality level is 6 which yields a good time-space tradeoff.
450.TP
451.B TIFFTAG_PIXARLOGDATAFMT
452Control the format of user data passed
453.I in
454to the PixarLog codec when encoding and passed
455.I out
456from when decoding.
457Possible values are:
458PIXARLOGDATAFMT_8BIT
459for 8-bit unsigned pixels,
460PIXARLOGDATAFMT_8BITABGR
461for 8-bit unsigned ABGR-ordered pixels,
462PIXARLOGDATAFMT_11BITLOG
463for 11-bit log-encoded raw data,
464PIXARLOGDATAFMT_12BITPICIO
465for 12-bit PICIO-compatible data,
466PIXARLOGDATAFMT_16BIT
467for 16-bit signed samples,
468and
469PIXARLOGDATAFMT_FLOAT
470for 32-bit IEEE floating point samples.
471.TP
472.B TIFFTAG_PIXARLOGQUALITY
473Control the compression technique used by the PixarLog codec.
474This value is treated identically to TIFFTAG_ZIPQUALITY; see the
475above description.
476.TP
477.B TIFFTAG_SGILOGDATAFMT
478Control the format of client data passed
479.I in
480to the SGILog codec when encoding and passed
481.I out
482from when decoding.
483Possible values are:
484SGILOGDATAFMT_FLTXYZ
485for converting between LogLuv and 32-bit IEEE floating valued XYZ pixels,
486SGILOGDATAFMT_16BITLUV
487for 16-bit encoded Luv pixels,
488SGILOGDATAFMT_32BITRAW and SGILOGDATAFMT_24BITRAW
489for no conversion of data,
490SGILOGDATAFMT_8BITRGB
491for returning 8-bit RGB data (valid only when decoding LogLuv-encoded data),
492SGILOGDATAFMT_FLTY
493for converting between LogL and 32-bit IEEE floating valued Y pixels,
494SGILOGDATAFMT_16BITL
495for 16-bit encoded L pixels,
496and
497SGILOGDATAFMT_8BITGRY
498for returning 8-bit greyscale data
499(valid only when decoding LogL-encoded data).
500.SH DIAGNOSTICS
501All error messages are directed through the
502.IR TIFFError
503routine.
504By default messages are directed to
505.B stderr
506in the form:
507.IR "module: message\en."
508Warning messages are likewise directed through the
509.IR TIFFWarning
510routine.
511.SH "SEE ALSO"
512.BR fax2tiff (1),
513.BR gif2tiff (1),
514.BR pal2rgb (1),
515.BR ppm2tiff (1),
516.BR rgb2ycbcr (1),
517.BR ras2tiff (1),
518.BR raw2tiff (1),
519.BR sgi2tiff (1),
520.BR tiff2bw (1),
521.BR tiffdither (1),
522.BR tiffdump (1),
523.BR tiffcp (1),
524.BR tiffcmp (1),
525.BR tiffgt (1),
526.BR tiffinfo (1),
527.BR tiffmedian (1),
528.BR tiffsplit (1),
529.BR tiffsv (1).
530.PP
531.BR "Tag Image File Format Specification \(em Revision 6.0" ,
532an Aldus Technical Memorandum.
533.PP
534.BR "The Spirit of TIFF Class F" ,
535an appendix to the TIFF 5.0 specification prepared by Cygnet Technologies.
536.PP
537Libtiff library home page:
538.BR http://www.remotesensing.org/libtiff/
539.SH BUGS
540The library does not support multi-sample images
541where some samples have different bits/sample.
542.PP
543The library does not support random access to compressed data
544that is organized with more than one row per tile or strip.