Mail Archives: djgpp/1997/12/08/02:05:43
>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 -