Return-Path: <owner-tiff@olympiakos.com>
Received: from localhost (ak4719.spb.edu [127.0.0.1])
	by ak4719.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id h316XBge003106
	for <dron@localhost>; Tue, 1 Apr 2003 10:34:35 +0400
Received: from pop.in02.prd.whowhere.com [209.202.220.196]
	by localhost with POP3 (fetchmail-6.2.0)
	for dron@localhost (single-drop); Tue, 01 Apr 2003 10:34:35 +0400 (MSD)
Received: from gate7.olympiakos.com ([64.32.199.150]) by whowhere.com; Mon, 31 Mar 2003 19:01:50 -0000
X-Envelope-Sender: owner-tiff@olympiakos.com
Received: by gate7.olympiakos.com (Postfix, from userid 65534)
	id 97ADB1109E; Mon, 31 Mar 2003 10:34:03 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
	by gate7.olympiakos.com (Postfix) with SMTP
	id 7A63311083; Mon, 31 Mar 2003 10:34:03 -0500 (EST)
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Mon, 31 Mar 2003 10:33:42 -0500
Delivered-To: tiff-outgoing@gate7.olympiakos.com
Received: by gate7.olympiakos.com (Postfix, from userid 16)
	id B5F3C1108D; Mon, 31 Mar 2003 10:33:42 -0500 (EST)
Delivered-To: tiff@olympiakos.com
Received: from motgate3.mot.com (motgate3.mot.com [144.189.100.103])
	by gate7.olympiakos.com (Postfix) with ESMTP id 6FB4411083
	for <tiff@olympiakos.com>; Mon, 31 Mar 2003 10:33:41 -0500 (EST)
Received: from mothost.mot.com (mothost.mot.com [129.188.137.101])
	by motgate3.mot.com (Motorola/Motgate3) with ESMTP id h2VFWh5Y024551
	for <tiff@olympiakos.com>; Mon, 31 Mar 2003 08:32:44 -0700 (MST)
Received: [from zei02exm02.cork.cig.mot.com ([10.131.7.12]) by mothost.mot.com (MOT-pobox 2.0) with ESMTP id IAA21109 for <tiff@olympiakos.com>; Mon, 31 Mar 2003 08:33:10 -0700 (MST)]
Received: by zei02exm02.cork.cig.mot.com with Internet Mail Service (5.5.2656.59)
	id <GTG91M4C>; Mon, 31 Mar 2003 16:32:43 +0100
Message-ID: <496E31A690F7D311B93C0008C789494C06ACDB07@zei02exm01.cork.cig.mot.com>
From: Carter John-jcarte01 <John.A.Carter@motorola.com>
To: tiff@olympiakos.com
Subject: color map question
Date: Mon, 31 Mar 2003 16:31:13 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2656.59)
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C2F79A.8FF3B836"
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
Content-Length: 6746
Lines: 160

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2F79A.8FF3B836
Content-Type: text/plain;
	charset="iso-8859-1"

Hi
in the code below is taken from a section dealing with reading in a 4bit colour
tiff image.
I read the strip in from a file (LZW decompress if necessary). 
I then use the upper and lower 4bits as an index into the colour map table
However the location of colours in the colour map doesn't seem to tally
with the colours in the original tiff image.
is there something I'm missing ?
 
thanks jc
 
 
    if(tiff_data->colour_map.location){
     pixel =
      colour_map[(U1)(strip.location[bytes_counted]&(0x0F0>>4))];
     pixel_list->location[pixels_filled].blue=pixel.red/256;
     pixel_list->location[pixels_filled].green =pixel.green/256;
     pixel_list->location[pixels_filled].red =pixel.blue/256;
     if(!((pixels_filled + 1) % tiff_data->image_width))
      if(tiff_data->image_width % 2)
       continue;
     ++pixels_filled;
     pixel =
       colour_map[(U1)(strip.location[bytes_counted]&(0x0F))];
     pixel_list->location[pixels_filled].blue=pixel.red/256;
     pixel_list->location[pixels_filled].green=pixel.green/256;
     pixel_list->location[pixels_filled].red=pixel.blue/256;
    }else{

____________________________ 

John Carter
BSS O&M Development group,
Motorola,
Mahon Industrial Estate,
Cork. 
Tel:         +353 21 4807 637 (direct)
Fax:         +353 21 4357635  ( reception )
Mobile:  +353 86 3947920
Email <mailto:john.a.carter@motorola.com>   www <http://www.cork.cig.mot.com/~jcarte01/> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Homer: There's 3 ways to do things, the right way, the wrong  way, and the max power way.
Bart: isn't that  the wrong way.
Homer: yea but faster.

 

------_=_NextPart_001_01C2F79A.8FF3B836
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial=20
size=3D2>Hi</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial size=3D2>in =
the code below is=20
taken from a&nbsp;section dealing with reading in a 4bit=20
colour</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial size=3D2>tiff=20
image.</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial size=3D2>I =
read the=20
strip&nbsp;in from a file (LZW decompress if necessary). =
</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial size=3D2>I =
then use the upper=20
and lower 4bits as an index into the colour map =
table</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial =
size=3D2>However the location=20
of colours in the colour map</FONT>&nbsp;<FONT face=3DArial =
size=3D2>doesn't seem to=20
tally</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial size=3D2>with =
the colours in=20
the original tiff image.</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial size=3D2>is =
there something=20
I'm missing ?</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial =
size=3D2>thanks=20
jc</FONT></SPAN></DIV>
<DIV><SPAN class=3D615112215-31032003><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV><PRE><SPAN =
class=3D615112215-31032003></SPAN>&nbsp;</PRE><PRE>&nbsp;&nbsp;&nbsp;&nb=
sp;if(tiff_data-&gt;colour_map.location){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;pixel =3D<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
colour_map[(U1)(strip.location[bytes_counted]&amp;(0x0F0&gt;&gt;4))];<BR=
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pixel_list-&gt;location[pixels_filled].bl=
ue=3Dpixel.red/256;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pixel_list-&gt;loca=
tion[pixels_filled].green =
=3Dpixel.green/256;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pixel_list-&gt;loca=
tion[pixels_filled].red =
=3Dpixel.blue/256;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!((pixels_filled =
+ 1) % =
tiff_data-&gt;image_width))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(ti=
ff_data-&gt;image_width % =
2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continue;<BR>&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;++pixels_filled;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pix=
el =3D<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
colour_map[(U1)(strip.location[bytes_counted]&amp;(0x0F))];<BR>&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;pixel_list-&gt;location[pixels_filled].blue=3Dpixel=
.red/256;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pixel_list-&gt;location[pixe=
ls_filled].green=3Dpixel.green/256;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pix=
el_list-&gt;location[pixels_filled].red=3Dpixel.blue/256;<BR>&nbsp;&nbsp=
;&nbsp;&nbsp;}else{</PRE>
<DIV class=3DSection1>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray">____________________________ =
</SPAN></P>
<P><SPAN style=3D"FONT-SIZE: 10pt; COLOR: gray">John Carter<BR>BSS =
O&amp;M=20
Development group,<BR>Motorola,<BR>Mahon Industrial Estate,<BR>Cork.=20
<BR>Tel:<SPAN=20
style=3D"mso-tab-count: =
1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>+353 21 4807 <STRONG>637</STRONG> (direct)<BR>Fax:<SPAN=20
style=3D"mso-tab-count: =
1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>+353 21 4357635&nbsp; (&nbsp;reception )<BR>Mobile:<SPAN=20
style=3D"mso-tab-count: 1">&nbsp; </SPAN>+353 86 3947920<BR><A=20
href=3D"mailto:john.a.carter@motorola.com">Email</A></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN><A=20
href=3D"http://www.cork.cig.mot.com/~jcarte01/">www</A><SPAN=20
style=3D"FONT-SIZE: 8pt; mso-bidi-font-size: 12.0pt"><?xml:namespace =
prefix =3D o ns=20
=3D "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P><SPAN style=3D"FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-size: =
10.0pt">Homer:=20
There&#8217;s 3 ways to do things, the right way, the wrong <SPAN=20
style=3D"mso-spacerun: yes">&nbsp;</SPAN>way, and the max power =
way.<BR><I>Bart:=20
isn&#8217;t that <SPAN style=3D"mso-spacerun: yes">&nbsp;</SPAN>the =
wrong=20
way.</I><BR>Homer: yea but faster.</SPAN><SPAN=20
style=3D"FONT-SIZE: 8pt; mso-bidi-font-size: =
12.0pt"><o:p></o:p></SPAN></P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C2F79A.8FF3B836--

To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org

