
Thread
2003.03.31 15:31 "color map question", by John Carter
Hi
in the code below is taken from a section dealing with reading in a 4bit colour tiff image.
I read the strip in from a file (LZW decompress if necessary). I then use the upper and lower 4bits as an index into the colour map table However the location of colours in the colour map doesn't seem to tally with the colours in the original tiff image. is there something I'm missing?
thanks jc
if(tiff_data->colour_map.location){
pixel =
colour_map[(U1)(strip.location[bytes_counted]&(0x0F0>>4))];
pixel_list->location[pixels_filled].blue=pixel.red/256;
pixel_list->location[pixels_filled].green =pixel.green/256;
pixel_list->location[pixels_filled].red =pixel.blue/256;
if(!((pixels_filled + 1) % tiff_data->image_width))
if(tiff_data->image_width % 2)
continue;
++pixels_filled;
pixel =
colour_map[(U1)(strip.location[bytes_counted]&(0x0F))];
pixel_list->location[pixels_filled].blue=pixel.red/256;
pixel_list->location[pixels_filled].green=pixel.green/256;
pixel_list->location[pixels_filled].red=pixel.blue/256;
}else{
____________________________
John Carter
BSS O&M Development group,
Motorola,
Mahon Industrial Estate,
Cork.