| 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 |
Thread2007.08.07 15:31 "Re: Indexed Images - part 2", by Christian HenningOK OK , I got now. the following works:
short* red;
short* green;
short* blue;
TIFFGetFieldDefaulted( file, TIFFTAG_COLORMAP, &red, &green, &blue );
Thanks Frank for the other post.
Christian
On 8/7/07, Christian Henning <chhenning@gmail.com> wrote:
> Hi there, it's not my day it seems. This time I'm trying to read an
> indexed image. But reading the color map is crashing the application.
> I'm using the jello.tif test image. The photometric value is set to 3
> which indicates an indexed image.
>
> Here is what I'm doing:
>
> int main()
> {
> TIFF* file = TIFFOpen( "jello.tif", "r" );
>
> tsize_t width;
> tsize_t height;
> short bits_per_sample;
> short samples_per_pixel;
> short photo_metric;
>
> TIFFGetField( file, TIFFTAG_BITSPERSAMPLE, &bits_per_sample );
> TIFFGetField( file, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel );
> TIFFGetField( file, TIFFTAG_IMAGEWIDTH, &width );
> TIFFGetField( file, TIFFTAG_IMAGELENGTH, &height );
> TIFFGetField( file, TIFFTAG_PHOTOMETRIC, &photo_metric );
>
> toff_t* color_map = NULL;
> TIFFGetFieldDefaulted( file, TIFFTAG_COLORMAP, &color_map );
>
> return 0;
> }
>
> I'm sure it's something very simple.
>
> Thanks in advance,
> Christian
>
|
|||||||