This file contains descriptions of PCX header structures and code demonstrating how to read, write, display, decode, and encode a PCX file and to manipulate DCX files. PCX File Header Reader PCXREAD.C This file header reader uses the ENDIANIO functions to insure that the PCX header information is always read using the Intel byte format regardless of the machine the code is running on. It also insures that the data read will be stored in the header structure properly despite any byte-alignment restrictions on the computer hardware. PCX File Header Writer PCXWRITE.C The header writer is identical to the PCX file header, except that the corresponding ENDIANIO output functions are used instead. This code is necessary for safely writing PCX file header information on almost any machine. PCX File Information Lister PCXHEAD.C This listing program shows the information contained within a PCX file header and VGA color palette, if one is present in the image. It is a useful way of learning how to extract such information from a PCX file and a darn handy tool is you do a lot of work with PCX files in general. PCX Run-length Decoder PCXDECOD.C PCX decoders need to be aware of image data that contains runs which start at the end of one scan line and finish at the start of the next line. This function decodes one scan line at a time and will keep track of runs if they extend to the next scan line. PCX Run-length Encoder PCXENCOD.C Run-length encoding is as easy as decoding. This function encodes a single scan line of data at a time and will not encode across scan lines. PCX File Reader and Writer PCXCODE.C This program uses all the functions in the previous listings to create a program that reads, decodes, encodes, and writes a PCX image file. This program is only an example of how to implement the PCX functions in your own code. However, if you have an PCX files that appear partly munged when displayed, you might try running them through this encoder/decoder to see if it can fix them. DCX File Information Lister DCXHEAD.C This listing program prints out the number and size of each PCX file contained within a DCX file. It is a good example of how to parse the data in a DCX file header and page list. PCX to DCX Image File Converter PCX2DCX.C Although this program is called a converter, it is really an archiver, in that it takes a bunch of PCX image files and makes one big DCX image file out of them without really changing the PCX files themselves. It is included as an example of how to use the PCX and DCX code together in a single application. DCX to PCX Image File Converter DCX2PCX Once you have made a DCX file why not split it back up into its PCX file components? Once again, this program is just one example of an application that can be written using the information and code in this directory and in its corresponding documentation.