| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2005.03.15 07:56 "Re: LibTIFF question", by Frank WarmerdamOn Tue, 15 Mar 2005 01:38:39 +0100, Joris <joris.at.lebbeke@skynet.be> wrote:
>
> So my question is, is there a way to retrieve the datatype of these
> auto-registered tags? Am I right in thinking that TIFFFindFieldInfo with
> TIFF_ANY for the third parameter returns the 'registration' structure as build
> by this auto-registration scheme? Is checking the FieldType member of this
> structure good and sufficient to protect the calling code from the above
> mentioned mishap?
Joris,
I believe you would call the _TIFFFindFieldInfo() function:
const TIFFFieldInfo*
_TIFFFindFieldInfo(TIFF* tif, ttag_t tag, TIFFDataType dt)
The data type can be TIFF_ANY to find any tag definition matching
tag code "tag". The TIFFFieldInfo looks like this:
typedef struct {
ttag_t field_tag; /* field's tag */
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
short field_writecount; /* write count/TIFF_VARIABLE */
TIFFDataType field_type; /* type of associated data */
unsigned short field_bit; /* bit in fieldsset bit vector */
unsigned char field_oktochange; /* if true, can change while writing */
unsigned char field_passcount; /* if true, pass dir count on set */
char *field_name; /* ASCII name */
} TIFFFieldInfo;
I'm not sure why the function is prefixed with an underscore. I would assume
that means it isn't intended for external use, but I'm not sure why.
As you note,
in the auto-registration situation application need a way of finding out how the
tag has been defined in order to operate it without apriori knowledge.
I suspect we should promote TIFFFindFieldInfo to a properly supported (ie
documented) externally visible function.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
|
|||||||