PCX Code Fragments

Several code fragments for the PCX format are available:

pcx_code.txt

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

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

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

pcxdecod.c

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

pcx2dcx.c

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

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

pcxwrite.c

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

dcx2pcx.c

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

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

endianio.c

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

endianio.h

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

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

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

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