[comp.sys.amiga] Needed, IFF-HAM to RGB Bitmap

gsarff@sarek.UUCP (Gary Sarff) (09/22/89)

I am in great need of a piece of code, example pseudo code, algorithm,
anything that shows how to decode an IFF-HAM file to allow me to make a
red-green-blue bitmap.  All the source I have been able to track down, 
IFF2SUN (which doesn't do ham), ILBM2RAW which is useless since it just
copies the planes, and doesn't decode them, and the other readers basically
do the same thing.  They just read the planes into ram and then put them
in a raster, letting the amiga's hardware do the decoding.  The point is, I
won't be running it on an amiga, I need to make a bitmap file with absolute
rgb colors for a rastertech 24 bit color graphics terminal I have. I have
written C code to read the IFF file, the CMAP, the BODY, handling the RLE
compression, and get the planes into memory, but then when I go to look at
the 6 planes worth of bits, on many lines in the file the first pixel will
have bits set in the top two positions, which I thought was not to be done. I
thought the first pixel on a line was a real color, index to one of the color
registers so was of the form 00xxxx but many lines have first pixels with
either or both of the top two bits set.  Is my information incorrect? These
HAM files are good, I can view them on the amiga at work using any of a
number of viewers/application programs, but I must be doing something wrong,
or misinterpreting something.  I know there are programs that do this,
IFF2PS, HAMVGA, maybe PIXMATE, is there any way to get a bit of information
on how to do this?  Thanks much if anyone can help.

-----------------------------------------------------------------------------
The best swords can cut you and you don't even know you have been cut until
you start to bleed.

jms@tardis.Tymnet.COM (Joe Smith) (09/25/89)

In article <00313@sarek.UUCP> gsarff@sarek.UUCP (Gary Sarff) writes:
>but then when I go to look at the 6 planes worth of bits, on many lines in
>the file the first pixel will have bits set in the top two positions, which
>I thought was not to be done. I thought the first pixel on a line was a real
>color, index to one of the color registers so was of the form 00xxxx but
>many lines have first pixels with either or both of the top two bits set.

The video hardware outputs color 0 between the rightmost pixel and the start
of horizontal blanking, and also between the end of horizontal blanking and
the leftmost pixel.  Therefore the "previous color" for the first pixel is
color 0, and the first pixel can be a modification of that color.

-- 
Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@tymix.tymnet.com
McDonnell Douglas FSCO  | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-D21    | PDP-10 support: My car's license plate is "POPJ P,"
San Jose, CA 95161-9019 | narrator.device: "I didn't say that, my Amiga did!"