1TIFFSetField(3TIFF)                                        TIFFSetField(3TIFF)
2
3
4

NAME

6       TIFFSetField,  TIFFVSetField - set the value(s) of a tag in a TIFF file
7       open for writing
8

SYNOPSIS

10       #include <tiffio.h>
11
12       int TIFFSetField(TIFF *tif, ttag_t tag, ...)
13
14       #include <stdarg.h>
15
16       int TIFFVSetField(TIFF *tif, ttag_t tag, va_list ap)
17

DESCRIPTION

19       TIFFSetField sets the value of a field or  pseudo-tag  in  the  current
20       directory  associated  with the open TIFF file tif.  (A pseudo-tag is a
21       parameter that is used to control the operation of the TIFF library but
22       whose value is not read or written to the underlying file.)  To set the
23       value of a field the file must have been previously opened for  writing
24       with  TIFFOpen(3TIFF);  pseudo-tags  can  be  set  whether the file was
25       opened for reading or writing.  The field is identified by tag, one  of
26       the  values  defined  in  the  include  file tiff.h (see also the table
27       below).  The actual value is specified using a variable argument  list,
28       as  prescribed  by  the  stdarg(3) interface (or, on some machines, the
29       varargs(3) interface.)
30
31       TIFFVSetField is functionally equivalent to TIFFSetField except that it
32       takes  a  pointer to a variable argument list.  TIFFVSetField is useful
33       for writing routines that are layered on top of the functionality  pro‐
34       vided by TIFFSetField.
35
36       The tags understood by libtiff, the number of parameter values, and the
37       expected types for the parameter values  are  shown  below.   The  data
38       types are: char* is null-terminated string and corresponds to the ASCII
39       data type; uint16 is an unsigned 16-bit value; uint32  is  an  unsigned
40       32-bit  value; uint16* is an array of unsigned 16-bit values.  void* is
41       an array of data values of unspecified type.
42
43       Consult the TIFF specification for information on the meaning  of  each
44       tag.
45
46       Tag Name                        Count  Types              Notes
47       TIFFTAG_ARTIST                  1      char*
48       TIFFTAG_BADFAXLINES             1      uint32
49       TIFFTAG_BITSPERSAMPLE           1      uint16             †
50       TIFFTAG_CLEANFAXDATA            1      uint16
51       TIFFTAG_COLORMAP                3      uint16*            1<<BitsPerSample arrays
52       TIFFTAG_COMPRESSION             1      uint16             †
53       TIFFTAG_CONSECUTIVEBADFAXLINES  1      uint32
54       TIFFTAG_COPYRIGHT               1      char*
55       TIFFTAG_DATETIME                1      char*
56       TIFFTAG_DOCUMENTNAME            1      char*
57       TIFFTAG_DOTRANGE                2      uint16
58       TIFFTAG_EXTRASAMPLES            2      uint16,uint16*     † count & types array
59       TIFFTAG_FAXFILLFUNC             1      TIFFFaxFillFunc    G3/G4 compression pseudo-tag
60       TIFFTAG_FAXMODE                 1      int                † G3/G4 compression pseudo-tag
61       TIFFTAG_FILLORDER               1      uint16             †
62       TIFFTAG_GROUP3OPTIONS           1      uint32             †
63       TIFFTAG_GROUP4OPTIONS           1      uint32             †
64       TIFFTAG_HALFTONEHINTS           2      uint16
65       TIFFTAG_HOSTCOMPUTER            1      char*
66       TIFFTAG_ICCPROFILE              2      uint32,void*       count, profile data
67       TIFFTAG_IMAGEDEPTH              1      uint32             †
68       TIFFTAG_IMAGEDESCRIPTION        1      char*
69       TIFFTAG_IMAGELENGTH             1      uint32
70       TIFFTAG_IMAGEWIDTH              1      uint32             †
71       TIFFTAG_INKNAMES                2      uint16, char*
72       TIFFTAG_INKSET                  1      uint16             †
73       TIFFTAG_JPEGCOLORMODE           1      int                † JPEG pseudo-tag
74       TIFFTAG_JPEGQUALITY             1      int                JPEG pseudo-tag
75       TIFFTAG_JPEGTABLES              2      uint32*,void*      † count & tables
76       TIFFTAG_JPEGTABLESMODE          1      int                † JPEG pseudo-tag
77       TIFFTAG_MAKE                    1      char*
78       TIFFTAG_MATTEING                1      uint16             †
79       TIFFTAG_MAXSAMPLEVALUE          1      uint16
80       TIFFTAG_MINSAMPLEVALUE          1      uint16
81       TIFFTAG_MODEL                   1      char*
82       TIFFTAG_ORIENTATION             1      uint16
83       TIFFTAG_PAGENAME                1      char*
84       TIFFTAG_PAGENUMBER              2      uint16
85       TIFFTAG_PHOTOMETRIC             1      uint16
86       TIFFTAG_PHOTOSHOP               ?      uint32,void*       count, data
87       TIFFTAG_PLANARCONFIG            1      uint16             †
88       TIFFTAG_PREDICTOR               1      uint16             †
89       TIFFTAG_PRIMARYCHROMATICITIES   1      float*             6-entry array
90       TIFFTAG_REFERENCEBLACKWHITE     1      float*             † 6-entry array
91       TIFFTAG_RESOLUTIONUNIT          1      uint16
92       TIFFTAG_RICHTIFFIPTC            2      uint32,void*       count, data
93       TIFFTAG_ROWSPERSTRIP            1      uint32             † must be > 0
94       TIFFTAG_SAMPLEFORMAT            1      uint16             †
95       TIFFTAG_SAMPLESPERPIXEL         1      uint16             † value must be <= 4
96       TIFFTAG_SMAXSAMPLEVALUE         1      double
97       TIFFTAG_SMINSAMPLEVALUE         1      double
98       TIFFTAG_SOFTWARE                1      char*
99       TIFFTAG_STONITS                 1      double             †
100       TIFFTAG_SUBFILETYPE             1      uint32
101       TIFFTAG_SUBIFD                  2      uint16,uint32*     count & offsets array
102       TIFFTAG_TARGETPRINTER           1      char*
103       TIFFTAG_THRESHHOLDING           1      uint16
104       TIFFTAG_TILEDEPTH               1      uint32             †
105       TIFFTAG_TILELENGTH              1      uint32             † must be a multiple of 8
106       TIFFTAG_TILEWIDTH               1      uint32             † must be a multiple of 8
107       TIFFTAG_TRANSFERFUNCTION        1 or 3‡ uint16*           1<<BitsPerSample entry arrays
108       TIFFTAG_WHITEPOINT              1      float*             2-entry array
109       TIFFTAG_XMLPACKET               2      uint32,void*       count, data
110       TIFFTAG_XPOSITION               1      float
111       TIFFTAG_XRESOLUTION             1      float
112       TIFFTAG_YCBCRCOEFFICIENTS       1      float*             † 3-entry array
113       TIFFTAG_YCBCRPOSITIONING        1      uint16             †
114       TIFFTAG_YCBCRSAMPLING           2      uint16             †
115       TIFFTAG_YPOSITION               1      float
116       TIFFTAG_YRESOLUTION             1      float
117       † Tag may not have its values changed once data is written.
118       ‡  If  SamplesPerPixel is one, then a single array is passed; otherwise
119       three arrays should be passed.
120       * The contents of this field are quite complex.  See  The  ICC  Profile
121       Format  Specification, Annex B.3 "Embedding ICC Profiles in TIFF Files"
122       (available at http://www.color.org) for an explanation.
123

RETURN VALUES

125       1 is returned  if  the  operation  was  successful.   Otherwise,  0  is
126       returned if an error was detected.
127

DIAGNOSTICS

129       All error messages are directed to the TIFFError(3TIFF) routine.
130
131       %s:  Cannot modify tag "%s" while writing.  Data has already been writ‐
132       ten to the file, so the specified tag's value can not be changed.  This
133       restriction  is  applied  to all tags that affect the format of written
134       data.
135
136       %d: Bad value for "%s".  An invalid value was supplied  for  the  named
137       tag.
138

SEE ALSO

140       TIFFOpen(3TIFF),      TIFFGetField(3TIFF),     TIFFSetDirectory(3TIFF),
141       TIFFWriteDirectory(3TIFF), TIFFReadDirectory(3TIFF), libtiff(3TIFF)
142
143       Libtiff library home page: http://www.remotesensing.org/libtiff/
144
145
146
147libtiff                        October 29, 2004            TIFFSetField(3TIFF)
Impressum