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 h336Ogq2003255
	for <dron@localhost>; Thu, 3 Apr 2003 10:25:38 +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); Thu, 03 Apr 2003 10:25:38 +0400 (MSD)
Received: from gate7.olympiakos.com ([64.32.199.150]) by whowhere.com; Wed, 02 Apr 2003 09:50:18 -0000
X-Envelope-Sender: owner-tiff@olympiakos.com
Received: by gate7.olympiakos.com (Postfix, from userid 65534)
	id 31882110AC; Wed,  2 Apr 2003 04:49:44 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
	by gate7.olympiakos.com (Postfix) with SMTP
	id 13548110AA; Wed,  2 Apr 2003 04:49:44 -0500 (EST)
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Wed, 2 Apr 2003 04:49:23 -0500
Delivered-To: tiff-outgoing@gate7.olympiakos.com
Received: by gate7.olympiakos.com (Postfix, from userid 16)
	id 2A058110A8; Wed,  2 Apr 2003 04:49:23 -0500 (EST)
Delivered-To: tiff@olympiakos.com
Received: from motgate5.mot.com (motgate5.mot.com [144.189.100.105])
	by gate7.olympiakos.com (Postfix) with ESMTP id D2521110A3
	for <tiff@olympiakos.com>; Wed,  2 Apr 2003 04:49:21 -0500 (EST)
Received: from pobox.mot.com (pobox.mot.com [129.188.137.100])
	by motgate5.mot.com (Motorola/Motgate5) with ESMTP id h329mprg018685
	for <tiff@olympiakos.com>; Wed, 2 Apr 2003 02:48:51 -0700 (MST)
Received: [from zei02exm02.cork.cig.mot.com ([10.131.7.12]) by pobox.mot.com (MOT-pobox 2.0) with ESMTP id CAA22718 for <tiff@olympiakos.com>; Wed, 2 Apr 2003 02:49:19 -0700 (MST)]
Received: by zei02exm02.cork.cig.mot.com with Internet Mail Service (5.5.2656.59)
	id <GTG9165D>; Wed, 2 Apr 2003 10:49:19 +0100
Message-ID: <496E31A690F7D311B93C0008C789494C06ACDB15@zei02exm01.cork.cig.mot.com>
From: Carter John-jcarte01 <John.A.Carter@motorola.com>
To: tiff@olympiakos.com
Subject: RE: color map question
Date: Wed, 2 Apr 2003 10:48:33 +0100 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2656.59)
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C2F8FC.64C60EC6"
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
Content-Length: 8589
Lines: 208

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_01C2F8FC.64C60EC6
Content-Type: text/plain;
	charset="iso-8859-1"

solved the problem.
I assumed that the colour map should be read from the file as 
RGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGB
ie rgb x 16
but its 
RRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGBBBBBBBBBBBBBBBB
 
jc

-----Original Message-----
From: Carter John-jcarte01 [mailto:John.A.Carter@motorola.com]
Sent: 31 March 2003 16:31
To: tiff@olympiakos.com
Subject: color map question


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/> 

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_01C2F8FC.64C60EC6
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><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><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D931024409-02042003>solved=20
the problem.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D931024409-02042003>I=20
assumed that the colour map should be read from the file as =
</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D931024409-02042003>RGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGB=
RGB</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D931024409-02042003>ie rgb=20
x 16</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D931024409-02042003>but=20
its </SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D931024409-02042003>RRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGBBBBBBBBBBBBB=
BBB</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D931024409-02042003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D931024409-02042003>jc</SPAN></FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> Carter =
John-jcarte01=20
  [mailto:John.A.Carter@motorola.com]<BR><B>Sent:</B> 31 March 2003=20
  16:31<BR><B>To:</B> tiff@olympiakos.com<BR><B>Subject:</B> color map=20
  question<BR><BR></FONT></DIV>
  <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=20
  is 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=20
  upper and lower 4bits as an index into the colour map=20
table</FONT></SPAN></DIV>
  <DIV><SPAN class=3D615112215-31032003><FONT face=3DArial =
size=3D2>However the=20
  location of colours in the colour map</FONT>&nbsp;<FONT face=3DArial=20
  size=3D2>doesn't seem to tally</FONT></SPAN></DIV>
  <DIV><SPAN class=3D615112215-31032003><FONT face=3DArial =
size=3D2>with the colours=20
  in 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"><o:p></o:p></SPAN></P>
  <P><SPAN=20
  style=3D"FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-size: =
10.0pt">Homer: There&#8217;s=20
  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></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C2F8FC.64C60EC6--

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

