PCX (again)

 BBS: Inland Empire Archive
Date: 12-10-92 (08:06)             Number: 219
From: HARRY GISH                   Refer#: NONE
  To: PETER BARNEY                  Recvd: NO  
Subj: PCX (again)                    Conf: (2) Quik_Bas
 > I've got your 256-color version, but couldn't figure out how
 > to do 16-color from that.  Can you post the 16-color version?
 >
The 16 color version is way too long to put up here. Reason is that you have
to read each scan (i. e. display) line 4 times and decode
the 16 colors out of it. Note in the 256 color version how
you decode each color (with multiplier if necessary). In 16
(and 2 color, though in 2 color there's only 1 scan, not 4)
color the pixels are grouped and encoded by 8's. Thus a
solid line (like a border) for a 640 wide screen would be
FF FF (the first FF is a multiplier of 63 of pattern 255
(all pixels on) for the 8 pixel groups (or 504 pixels). The
remainder of the line (136 pixels or a multiplier of 17)
would be C4 FF. If this were repeated 4 times the color
would be 15. On the other hand if it were :

FF FF C4 FF  (color value 1)
FF 00 C4 00  (color value 2)
FF 00 C4 00  (color value 4)
FF FF C4 FF  (color value 8)

the line color would by 9 (adding the 1 from the first line
and the 8 from the last.

You also have to decode the 16 color palettes (in the
format red, green and blue values) from the 48 bytes
following the first 16 bytes of header info.

If you'd like I could send it to you on disk.
---
 * Origin: The shipyard * Home of QuickShare * Dallas, TX
(214)686-1962 (1:124/
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET