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