2003.10.18 04:32 "[Tiff] Reading floating point TIFF", by Swati Mital

2003.10.18 15:56 "[Tiff] Reading floating point TIFF", by Andrey Kiselev

I have a TIFF file that contains 32 bit floating point data per sample in RGB format. There are no extra samples. Is there some way to read this file using libtiff?

TIFFRGBAImage only supports for 1,2,4,8 or 16 bits per sample.

TIFFRGBAImage interface should be used to read simplest images only, because of speed and memory overhead. Speaking about conversion from 16 to 8 bit I should note, that it is not a simple thing and it can be performed in different ways. 32 bit floating point to 8 bit integer conversion even more non-trivial and I don't see a ways to make a good implementation in the TIFFRGBAImage.

So you should use TIFFReadEncodedStrip()/TIFFReadTile() functions to read the data and implement all required scalings yourself. The scaling method and parameters hardly depend on the nature of your data.

Andrey

Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517