[comp.sys.amiga.tech] 24bit IFF and PBMplus

mark@masscomp.ccur.com (Mark Thompson) (07/17/90)

Quick message before I get started, Andrew Lockwood and anyone reading
this for the PBM in the subject line, skip to the bottom.

Since I got a number of requests for what I found out, here is what was
sent to me from Viet Ho....... THANX Viet! (buy the way, whats you're
internet address?....my mail server barfs on domain/arpanet style addresses).

 ---------------------------------------------------------------

 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.

 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.

 -------------------------------------------------------------------

 As for the PBM stuff.....I asked for this information in the first place
 because the Video Toaster uses IFF24 (as well as a proprietary YIQ format)
 to store its images. Since I deal with many different machines and formats,
 I plan on hacking the ppmtoilbm and ilbmtoppm converters to handle IFF24,
 as I will be doing some beta testing of that Toaster thang and some goofy
 program that does 3D picture drawing or some such :)  I am not creating
 a new release of PBMplus, but if the program I hack works and someone would
 like a copy of the source, send me your INTERNET address (NOT DOMAIN STYLE!).
 If there are enough requests, I will post it when I am done.
+--------------------------------------------------------------------------+
|  Mark Thompson                                                           |
|  mark@westford.ccur.com                                                  |
|  ...!{decvax,uunet}!masscomp!mark   Designing high performance graphics  |
|  (508)392-2480                      engines today for a better tomorrow. |
+------------------------------------------------------------------------- +