AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.01.15 17:16 "How to determine number of colors in the colormap", by Bill Cassanova
2004.01.15 18:44 "Re: How to determine number of colors in the colormap", by Joris Van Damme
2004.01.15 18:59 "Re: How to determine number of colors in the colormap", by Bill Cassanova
2004.01.15 19:50 "Re: How to determine number of colors in the colormap", by Joris Van Damme
2004.01.15 20:14 "Re: How to determine number of colors in the colormap", by Bill Cassanova
2004.01.15 21:32 "Re: How to determine number of colors in the colormap", by Joris Van Damme

2004.01.15 18:59 "Re: How to determine number of colors in the colormap", by Bill Cassanova

Thanks for writing.

I wondered about the -1 as well but I saw it in an example and thought I was
missing something.
The original example was at:
http://remotesensing.org/pipermail/tiff/2003-November/000230.html

So to read the colormap am I doing it correctly?  For some reason the
results I
am getting are
non-sensible.  I would have expected to see values in the range of 0 to 255.

Instead I am seeing results like from the execution of the code below:
bitspersample: 8
num_entries: 255
0            0           0
26214        26214             26214
39321        39321             39321
52428        52428             52428
65535        65535             65535
39321        52428             65535
26214        52428             65535
13107        52428             65535

The code from the original is posted below for convenience.

uint16 *red;
uint16 *green;
uint16 *blue;

int num_entries = (1 << bitspersample) - 1;
cout << "num_entries: " << num_entries << endl;

           // get the photmetric interpretation
if ((result =
     TIFFGetField(image_in, TIFFTAG_COLORMAP, &red, &green, &blue)) != 1)
{
   return (false);
}
else
{
   for (int i = 0; i < num_entries; i++)
   {
      cout << red[i] << "\t" << green[i] << "\t" << blue[i] << endl;
   }

}

Thanks,
Bill