Received: from mailgate002.isp.belgacom.be (mailgate002.isp.belgacom.be [195.238.6.87])
	by maildelivery007.isp.belgacom.be (Postfix) with ESMTP id 48D8E45C016
	for <joris.at.lebbeke@skynet.be>; Sat, 29 Mar 2008 16:25:01 +0100 (CET)
Authentication-Results: in.mx.skynet.be; dkim=neutral (message not signed) header.i=none
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 29 Mar 2008 16:25:00 +0100
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m2TEwXQu026908;
	Sat, 29 Mar 2008 11:00:09 -0400
Received: from sasl.smtp.pobox.com (a-sasl-fastnet.sasl.smtp.pobox.com
	[207.106.133.19])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m2TEwVXH026905
	for <tiff@lists.maptools.org>; Sat, 29 Mar 2008 10:58:31 -0400
Received: from localhost.localdomain (localhost [127.0.0.1])
	by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 231AC1046;
	Sat, 29 Mar 2008 10:58:29 -0400 (EDT)
Received: from [192.168.2.4] (dpc674728121.direcpc.com [67.47.28.121]) (using
	TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client
	certificate
	requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP
	id 3A5311045; Sat, 29 Mar 2008 10:58:22 -0400 (EDT)
Message-ID: <47EE5902.6090308@pobox.com>
Date: Sat, 29 Mar 2008 10:58:10 -0400
From: Frank Warmerdam <warmerdam@pobox.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
MIME-Version: 1.0
To: James Sumners <james.sumners@gmail.com>
Subject: Re: [Tiff] TIFFReadRawStrip buffer data type
References: <ed62030a0803282118w2a3f134bsd5b6313e43e405f1@mail.gmail.com>
In-Reply-To: <ed62030a0803282118w2a3f134bsd5b6313e43e405f1@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: tiff@lists.maptools.org
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00002b8d
X-MSP-STORE: Sat, 29 Mar 2008 16:23:58 +0100
Status: RO

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

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
