AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2008.03.29 04:18 "[Tiff] TIFFReadRawStrip buffer data type", by James Sumners
2008.03.29 06:05 "Re: [Tiff] TIFFReadRawStrip buffer data type", by Bob Friesenhahn
2008.03.29 11:44 "Re: [Tiff] TIFFReadRawStrip buffer data type", by James Sumners
2008.03.29 15:41 "Re: [Tiff] TIFFReadRawStrip buffer data type", by Bob Friesenhahn
2008.03.29 16:26 "Re: [Tiff] TIFFReadRawStrip buffer data type", by James Sumners
2008.03.29 14:58 "Re: [Tiff] TIFFReadRawStrip buffer data type", by Frank Warmerdam
2008.03.29 16:29 "Re: [Tiff] TIFFReadRawStrip buffer data type", by James Sumners
2008.03.29 16:51 "Re: [Tiff] TIFFReadRawStrip buffer data type", by Bob Friesenhahn
2008.04.24 14:16 "Re: [Tiff] TIFFReadRawStrip buffer data type", by James Sumners

2008.03.29 14:58 "Re: [Tiff] TIFFReadRawStrip buffer data type", by Frank Warmerdam

If I supply TIFFReadRawStrip() with a buffer of type int, and read a grayscale image, I assume that each position in the buffer would be a value between 0 and 255, right? If so, then I'm a little confused about the debug output of my program[1]. It seems to be reading a ten digit integer for each position in the buffer. Am I doing something wrong?

[1] -- http://student.claytonstate.net/~jsumners/wavelet.zip (source code)

James,

I didn't inspect the TIFF files or dig too deeply in your code, but basically it is likely that the pixels are being read back as 8bits per pixel values, but you are reading them into a 32bit integer buffer. If there is only one sample per pixel, then you will end up with four pixels packed into each int.

Try using an "unsigned char" buffer instead of int.

Best regards,
--
---------------------------------------+--------------------------------------

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam

and watch the world go round - Rush    | President OSGeo, http://osgeo.org