| 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 |
Thread2004.12.07 13:02 "Re: Fetching pixel data from 4bit tiff", by Joris Van Damme> R=(unsigned char)TIFFGetR(raster+i); > G=(unsigned char)TIFFGetG(raster+i); > B=(unsigned char)TIFFGetB(raster+i); > A=(unsigned char)TIFFGetA(raster+i); There's another error here, sorry I didn't spot that one earlier. TIFFGetR and the like don't take an address of a 32bit RGBA value, but the RGBA value itself. So you should actually be doing uint32 rgba; rgba=*(uint32*)(raster+i); // or something along these lines, C invokes instant dyslexia over here R=(unsigned char)TIFFGetR(rgba); G=(unsigned char)TIFFGetG(rgba); B=(unsigned char)TIFFGetB(rgba); A=(unsigned char)TIFFGetA(rgba); Joris Van Damme info@awaresystems.be http://www.awaresystems.be Download your free TIFF tag viewer for windows here: http://www.awaresystems.be/imaging/tiff/astifftagviewer.html |
|||||||