AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
March 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

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

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

James Sumners wrote:
> 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