PCX Code Fragments

Several code fragments for the PCX format are available:


PCX_CODE.TXT contains examples of PCX header structures and how to read, write, display, decode, and encode a PCX file and to manipulate DCX files.


PCXCODE.C is an example of several functions that work with PCX image files. PCXCODE.C reads a PCX image file, decodes the image data, re-encodes it, and writes it out to a second PCX file.


PCXENCOD.C compresses an image scan line using the PCX run-length encoding algorithm.


PCXDECOD.C decodes an image scan line using the PCX run-length encoding algorithm. Decoded data is returned in a buffer.


PCX2DCX.C appends one or more PCX files to an existing DCX image file. If the named DCX file does not exist, PCX2DCX.C creates it. A DCX file may contain no more than 1023 PCX image pages.


PCXHEAD.C displays all real information contained within the header of a PCX image file.


PCXWRITE.C writes the information contained within a PCXHEADER structure to a file.


DCX2PCX.C extracts all the PCX images from within a DCX file. A DCX file may contain up to 1023 PCX images. Each PCX image is a complete PCX image file, including header, palette, and compressed image data.


DCXHEAD.C displays the data in a DCX image file header.


ENDIANIO.C functions read and write 16- and 32-bit data words in the big-endian (Motorola) and little-endian (Intel) format.


ENDIANIO.H is the header file for endianio.c, and must be included in any source modules calling any of the endian I/O functions found in ENDIANIO.C.


DATATYPE.H contains data type definitions and directives used to consolidate the data types used in the source modules and to ease the job of porting code to other systems.


PCX.H contains the header structures for the PCX and DCX image file formats. Also included are the prototypes for the functions in the source files PCXHEAD.C, DCXHEAD.C, PCXCODE.C, PCX2DCX.C, and DCX2PCX.C.


PCXREAD.H reads the header information contained within a PCX-format file and stores it in a PCXHEADER structure.

Copyright © 1996 O'Reilly & Associates, Inc. All Rights Reserved.

Hosted by uCoz