
Thread
2004.02.09 09:00 "Re: [Tiff] displaying 12 bit tiff image", by Andrey Kiselev
On Fri, Feb 06, 2004 at 03:35:36PM -0600, Liliana RESENDIZ wrote:
I'm BCB6 user, I've reading the documentation in order to display correctly a 12-bit image
What is 12-bit image? Is it just 16-bit TIFF where the actual dynamic range of the values limited by 12 bit?
TIFF* tif = TIFFOpen(FileName, "rl");
You don't need "l" flag unless your intention is to _write_ the little-endian TIFF file.
with the TIFFReadRGBAImageOriented(tif, w, h, raster)) function, and i tried to display it on a TImage but it handles data range [0,256], but doing pixel_val = (uint16) *raster++,
Completely wrong. The image data in the 'raster' array represented as 8-bit packed ABGR pixels. TIFFReadRGBAImage() already did all type transformation work for you and if you need individual pixels you should use macros TIFFGetR/G/B/A. I think that your TImage component wants ABGR array on input, so you should just use 'raster' array as it comes from TIFFReadRGBAImage() with TImage.
Best regards,
Andrey
--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517