Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!tymix!tardis!jms From: jms@tardis.Tymnet.COM (Joe Smith) Newsgroups: comp.sys.amiga Subject: Re: 4096 colors in HIRES Summary: Will it do Atari 512-color pics too? Message-ID: <300@tardis.Tymnet.COM> Date: 6 Jul 89 08:08:03 GMT References: <20069@cup.portal.com> Reply-To: jms@tardis.Tymnet.COM (Joe Smith) Organization: McDonnell Douglas Field Service Co, San Jose CA Lines: 180 In article <20069@cup.portal.com> stephan@cup.portal.com (Stephen Derek Schaem) writes: > After some test I found that displaying 4096 colors in hires is > really easy.The only thing is you can only have 16 different colors per > scanlines (could be doubled) but one can make 6400 colors changes per screen > without a problem. > > My question is how could I make a CCOP chunk for the IFF/ILBM > acceptable to everyone? Should I directly dumped the copperlist in the > junk or give a list of positions and registers to change? Raw copper lists really don't belong in an IFF program. You really want to save just the color registers and let the IFF reader re-create the copper list. On the Atari ST, a picture in "Spectrum 512" format can display all 512 colors on a 640 x 199 screen by doing the same sort of thing; changing the color registers on every scan line. Enclosed are the details, in case you want to add this format to your display program. From: dmb@TIS.COM (David M. Baggett) Newsgroups: comp.sys.atari.st Subject: Monthly Picture Formats Posting Message-ID: <8811091812.AA03351@TIS.COM> Date: 9 Nov 88 18:12:30 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet ST Picture Formats ------------------ Compiled by: Dave Baggett (arpanet: dmb@TIS.COM) (Please report errors or additions) CONTRIBUTORS Phil Blanchfield David Brooks Neil Forsyth Ken MacLeod Jim McCabe Darek Mihocka David Mumper George Seto Joe Smith Greg Wageman Gerry Wheeler Introductory information ------------------------ word = 2 bytes long = 4 bytes palette = Hardware color palette, stored as 16 words. First word is color register zero (background), last word is color register 15. Each word has the form: Bit: (MSB) 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 (LSB) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 0 0 0 0 0 R2 R1 R0 0 G2 G1 G0 0 B2 B1 B0 R2 = MSB of red intensity R0 = LSB of red intensity G2 = MSB of green intensity G0 = LSB of green intensity B2 = MSB of blue intensity B0 = LSB of blue intensity Intensity ranges from 0 (color not present) to 7 (highest intensity). Example: { red = 7, green = 3, blue = 5 } -> 0735 (hex) The Formats ----------- 1 long resolution (0 = low res, 1 = medium res, 2 = high res) 16 words palette 12 bytes filename (" . ") 1 byte Left color animation limit (starting color number) 1 byte Right color animation limit (ending color number) 1 byte color rotation speed 1 byte color rotation direction 1 word color rotation duration (number of iterations) 18 longs reserved for expansion 16000 words picture data (screen memory) ----------- 32128 bytes total 80 words first scan line of picture (unused) -- should be zeroes 15920 words picture data (screen memory) for scan lines 1 through 199 9552 words 3 palettes for each scan line (the top scan line is not included because Spectrum 512 can't display it) ----------- 51104 bytes total 1 word 5350 (hex) ("SP") 1 word 0 (reserved for future use) 1 long length of data bit map 1 long length of color bit map <= 32092 bytes compressed data bit map <= 17910 bytes compressed color bit map -------------- < 50014 bytes total Data compression: Compression is via a modified run length encoding (RLE) scheme. The data map is stored as a sequence of records. Each record consists of a header byte followed by one or more data bytes. The meaning of the header byte is as follows: For a given header byte, x: 0 <= x < 127 Use the next x + 1 bytes literally (no repetition) -128 <= x < 0 Use the next byte -x + 2 times The data appears in the following order: 1. Picture data, bit plane 0, scan lines 1 - 199 2. Picture data, bit plane 1, scan lines 1 - 199 3. Picture data, bit plane 2, scan lines 1 - 199 4. Picture data, bit plane 3, scan lines 1 - 199 Decompression of data ends when 31840 data bytes have been used. Color map compression: Each 16-word palette is compressed separately. There are three palettes for each scan line (597 total). The color map is stored as a sequence of records. Each record starts with a 1-word bit vector which specifies which of the 16 palette entries are included in the data following the bit vector (1 = included, 0 = not included; i.e., stays the same). The least significant bit of the bit vector refers to palette entry zero, while the most significant bit refers to palette entry 15. Bit 15 must be zero, since Spectrum 512 does not use palette entry 15. Bit 0 should also be zero, since Spectrum 512 always makes the background color black. The words specifying the values for the palette entries indicated in the bit vector follow the bit vector itself, in order (0 - 15). header { 1 long version number (if zero, entire header is ignored) 38 * 2 longs pattern data (anyone know how to use this?) 51 longs reserved } < 51200 bytes compressed bitmap data ------------- < 51716 bytes total Bitmap compression: The bitmap data is for a 576 pixel by 720 pixel monochrome image. The data is stored as a sequence of records. Each record consists of a control byte followed by one or more data bytes. The meaning of the control byte is as follows: For a given control byte, x: 0 < x < 127 Use the next x + 1 bytes literally (no repetition) -128 <= x <= 0 Use the next byte -x + 1 times There are 72 bytes per scan line. Each bit represents one pixel; 0 = white, 1 = black. Version of Fri Sep 23 18:14:40 EDT 1988 --------------------------------- >8 -------------------------------- -- 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!"