2004.10.13 16:00 "[Tiff] Any way to pass a byte based buffer in calling TIFFReadRGBAImageOriented?", by Howard Xu

2004.10.17 06:35 "Re: [Tiff] Any way to pass a byte based buffer in calling TIFFReadRGBAImageOriented?", by Andrey Kiselev

I am trying to use the latest libtiff library. But I have found that APIs in reading TIFF files are requiring only a unit32 buffer (tifBuffer) in the following call:

      TIFFReadRGBAImageOriented(tifFile, width, height, tifBuffer,  ORIENTATION_TOPLEFT, 0)

If I knew that the TIFF file to be loaded is a Black/White 1 sample/bit data file, is there any way I can pass a byte (unsigned char) buffer to the API so that the memory usage will be more efficient?

TIFFRGBAImage is a high level API. These calls always operate in the RGBA space and your 1-bit image will be converted in 8-bit quadruplet. To get access to the actual data contained in your image you should use TIFFReadScanline/TIFFReadEncodedStrip/TIFFReadTile functions.

Andrey

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