2001.02.06 12:44 "redefining put method for TIFFRGBAImageGet()", by Elan Ruskin
Sirs and Madams,
It says in the libtiff documentation that there's some way to override the put method used by TIFFRGBAImageGet with a function better suited to my local raster representation, but it's not particularly clear from either the documentation or the source how I should write this new put method. Could someone please shed light on the issue?
Because I'm doing DSP on these images, I need to turn the TIFF into an array of floats, one per pixel (grayscale), instead of the packed ABGRABGRABGR format that the library provides. I furthermore need the raster origin to be at the top left, in raster, rather than at the bottom left (which results in my images being vertically flipped). From the structure definition in tiffio.h it looks like I need to replace the TIFFRGBAImage->put with a function of type (void *)(TIFFRGBAImage *) but I don't know what needs to be in the put function. It takes a TIFFRGBAImage, but how does it work out from that where to put the raster data? Where does it get its input? What sort of input does it get?
At the moment my program works by using the default ...Get() to read in the default raster format, then I unpack and repack that to my specifications, but this is inefficient and I need good speed on this particular operation. Could anyone supply me with an example put method?
Elan Ruskin // PENN engineering
Elan Ruskin -- email@example.com
"The best measure of a person's worth is the depth of his commitment to the advancement and preservation of reason."