]> git.saurik.com Git - wxWidgets.git/blame - src/tiff/man/TIFFGetField.3tiff
missing commit
[wxWidgets.git] / src / tiff / man / TIFFGetField.3tiff
CommitLineData
80ed523f 1.\" $Id: TIFFGetField.3tiff,v 1.6 2012-05-19 23:15:22 bfriesen 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 TIFFGetField 3TIFF "March 18, 2005" "libtiff"
27.SH NAME
28TIFFGetField, TIFFVGetField \- get the value(s) of a tag in an open
29.SM TIFF
30file
31.SH SYNOPSIS
32.B "#include <tiffio.h>"
33.sp
34.BI "int TIFFGetField(TIFF *" tif ", ttag_t " tag ", " ... ")"
35.sp
36.B "#include <stdarg.h>"
37.sp
38.BI "int TIFFVGetField(TIFF *" tif ", ttag_t " tag ", va_list " ap ")"
39.br
40.BI "int TIFFGetFieldDefaulted(TIFF *" tif ", ttag_t " tag ", " ... ")"
41.br
42.BI "int TIFFVGetFieldDefaulted(TIFF *" tif ", ttag_t " tag ", va_list " ap ")"
43.SH DESCRIPTION
44.IR TIFFGetField
45returns the value of a tag or pseudo-tag associated with the the current
46directory of the opened
47.SM TIFF
48file
49.IR tif .
50(A
51.I pseudo-tag
52is a parameter that is used to control the operation of the
53.SM TIFF
54library but whose value is not read or written to the underlying file.) The
55file must have been previously opened with
56.IR TIFFOpen (3TIFF).
57The tag is identified by
58.IR tag ,
59one of the values defined in the include file
60.B tiff.h
61(see also the table below). The type and number of values returned is
62dependent on the tag being requested. The programming interface uses a
63variable argument list as prescribed by the
64.IR stdarg (3)
65interface. The returned values should only be interpreted if
66.IR TIFFGetField
67returns 1.
68.PP
69.IR TIFFVGetField
70is functionally equivalent to
71.IR TIFFGetField
72except that it takes a pointer to a variable argument list.
73.I TIFFVGetField
74is useful for layering interfaces on top of the functionality provided by
75.IR TIFFGetField .
76.PP
77.IR TIFFGetFieldDefaulted
78and
79.IR TIFFVGetFieldDefaulted
80are identical to
81.IR TIFFGetField
82and
83.IR TIFFVGetField ,
84except that if a tag is not defined in the current directory and it has a
85default value, then the default value is returned.
86.PP
87The tags understood by
88.IR libtiff(3TIFF),
89the number of parameter values, and the types for the returned values are
90shown below. The data types are specified as in C and correspond to the types
91used to specify tag values to
92.IR TIFFSetField (3TIFF).
93Remember that
94.IR TIFFGetField
95returns parameter values, so all the listed data types are pointers to storage
96where values should be returned.
97Consult the
98.SM TIFF
99specification (or relevant industry specification) for information on the
100meaning of each tag and their possible values.
101.PP
102.nf
103.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'TIFFFaxFillFunc*'u+2n
104\fITag Name\fP \fICount\fP \fITypes\fP \fINotes\fP
105.sp 5p
106TIFFTAG_ARTIST 1 char**
107TIFFTAG_BADFAXLINES 1 uint32*
108TIFFTAG_BITSPERSAMPLE 1 uint16*
109TIFFTAG_CLEANFAXDATA 1 uint16*
110TIFFTAG_COLORMAP 3 uint16** 1<<BitsPerSample arrays
111TIFFTAG_COMPRESSION 1 uint16*
112TIFFTAG_CONSECUTIVEBADFAXLINES 1 uint32*
113TIFFTAG_COPYRIGHT 1 char**
114TIFFTAG_DATATYPE 1 uint16*
115TIFFTAG_DATETIME 1 char**
116TIFFTAG_DOCUMENTNAME 1 char**
117TIFFTAG_DOTRANGE 2 uint16*
118TIFFTAG_EXTRASAMPLES 2 uint16*,uint16** count & types array
119TIFFTAG_FAXFILLFUNC 1 TIFFFaxFillFunc* G3/G4 compression pseudo-tag
120TIFFTAG_FAXMODE 1 int* G3/G4 compression pseudo-tag
121TIFFTAG_FILLORDER 1 uint16*
122TIFFTAG_GROUP3OPTIONS 1 uint32*
123TIFFTAG_GROUP4OPTIONS 1 uint32*
124TIFFTAG_HALFTONEHINTS 2 uint16*
125TIFFTAG_HOSTCOMPUTER 1 char**
126TIFFTAG_ICCPROFILE 2 uint32*,void** count, profile data
127TIFFTAG_IMAGEDEPTH 1 uint32*
128TIFFTAG_IMAGEDESCRIPTION 1 char**
129TIFFTAG_IMAGELENGTH 1 uint32*
130TIFFTAG_IMAGEWIDTH 1 uint32*
131TIFFTAG_INKNAMES 1 char**
132TIFFTAG_INKSET 1 uint16*
133TIFFTAG_JPEGCOLORMODE 1 int* JPEG pseudo-tag
134TIFFTAG_JPEGQUALITY 1 int* JPEG pseudo-tag
135TIFFTAG_JPEGTABLES 2 uint32*,void** count & tables
136TIFFTAG_JPEGTABLESMODE 1 int* JPEG pseudo-tag
137TIFFTAG_MAKE 1 char**
138TIFFTAG_MATTEING 1 uint16*
139TIFFTAG_MAXSAMPLEVALUE 1 uint16*
140TIFFTAG_MINSAMPLEVALUE 1 uint16*
141TIFFTAG_MODEL 1 char**
142TIFFTAG_ORIENTATION 1 uint16*
143TIFFTAG_PAGENAME 1 char**
144TIFFTAG_PAGENUMBER 2 uint16*
145TIFFTAG_PHOTOMETRIC 1 uint16*
146TIFFTAG_PHOTOSHOP 2 uint32*,void** count, data
147TIFFTAG_PLANARCONFIG 1 uint16*
148TIFFTAG_PREDICTOR 1 uint16*
149TIFFTAG_PRIMARYCHROMATICITIES 1 float** 6-entry array
80ed523f 150TIFFTAG_REFERENCEBLACKWHITE 1 float** 6-entry array
8414a40c
VZ
151TIFFTAG_RESOLUTIONUNIT 1 uint16*
152TIFFTAG_RICHTIFFIPTC 2 uint32*,void** count, data
153TIFFTAG_ROWSPERSTRIP 1 uint32*
154TIFFTAG_SAMPLEFORMAT 1 uint16*
155TIFFTAG_SAMPLESPERPIXEL 1 uint16*
156TIFFTAG_SMAXSAMPLEVALUE 1 double*
157TIFFTAG_SMINSAMPLEVALUE 1 double*
158TIFFTAG_SOFTWARE 1 char**
159TIFFTAG_STONITS 1 double**
160TIFFTAG_STRIPBYTECOUNTS 1 uint32**
161TIFFTAG_STRIPOFFSETS 1 uint32**
162TIFFTAG_SUBFILETYPE 1 uint32*
163TIFFTAG_SUBIFD 2 uint16*,uint32** count & offsets array
164TIFFTAG_TARGETPRINTER 1 char**
165TIFFTAG_THRESHHOLDING 1 uint16*
166TIFFTAG_TILEBYTECOUNTS 1 uint32**
167TIFFTAG_TILEDEPTH 1 uint32*
168TIFFTAG_TILELENGTH 1 uint32*
169TIFFTAG_TILEOFFSETS 1 uint32**
170TIFFTAG_TILEWIDTH 1 uint32*
171TIFFTAG_TRANSFERFUNCTION 1 or 3\(dg uint16**1<<BitsPerSample entry arrays
172TIFFTAG_WHITEPOINT 1 float** 2-entry array
173TIFFTAG_XMLPACKET 2 uint32*,void** count, data
174TIFFTAG_XPOSITION 1 float*
175TIFFTAG_XRESOLUTION 1 float*
176TIFFTAG_YCBCRCOEFFICIENTS 1 float** 3-entry array
177TIFFTAG_YCBCRPOSITIONING 1 uint16*
178TIFFTAG_YCBCRSUBSAMPLING 2 uint16*
179TIFFTAG_YPOSITION 1 float*
180TIFFTAG_YRESOLUTION 1 float*\(dd
181.fi
182\(dg If
183.I SamplesPerPixel
184is one, then a single array is returned; otherwise three arrays are returned.
185.fi
186\(dd The contents of this field are quite complex. See
187.IR "The ICC Profile Format Specification" ,
188Annex B.3 "Embedding ICC Profiles in TIFF Files" (available at
189http://www.color.org) for an explanation.
190.SH AUTOREGISTERED TAGS
80ed523f
VZ
191If you can't find the tag in the table above that means this is an unsupported
192tag and is not directly supported by
193.BR libtiff(3TIFF)
194library. You will still be able to read it's value if you know the data type of
8414a40c
VZ
195that tag. For example, if you want to read the LONG value from the tag 33424
196and ASCII string from the tag 36867 you can use the following code:
197.PP
198.RS
199.nf
80ed523f 200uint32 count;
8414a40c
VZ
201void *data;
202
203TIFFGetField(tiff, 33424, &count, &data);
204printf("Tag %d: %d, count %d\n", 33424, *(uint32 *)data, count);
205TIFFGetField(tiff, 36867, &count, &data);
206printf("Tag %d: %s, count %d\n", 36867, (char *)data, count);
207.fi
208.RE
209.PP
8414a40c
VZ
210.SH RETURN VALUES
2111 is returned if the tag is defined in the current directory; otherwise a 0 is
212returned.
213.SH DIAGNOSTICS
214All error messages are directed to the
215.BR TIFFError (3TIFF)
216routine.
217.PP
218.BR "Unknown field, tag 0x%x" .
219An unknown tag was supplied.
220.SH "SEE ALSO"
221.BR TIFFOpen (3TIFF),
222.BR TIFFSetField (3TIFF),
223.BR TIFFSetDirectory (3TIFF),
224.BR TIFFReadDirectory (3TIFF),
225.BR TIFFWriteDirectory (3TIFF)
226.BR libtiff (3TIFF),
227.PP
228Libtiff library home page:
229.BR http://www.remotesensing.org/libtiff/