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 i0EC73hq011686
        for <joris.at.lebbeke@skynet.be>; Wed, 14 Jan 2004 13:07:03 +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 i0EC6U31024399
        for <joris.at.lebbeke@skynet.be>; Wed, 14 Jan 2004 13:06:31 +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 i0EC2Fl21444;
	Wed, 14 Jan 2004 07:02:15 -0500
Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i0EC1al21236
	for <tiff@remotesensing.org>; Wed, 14 Jan 2004 07:01:37 -0500
Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de)
	by moutng.kundenserver.de with esmtp (Exim 3.35 #1)
	id 1AgjiJ-0007gQ-00
	for tiff@remotesensing.org; Wed, 14 Jan 2004 13:01:35 +0100
Received: from [213.54.250.172] (helo=smtp.1und1.de)
	by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1)
	id 1AgjiJ-0002KN-00
	for tiff@remotesensing.org; Wed, 14 Jan 2004 13:01:35 +0100
In-Reply-To: <20031226160022.GA2967@ak4719.spb.edu>
To: tiff@remotesensing.org
X-Mailer: BeMail - Mail Daemon Replacement 2.2.6 Final
From: "Stephan Assmus" <stippi@yellowbites.com>
Message-Id: <10196657408-BeMail@stippis>
Mime-Version: 1.0
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: 7bit
X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:3cb51af4d67ff05c9ee3b0c042599d7a
Subject: [Tiff] COLORMAP and byte padding
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 13:01:43 +0100 CET
X-UIDL: 76916e6ff8f5fbdd11ae0c8f51fbc6bc

Hello,

I'm adding write support to the libtiff based OpenBeOS TIFF Translator. 
I want to support palette images. The format of the colormap that

TIFFSetField(tif, TIFFTAG_COLORMAP, ???);

expects is unclear to me. In the documentation, it just says

Tag Name           Count  Type      Notes

TIFFTAG_COLORMAP   3      uint16*   1<<BitsPerSample arrays

Ok, so there are 256 entries in the palette if I have 8 bits per 
sample. So much I follow, but what's with the uint16* ?!? And why Count 
== 3? The BeOS colormap bitmaps all use the same system wide palette, 
which consists of 256 entries each representing an rgb color with 3 (4 
actually) 8 bit values for r, g, b (and alpha). Am I supposed to fit a 
24 bit RGB value into 16 bits and have 256 uint16s? Or do I have 3 * 
256 uint16s with 16 bits for each r, g and b?

I have also a couple more questions about strip size and byte padding. 
There seem to be two alternating fields that determine strip size:

TIFFTAG_ROWSPERSTRIP       rows per strip of data
TIFFTAG_STRIPBYTECOUNTS    bytes counts for strips

Can both be used at the same time to tell libtiff that

strip byte counts != rows per strip * samples per pixel * width ?

(So that there are some padding bytes at the end of each row...)

Best regards,
-Stephan
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://remotesensing.org/mailman/listinfo/tiff
