[comp.sys.amiga.programmer] Help Please! Need info on 24 bit iff's

billw@bilver.uucp (Bill Wiatroski) (03/07/91)

   Can anyone mail me the specifications of Commodores 24
bit iff ilbm graphics format? I have been unable to locate this information
in my area...Is it available from CATS?
      Thank you in advance...
                         bill wiatroski

mark@calvin..westford.ccur.com (Mark Thompson) (03/08/91)

In article <1991Mar7.050518.21948@bilver.uucp> billw@bilver.uucp (Bill Wiatroski) writes:
>   Can anyone mail me the specifications of Commodores 24
>bit iff ilbm graphics format? I have been unable to locate this information
>in my area...Is it available from CATS?

I think the answer to this question should be added the FAQ posting.
Anyway, when I asked this question several months ago, Viet Ho sent me the
reply included below. Using this info, I wrote an IFF24 to PPM conversion
module for the pbmplus tools. If the source to this module would be of any
help, send me a message.
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
%       `       '                Mark Thompson                          %
%  --==* RADIANT *==--           mark@westford.ccur.com                 %
%       ' Image `                ...!{decvax,uunet}!masscomp!mark       %
%      Productions               (508)392-2480  (603)424-1829           %
%                                                                       %
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone sends you the one submitted by CATS, it's a bit confusing.
I ended up reverse engineering the ASDG format by looking at some
sample bitmaps.
Here's the correct format (without run length encoding):

/*  IFF24 bit ordering for one scanline (ASDG format) LoRES (320)

Pixel         0   1   2   3   4   5   . . . . . --> 319

Scanline 0    R0  R0  R0  R0  R0  R0  . . . . .
              R1  R1  R1  R1  R1  R1  . . . . .
              R2  R2  R2  R2  R2  R2  . . . . .
              R3  R3  R3  R3  R3  R3  . . . . .
              R4  R4  R4  R4  R4  R4  . . . . .
              R5  R5  R5  R5  R5  R5  . . . . .
              R6  R6  R6  R6  R6  R6  . . . . .
              R7  R7  R7  R7  R7  R7  . . . . .

              G0  G0  G0  G0  G0  G0  . . . . .
              G1  G1  G1  G1  G1  G1  . . . . .
              G2  G2  G2  G2  G2  G2  . . . . .
              G3  G3  G3  G3  G3  G3  . . . . .
              G4  G4  G4  G4  G4  G4  . . . . .
              G5  G5  G5  G5  G5  G5  . . . . .
              G6  G6  G6  G6  G6  G6  . . . . .
              G7  G7  G7  G7  G7  G7  . . . . .

              B0  B0  B0  B0  B0  B0  . . . . .
              B1  B1  B1  B1  B1  B1  . . . . .
              B2  B2  B2  B2  B2  B2  . . . . .
              B3  B3  B3  B3  B3  B3  . . . . .
              B4  B4  B4  B4  B4  B4  . . . . .
              B5  B5  B5  B5  B5  B5  . . . . .
              B6  B6  B6  B6  B6  B6  . . . . .
              B7  B7  B7  B7  B7  B7  . . . . .

  */

  Refer to the RKM/or FISH IFF docs on decoding IFF chunk headers.

Hope this helps.

Oops, forgot to mention that the storage sequence goes horizontally 
for each bit of the color component by scanline width based on `
that diagram I sent you.

So the first byte in a ASDG24 ILBM would represent 8 bits from the
first 8 least significant bits of red of the first horizontal 8 pixels.
Got it?
Maybe another diagram would help:

  Pixel  0  1  2  3  4  5  6  7 -->319
        R0 R0 R0 R0 R0 R0 R0 R0  = first byte in the body CHUNK.