Return-Path: <tiff-admin@remotesensing.org>
Received: from jay.skynet.be (jay.skynet.be [195.238.3.234])
        by twentyeight.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i0EHgdH9017539
        for <joris.at.lebbeke@skynet.be>; Wed, 14 Jan 2004 18:43:02 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com ([208.24.120.42])
        by jay.skynet.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i0EHfHjG013144
        for <joris.at.lebbeke@skynet.be>; Wed, 14 Jan 2004 18:41:19 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com (localhost.localdomain [127.0.0.1])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i0EHb6l07353;
	Wed, 14 Jan 2004 12:37:06 -0500
Received: from gallantin.skynet.be (gallantin.skynet.be [195.238.2.124])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i0EHa7l07071
	for <tiff@remotesensing.org>; Wed, 14 Jan 2004 12:36:07 -0500
Received: from dfgrrxsknr4e (164.152-136-217.adsl.skynet.be [217.136.152.164])
        by gallantin.skynet.be (8.12.9/8.12.9/Skynet-OUT-2.21) with SMTP id i0EHZwPp021024
        for <tiff@remotesensing.org>; Wed, 14 Jan 2004 18:35:58 +0100
        (envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <001401c3dac4$f17c3480$a49888d9@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "Tiff mailing list" <tiff@remotesensing.org>
References: <44E68E8A7590D411862200508B9AFC2201AFF30A@zymail.zylab.nl> <03a601c3dac3$9b5fca90$0200a8c0@PLATO>
Subject: Re: [Tiff] COLORMAP and byte padding
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-RAVMilter-Version: 8.4.3(snapshot 20030212) (gallantin.skynet.be)
Sender: tiff-admin@remotesensing.org
Errors-To: tiff-admin@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Post: <mailto:tiff@remotesensing.org>
List-Subscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
List-Id: TIFF and libtiff discussion <tiff.remotesensing.org>
List-Unsubscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://remotesensing.org/pipermail/tiff/>
Date: Wed, 14 Jan 2004 18:36:19 +0100
X-UIDL: dff86de5ffacfb4c09177d1797b1e124
Status: U

Andy Cave wrote:
> I really wouldn't do that.
> 0 to 256 -> 0,
> 257 to 513 -> 2,

Philip Crews wrote:
> Using integer division, the only 16-bit pixel value that will
> result in white (255) is 0xffff, and 0x0100 will incorrectly be black

You misunderstood. I should have thought about / with integer operands being
an integer divide in C (right?). In ObjectPascal, it's a floating divide. I
actually meant to denote the floating division, and rounding afterwards.
That should make more sense.

Also, I tend to look at it from the theoretical point of view. If 0 maps to
0, and 65535 maps to 255, then the mapping formulae quite simply is
/65535*255. Plus rounding, of course.


Joris

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