[comp.sys.ibm.pc] PCX file format

sl@van-bc.UUCP (pri=-10 Stuart Lynne) (11/25/88)

Does anyone out there have details on PCX file formats (PC Paintbrush).

Appreciate any pointers.

-- 
Stuart.Lynne@wimsey.bc.ca {ubc-cs,uunet}!van-bc!sl     Vancouver,BC,604-937-7532

mason@tc.fluke.COM (Nick Mason) (11/29/88)

In article <1972@van-bc.UUCP> sl@van-bc.UUCP (pri=-10 Stuart Lynne) writes:
>Does anyone out there have details on PCX file formats (PC Paintbrush).
>
>Appreciate any pointers.


PCX is the fileformat used by pc-paintbrush, written by zsoft
and bundled with the microsoft mouse.   

Just call microsoft, tell them you want the fileformat of
pc-paintbrush, and they will send you a disk describing
it.


Nick Mason/ms272G/John Fluke Mfg Co/Box C9090/Everett WA 98206 USA
   mason@tc.fluke.COM
UUCP:
 {{cornell,decvax,sdcsvax,tektronix,utcsrgv}!uw-beaver} \
{microsoft,gatech!sb1,hplabs!lbl-csam,decwrl!sun,sunup} - !fluke!mason
		 {ssc-vax,hplsla,wavetek,uw-vlsi,tikal} /
ARPA: fluke!mason@uw-beaver.ARPA
BITNET: "fluke!mason@uw-beaver.ARPA"@PSUVAX1.bitnet
"Avoid the Dull and Ignorant"

broehl@watdcsu.waterloo.edu (Bernie Roehl) (12/08/88)

In article <1972@van-bc.UUCP> sl@van-bc.UUCP (pri=-10 Stuart Lynne) writes:
>Does anyone out there have details on PCX file formats (PC Paintbrush).

Yes (see below)

>Appreciate any pointers.

You can contact ZSoft at (404)428-0008; I believe their tech support is ext
371.  They are very helpful.

They will also send you (free of charge) a ZSoft Technical Reference Manual
(booklet, actually) that describes the pcx file format, the bitmap font file
format and information on the application programmer's interface to Frieze.

To save you time, here is the pcx format:

128 byte header:

  byte  constant 10 decimal  indicates PC Paintbrush PCX
  byte  version (see below)
  byte  encoding scheme (1 == PCX run-length encoding, see below)
  byte  bits per pixel
  word  xmin
  word  ymin
  word  xmax
  word  ymax
  word  horizontal resolution
  word  vertical resolution
  48 bytes of colormap (see below)
  byte  reserved
  byte  number of planes
  word  bytes per line
remainder is zero filled

the version number is one of:

      0  version 2.5
      2  version 2.8 with pallete info
      3  version 2.8 without pallete info
      5  version 3.0 with pallete info

the colormap is sixteen 3-byte entries.  For EGA, AT&T DEB, etc these 3 bytes
represent the intensities of Red, Green and Blue for that color (colors go
from 0 to 15).  The 256 possible intensities are not available on all hardware,
so the range is divided up.  (details in the manual)

On CGA type displays, only the first byte of each triple is used. The top
nibble of the first byte of the first triple is the background color.  The
top nibble of the first byte of the second triple is the foreground color.

The run-length encoding is straightforward.  If a byte has the top two bits
set (i.e. byte & 0xC0 == 0xC0) then the bottom six bits (byte & 0x3F) give
a count and the following byte is a value that is to be repeated that
number of times.  Otherwise the byte is the data and the count is 1.

For multiplane displays, the four sets of values for a given scan line
follow each other consecutively in the order Blue, Green, Red, Intensity,
followed by the four sets for the second line, and so on.

If you need more information than this, call ZSoft and order the manual;
I'm swamped with work right now and can't handle specific requests (sorry).

Hope the above is useful to you.


-- 
	Bernie Roehl, University of Waterloo Electrical Engineering Dept
	Mail: broehl@watdcsu.UWaterloo{.edu,.csnet,.cdn}
	BangPath: {allegra,decvax,utzoo,clyde}!watmath!watdcsu!broehl
	Voice:  (519) 745-4419 [home]  (519) 885-1211 x 2607 [work]