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