DEVICE DRIVERS
int SigCap2Tiff()
M
X
800 SERIES PROGRAMMERS GUIDE 129
Return Values
This is an optional user-supplied function that can over-ride standard tags (but be
careful or the TIFF image may be affected or unusable) and can also define and
specify new user tags in the range MIN_TIFFTAG_USER to MAX_TIFFTAG_USER
(both defined in sigtiff.h.)
An example of the setTiffUserTags function calling the structure containing
the user-specified tags. The example TIFFTAG_GEO… user defined tags below
should be given values in the range MIN_TIFFTAG_USER to
MAX_TIFFTAG_USER. Consult the tiffio.h header file for a summary of the
meanings of the fields in the TIFFFieldInfo structure used in the table below.
static const TIFFFieldInfo xtiffFieldInfo[] =
{
/* XXX Insert Your tags here */
{ TIFFTAG_GEOPIXELSCALE,-1,-1,TIFF_DOUBLE,FIELD_CUSTOM,TRUE,TRUE,
"GeoPixelScale" },
{ TIFFTAG_GEOTRANSMATRIX,-1,-1,TIFF_DOUBLE,FIELD_CUSTOM,TRUE,TRUE,
"GeoTransformationMatrix" },
{ TIFFTAG_GEOTIEPOINTS,-1,-1,TIFF_DOUBLE,FIELD_CUSTOM,TRUE,TRUE,
"GeoTiePoints" },
{ TIFFTAG_GEOKEYDIRECTORY,-1,-1,TIFF_SHORT,FIELD_CUSTOM,TRUE,TRUE,
"GeoKeyDirectory" },
{ TIFFTAG_GEODOUBLEPARAMS,-1,1,TIFF_DOUBLE,FIELD_CUSTOM,TRUE,TRUE,
"GeoDoubleParams" },
{ TIFFTAG_GEOASCIIPARAMS,-1,-1,TIFF_ASCII,FIELD_CUSTOM,TRUE,FALSE,
"GeoASCIIParams" },
};
static void setTiffUserTags(TIFF *tif)
{
TIFFMergeFieldInfo(tif,xtiffFieldInfo,N(xtiffFieldInfo));
TIFFSetField(tif,TIFFTAG_GEOASCIIPARAMS,"Geo ASCII Params
(Custom)Field");
TIFFSetField(tif,TIFFTAG_DOCUMENTNAME,"Document Name Field");
}
0 Success
< 0 Error
NOTE
The setTiffUserTags function can override the default date/time tag that is
automatically inserted into the file.
CAUTION
The open source TIFF library does not implement complete error checking. Be
careful to use only TIFF tag values within the range defined above. Unpredictable
results will occur with other tag values.