Received: from sgi.sgi.com (192.48.153.1) by cerious.com
 with SMTP (Apple Internet Mail Server 1.1.1); Wed, 15 Jan 1997 20:09:55 -0500
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA29130; Wed, 15 Jan 1997 17:03:28 -0800
Received: (from daemon@localhost) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) id TAA10414 for tiff-list; Wed, 15 Jan 1997 19:58:27 GMT
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37]) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) via ESMTP id LAA10409 for <tiff-relay@relay.engr.sgi.com>; Wed, 15 Jan 1997 11:58:26 -0800
Received: from Starbase.NeoSoft.COM (starbase.neosoft.com [206.109.7.129]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA12215 for <tiff@sgi.com>; Wed, 15 Jan 1997 11:58:24 -0800
Received: (from neuralog@localhost) by Starbase.NeoSoft.COM (8.8.4/8.8.3) id NAA28610 for tiff@sgi.com; Wed, 15 Jan 1997 13:57:52 -0600 (CST)
From: Neuralog <neuralog@Starbase.NeoSoft.COM>
Message-Id: <199701151957.NAA28610@Starbase.NeoSoft.COM>
Subject: Format for different bits_per_sample
To: tiff@sgi.com
Date: Wed, 15 Jan 1997 13:57:52 -0600 (CST)
X-Mailer: ELM [version 2.4 PL24]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-tiff@relay.engr.SGI.COM
Precedence: bulk
Status: R


Hi,

I've been using libtiff for cross platform B&W images since ~1991.

Now (finally) I'm adding support in my apps for all image formats.

I'm a bit confused on how pixel samples are encoded into the
user buffer by TIFFReadScanline() for different bits_per_sample
values.  I know that 1 bps packs 8 pixels into each byte.
I assume that 2 bps packs 4 into each byte, but what about
3 bps?  Does it pack 3.66 pixels into each byte? or does
it waste the extra two bits?

The docs aren't real clear but seem to indicate that all bits
in the buffer are used which isn't a big deal but makes building
the cross platform masks a bit more interesting.

Oh yeah, while I'm at it - are there any funnies (exceptions)
for 4,5,6,or 7 bps? (pallette?, RGB?, Grey?)

What about 12 or 16 bps images?  Others I should know about?

Thanks,

Ken Land
kland@neuralog.com

