2007.07.26 19:19 "[Tiff] reading the data type of a pixel's sample", by Christian Henning

2007.07.26 19:31 "Re: [Tiff] reading the data type of a pixel's sample", by Bob Friesenhahn

Hi there, if I read 64 or 32 for the bits_per_sample tag how can I decide it's floating point or of an integer type?

Use

  uint16 sample_format;
  TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLEFORMAT,&sample_format);

and then check the value for one of

   SAMPLEFORMAT_UINT
   SAMPLEFORMAT_INT
   SAMPLEFORMAT_IEEEFP
   SAMPLEFORMAT_VOID
   SAMPLEFORMAT_COMPLEXINT
   SAMPLEFORMAT_COMPLEXIEEEFP

There are plenty of sample formats to choose from so one of them is bound to be right. :-)

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/