Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx012.isp.belgacom.be (inmx012.isp.belgacom.be [195.238.3.90])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id iB7EoGM4013638
        for <joris.at.lebbeke@skynet.be>; Tue, 7 Dec 2004 15:50:17 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx012.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id iB7Eo2Ak003551
        for <joris.at.lebbeke@skynet.be>; Tue, 7 Dec 2004 15:50:03 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id BC2584E0A10; Tue,  7 Dec 2004 09:49:48 -0500 (EST)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from post.llgc.org.uk (post.llgc.org.uk [193.61.220.51])
	by xserve.flids.com (Postfix) with ESMTP id A61DF4E09EB
	for <tiff@remotesensing.org>; Tue,  7 Dec 2004 09:49:46 -0500 (EST)
Received: from nasty.llgc.org.uk ([193.61.221.252])
	by post.llgc.org.uk with esmtp (Exim 4.20)
	id 1CbgQp-0000Gm-NM; Tue, 07 Dec 2004 14:35:11 +0000
Message-ID: <41B5D134.7060502@llgc.org.uk>
Date: Tue, 07 Dec 2004 15:50:12 +0000
From: Dan Field <dof@llgc.org.uk>
User-Agent: Mozilla Thunderbird 0.8 (X11/20041025)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Joris <joris.at.lebbeke@skynet.be>
Subject: Re: [Tiff] Fetching pixel data from 4bit tiff
References: <41B5A137.1030103@llgc.org.uk><000701c4dc50$6d6c6050$ddaff551@dfgrrxsknr4e><41B5A448.9070609@llgc.org.uk><000b01c4dc52$ad0e21b0$ddaff551@dfgrrxsknr4e>
	<41B5A8BD.5080203@llgc.org.uk>
	<001501c4dc5c$f8c812a0$ddaff551@dfgrrxsknr4e>
In-Reply-To: <001501c4dc5c$f8c812a0$ddaff551@dfgrrxsknr4e>
X-Enigmail-Version: 0.86.0.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: tiff@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: f5e088f061b1bd8de15773531f5dd722

Joris wrote:

>>R=(unsigned char)TIFFGetR(raster+i);
>>G=(unsigned char)TIFFGetG(raster+i);
>>B=(unsigned char)TIFFGetB(raster+i);
>>A=(unsigned char)TIFFGetA(raster+i);
>>    
>>
>
>There's another error here, sorry I didn't spot that one earlier. TIFFGetR and
>the like don't take an address of a 32bit RGBA value, but the RGBA value itself.
>So you should actually be doing
>
>uint32 rgba;
>rgba=*(uint32*)(raster+i);  // or something along these lines, C invokes instant
>dyslexia over here
>R=(unsigned char)TIFFGetR(rgba);
>G=(unsigned char)TIFFGetG(rgba);
>B=(unsigned char)TIFFGetB(rgba);
>A=(unsigned char)TIFFGetA(rgba);
>  
>

This is no different to what I have.

-- 
Dan Field <dof@llgc.org.uk>            http://www.cymruarywe.org/
                                       http://www.walesontheweb.org/
     Developer / Sysadmin
     Llyfyrgell Genedlaethol Cymru

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
