Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-d.one.com (mx-d.one.com [91.198.169.51])
	by mail6.local (Postfix) with ESMTP id 4E4678014F8C4
	for <filtered@awaresystems.be>; Tue, 16 Apr 2013 20:33:33 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
Received-SPF: pass (mx-d: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.217.175 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175])
	by mx-d.one.com (Postfix) with ESMTP id 0BB69C6181B
	for <filtered@awaresystems.be>; Tue, 16 Apr 2013 18:33:32 +0000 (UTC)
Received: by mail-lb0-f175.google.com with SMTP id o10so847190lbi.20
        for <filtered@awaresystems.be>; Tue, 16 Apr 2013 11:33:32 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received
         :domainkey-status:received-spf:x-gmail-fetch-info:delivered-to
         :x-virus-scanned:x-amavis-alert:x-greylist:from:to:date:thread-topic
         :thread-index:message-id:in-reply-to:accept-language
         :content-language:x-ms-has-attach:x-ms-tnef-correlator:user-agent
         :acceptlanguage:mime-version:subject:x-beenthere:x-mailman-version
         :precedence:list-id:list-unsubscribe:list-archive:list-post
         :list-help:list-subscribe:content-type:mime-version:sender:errors-to;
        bh=Y98gc6f2lytnYRgHQEaII6q+IZldTzsQ9ecQKZ+Bpg4=;
        b=iEKyDVzvM0zd7lHx0Ac8vgj7Ssyqp1HhTBAgC8GWO/qvCxpL/zmIgUbdngbQX1ZiFd
         HfLzXdm5xFFJII52TRUWRkycLaTaQZquS7ULwnGIf1MCkMqH3irICU1YaXzz0RXM0UNH
         0pqZDrOhQC30rtkQ5xka4/2OSWws3Pxse97w8hTgAJnkuCKzsGnT/pMKXoRzSF0aOFK3
         43prybExs6R2ClmhSBrV4cWsVXrPbdX/nVaIykjYR5hGc+f1P3DQLaX47rOXkjJMiilj
         fqkW0HGCpBc7O9aVBl7UBHqMIw0xsuBBcVYUmhbQ3wYRKYU2/0bHxVBH+Fh2WTGzMrqN
         orCA==
X-Received: by 10.152.111.67 with SMTP id ig3mr1787835lab.41.1366137212579;
        Tue, 16 Apr 2013 11:33:32 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.114.11.131 with SMTP id q3csp65458ldb;
        Tue, 16 Apr 2013 11:33:32 -0700 (PDT)
X-Received: by 10.112.137.135 with SMTP id qi7mr1919739lbb.117.1366137210762;
        Tue, 16 Apr 2013 11:33:30 -0700 (PDT)
DomainKey-Status: bad format
Received-SPF: neutral (google.com: 195.47.247.149 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=195.47.247.149;
Received: by 10.152.102.234 with POP3 id fr10mf668968lab.39;
        Tue, 16 Apr 2013 11:33:30 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-x.one.com (mx-x.one.com [195.47.247.149])
	by mail6.local (Postfix) with ESMTP id 675068014F8C4
	for <info@awaresystems.be>; Tue, 16 Apr 2013 19:48:04 +0200 (CEST)
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (ks365428.kimsufi.com [94.23.4.142])
	by mx-x.one.com (Postfix) with ESMTP id BA2A78A42
	for <info@awaresystems.be>; Tue, 16 Apr 2013 17:48:03 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 361D735C035;
	Tue, 16 Apr 2013 12:47:09 -0500 (EST)
Received: from exprod6og101.obsmtp.com (exprod6og101.obsmtp.com [64.18.1.181])
	by lists.maptools.org (Postfix) with ESMTPS id 9287135C035
	for <tiff@lists.maptools.org>; Tue, 16 Apr 2013 12:42:35 -0500 (EST)
Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by
	exprod6ob101.postini.com ([64.18.5.12]) with SMTP
	ID DSNKUW2Nh5UAJnrzWA43AOO2vqORJx2By8U+@postini.com;
	Tue, 16 Apr 2013 10:42:36 PDT
Received: from inner-relay-1.corp.adobe.com ([153.32.1.51])
	by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id
	r3GHdK1v007929; Tue, 16 Apr 2013 10:39:20 -0700 (PDT)
Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99])
	by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id
	r3GHgSAc021150; Tue, 16 Apr 2013 10:42:30 -0700 (PDT)
Received: from nambx03.corp.adobe.com ([10.8.189.93]) by
	nacas01.corp.adobe.com ([10.8.189.99]) with mapi;
	Tue, 16 Apr 2013 10:41:59 -0700
From: Chris Cox <ccox@adobe.com>
To: =?iso-8859-1?Q?R=E9my_Abergel?= <remy.abergel@parisdescartes.fr>, TIFF
	<tiff@lists.maptools.org>
Date: Tue, 16 Apr 2013 10:41:55 -0700
Thread-Topic: [Tiff] How 16bits-RGBA image pixels are interlaced ?
Thread-Index: Ac46iNP+9hf/rDNyRj2vh4H1dACJEgAQNumF
Message-ID: <CD92DB73.5D3F1%ccox@adobe.com>
In-Reply-To: <516D2027.4090504@parisdescartes.fr>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: Microsoft-Entourage/13.16.0.130206
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Tiff] How 16bits-RGBA image pixels are interlaced ?
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
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>
Content-Type: multipart/mixed; boundary="===============0052770169=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============0052770169==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_CD92DB735D3F1ccoxadobecom_"

--_000_CD92DB735D3F1ccoxadobecom_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

TIFF supports interleaved and planar storage of pixel values.
What you are describing is just one high level API for accessing the values=
 in the TIFF file.

Extracting the values from a uint32 would be byte order dependent (varies b=
etween CPUs).

The TIFF specification does spell out how 16 bit/channel values are stored =
in the file format.
But how they are retrieved from LibTIFF depends on which API you are using.

Chris



On 4/16/13 2:55 AM, "R=E9my Abergel" <remy.abergel@parisdescartes.fr> wrote=
:

  Hello,

 I'm trying to deal with 16-bits per channel RGBA TIFF images through C lan=
guage, I could not find a lot of information about 16-bits images in the sp=
ecifications.

 In case of a 8-bits per channel RGBA image, I understand that a pixel is s=
tored as a uint32, and can be deinterlaced by grouping the 32 bits into 4 g=
roups (R,G,B,A) of 8 bits.
 Then to deal with 8-bits per channel RGBA images, I'm doing the following =
(see also enclosed source code):

 1. I store the image data as a uint32 tab (using TIFFReadRGBAImageOriented=
) that I call data_tiff
 2. I deinterlace pixels using the following commands: (uint8) TIFFGetR(*da=
ta_tiff), (uint8) TIFFGetG(*data_tiff), (uint8) TIFFGetB(*data_tiff) & (uin=
t8) TIFFGetA(*data_tiff)

 In case of a 16 bits per channel RGBA image, could you tell me how can I d=
einterlace pixels?
if I could retreive image data as a uint64 tab, then I could do the followi=
ng:

 #define    TIFF16GetR(abgr)    ((abgr) & 0xffff)
 #define    TIFF16GetG(abgr)    (((abgr) >> 16) & 0xffff)
 #define    TIFF16GetB(abgr)    (((abgr) >> 32) & 0xffff)
 #define    TIFF16GetA(abgr)    (((abgr) >> 48) & 0xffff)

 1. I read the image data as a uint64 tab
 2. I deinterlace pixels using (uint16) TIFF16GetR(*data_tiff), (uint16) TI=
FF16GetG(*data_tiff), (uint16) TIFF16GetB(*data_tiff) & (uint16) TIFF16GetA=
(*data_tiff)

 but it seems that data are not natively stored in a uint64 tab, so I wonde=
r how are interlaced 16-bits per channel images into a uint32 pixel tab.

 I'm also facing difficulties dealing with 16-bits grayscaled images in the=
 same way (using TIFFReadRGBAImageOriented to get image data and trying to =
convert each pixel into a uint16)

 More generally, do you have any piece of documentation about 16 bits grays=
cale and color images?

 Thank you,
 Best Regards,

 R=E9my A.





--_000_CD92DB735D3F1ccoxadobecom_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML>
<HEAD>
<TITLE>Re: [Tiff] How 16bits-RGBA image pixels are interlaced ?</TITLE>
</HEAD>
<BODY>
<FONT FACE=3D"Myriad Pro"><SPAN STYLE=3D'font-size:10pt'>TIFF supports inte=
rleaved and planar storage of pixel values.<BR>
What you are describing is just one high level API for accessing the values=
 in the TIFF file.<BR>
<BR>
Extracting the values from a uint32 would be byte order dependent (varies b=
etween CPUs).<BR>
<BR>
The TIFF specification does spell out how 16 bit/channel values are stored =
in the file format.<BR>
But how they are retrieved from LibTIFF depends on which API you are using.=
<BR>
<BR>
Chris<BR>
<BR>
<BR>
<BR>
On 4/16/13 2:55 AM, &quot;R&eacute;my Abergel&quot; &lt;<a href=3D"remy.abe=
rgel@parisdescartes.fr">remy.abergel@parisdescartes.fr</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE=3D"Myriad Pro"><SPAN STYLE=3D'font-siz=
e:10pt'> &nbsp;&nbsp;</SPAN></FONT><SPAN STYLE=3D'font-size:10pt'><FONT FAC=
E=3D"Monaco, Courier New">Hello, <BR>
&nbsp;<BR>
&nbsp;I'm trying to deal with 16-bits per channel RGBA TIFF images through =
C language, I could not find a lot of information about 16-bits images in t=
he specifications. <BR>
&nbsp;<BR>
&nbsp;In case of a 8-bits per channel RGBA image, I understand that a pixel=
 is stored as a uint32, and can be deinterlaced by grouping the 32 bits int=
o 4 groups (R,G,B,A) of 8 bits. <BR>
&nbsp;Then to deal with 8-bits per channel RGBA images, I'm doing the follo=
wing (see also enclosed source code): <BR>
&nbsp;<BR>
&nbsp;1. I store the image data as a uint32 tab (using TIFFReadRGBAImageOri=
ented) that I call data_tiff <BR>
&nbsp;2. I deinterlace pixels using the following commands: (uint8) TIFFGet=
R(*data_tiff), (uint8) TIFFGetG(*data_tiff), (uint8) TIFFGetB(*data_tiff) &=
amp; (uint8) TIFFGetA(*data_tiff)<BR>
&nbsp;&nbsp;&nbsp;<BR>
&nbsp;<B>In case of a 16 bits per channel RGBA image, could you tell me how=
 can I deinterlace pixels? <BR>
</B> if I could retreive image data as a uint64 tab, then I could do the fo=
llowing: <BR>
&nbsp;<BR>
&nbsp;#define &nbsp;&nbsp;&nbsp;TIFF16GetR(abgr) &nbsp;&nbsp;&nbsp;((abgr) =
&amp; 0xffff)<BR>
&nbsp;#define &nbsp;&nbsp;&nbsp;TIFF16GetG(abgr) &nbsp;&nbsp;&nbsp;(((abgr)=
 &gt;&gt; 16) &amp; 0xffff)<BR>
&nbsp;#define &nbsp;&nbsp;&nbsp;TIFF16GetB(abgr) &nbsp;&nbsp;&nbsp;(((abgr)=
 &gt;&gt; 32) &amp; 0xffff)<BR>
&nbsp;#define &nbsp;&nbsp;&nbsp;TIFF16GetA(abgr) &nbsp;&nbsp;&nbsp;(((abgr)=
 &gt;&gt; 48) &amp; 0xffff)<BR>
&nbsp;<BR>
&nbsp;1. I read the image data as a uint64 tab<BR>
&nbsp;2. I deinterlace pixels using (uint16) TIFF16GetR(*data_tiff), (uint1=
6) TIFF16GetG(*data_tiff), (uint16) TIFF16GetB(*data_tiff) &amp; (uint16) T=
IFF16GetA(*data_tiff)<BR>
&nbsp;<BR>
&nbsp;but it seems that data are not natively stored in a uint64 tab, so I =
wonder how are interlaced 16-bits per channel images into a uint32 pixel ta=
b. <BR>
&nbsp;<BR>
&nbsp;I'm also facing difficulties dealing with <B>16-bits grayscaled image=
s</B> in the same way (using TIFFReadRGBAImageOriented to get image data an=
d trying to convert each pixel into a uint16)<BR>
&nbsp;<BR>
&nbsp;More generally, <B>do you have any piece of documentation about 16 bi=
ts grayscale and color images?</B> <BR>
&nbsp;<BR>
&nbsp;Thank you, <BR>
&nbsp;Best Regards, <BR>
&nbsp;<BR>
&nbsp;R&eacute;my A. <BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
</FONT><FONT FACE=3D"Myriad Pro"> <BR>
</FONT></SPAN></BLOCKQUOTE>
</BODY>
</HTML>


--_000_CD92DB735D3F1ccoxadobecom_--

--===============0052770169==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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