Received: by cthulhu.engr.sgi.com (940816.SGI.8.6.9/911001.SGI)
	for tiff-list id VAA21741; Thu, 15 Sep 1994 21:18:07 -0700
Return-Path: <owner-tiff>
Received: from sgi.sgi.com by cthulhu.engr.sgi.com via ESMTP (940816.SGI.8.6.9/911001.SGI)
	for <tiff-relay@cthulhu.engr.sgi.com> id VAA21732; Thu, 15 Sep 1994 21:18:00 -0700
Received: from en.ecn.purdue.edu by sgi.sgi.com via ESMTP (940627.SGI.8.6.9/910110.SGI)
	for <tiff@sgi.com> id VAA25980; Thu, 15 Sep 1994 21:17:57 -0700
Received: from en.ecn.purdue.edu (davisonj@localhost)
	by en.ecn.purdue.edu (8.6.8/3.5davy)
	id XAA10137; Thu, 15 Sep 1994 23:17:55 -0500
Message-Id: <199409160417.XAA10137@en.ecn.purdue.edu>
From: John M Davison <davisonj@ecn.purdue.edu>
Subject: TIFF Bit Ordering Versus Fill Order
To: tiff@sgi.sgi.com
Date: Thu, 15 Sep 1994 23:17:54 -0500 (EST)
X-Mailer: ELM [version 2.4 PL21]
Content-Type: text
Content-Length: 2768      
Sender: owner-tiff@sgi.sgi.com
Precedence: bulk

        I am confused by the text on page 32 of the TIFF 6.0 Specification that
describes the "FillOrder" tag.  In particular, let's say I had 

                    samples per pixel = 3
                    bits per sample = {3, 3, 3}
                    sample format = {1, 1, 1} 	(unsigned integral type)
                    PlanarConfiguration = 1     (chunky)
                    FillOrder = 1
                    image height = 1
                    image width = 2
                    no compression (1)
                    strip length = 2**32 - 1

and let's say that I am on a machine with 8-bit bytes.

        Assuming that the pixel at (0, 0) has a value of {abc, def, ghi} and
the pixel at (0, 1) has a value of {jkl, mno, pqr}, where a through r denote
bit values such that, for example, a is the MSB of abc and c is the LSB of abc,
what would the strip look like in memory?  My guess is:

+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
 MSB                         LSB|MSB                         LSB|MSB     etc.
                                |                               |
        Byte 0                  |            Byte 1             |    Byte 2


        Now let's say that the FillOrder = 2.  What does the strip look like
now?  My guess is:

+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+   +---+---+
| g | h | d | e | f | a | b | c | p | m | n | o | j | k | l | i |...| q | r |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+   +---+---+
 MSB                         LSB|MSB                         LSB|        LSB
                                |                               |
        Byte 0                  |            Byte 1             |    Byte 2


        I have a feeling that this is wrong, but page 32 of the TIFF 6.0
Specification is worded poorly enough that I can't tell.

        Is it simpler than that?  Should it have been the following?

+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+   +---+---+
| h | g | f | e | d | c | b | a | p | o | n | m | l | k | j | i |...| r | q |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+   +---+---+
 MSB                         LSB|MSB                         LSB|        LSB
                                |                               |
        Byte 0                  |            Byte 1             |    Byte 2

        What my question boils down to is this: what exactly does "FillOrder"
mean?
-- 
John Davison
Electronic Mail: davisonj@ecn.purdue.edu
WWW Home Page: <http://en.ecn.purdue.edu:20002/~davisonj/HomePage.html>

