delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/08/02:05:43

From: "Alex Barsamian" <bigalex AT worldnet DOT att DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Header of PCX files
Date: Sun, 7 Dec 1997 18:25:30 -0700
Organization: AT&T WorldNet Services
Lines: 33
Message-ID: <66firo$fcq@bgtnsc01.worldnet.att.net>
References: <347D2F73 DOT 5761 AT esiee DOT fr>
NNTP-Posting-Host: 12.65.147.71
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>I'm looking for the exact description of the header of PCX image files.
>I know it is 128 bytes long, I know the title of the differents parts
>which are containing in the header.
>But which values should I put in them ???

Here is what the PCX 5.0 spec looks like:

typedef struct pcx_header {
    char manufacturer;  // the manufacturer: this is useless
    char version;            // file format version
    char encoding;        // type of compression, RLE or none
    char bits_per_pixel;
    int x,y;                       // starting location of image in x/y
space
    int width,height;       // size of image, units in pixels
    int horz_res, vert_res;    // dots per inch, for printing
    char ega_pallete[48]    // the old 16 color pallete
    char reserved;            // ?
    char num_color_planes;    // don't care if using 256 color PCXs
    int bytes_per_line;
    int pallete_typ;        // 1 for color, 2 for greyscale
    char padding[58];    // seems fairly obvious...
}

The pallete is found 768 characters before EOF.

The only values of interest within the header are bits_per_pixel, x, y,
width, height, and bytes_per_line.  The rest you can effectively skip unless
you plan on working with images with a color depth > 8 bits/pixel.

Alex


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019