home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 19 Printer / 19-Printer.zip / PRPCX2.ZIP / PCX.H < prev    next >
Text File  |  1989-11-10  |  2KB  |  50 lines

  1.  
  2. /*+
  3.     Name:       pcx.h
  4.     Author:     Kent J. Quirk
  5.     Abstract:   This file contains information required when handling
  6.                 PCX files.
  7. -*/
  8.  
  9. /********************
  10.     Need these to handle the PCX data below.
  11. *********************/
  12. typedef unsigned char BYTE;
  13. typedef unsigned int  WORD;
  14.  
  15. /********************
  16.     This is the definition of the PCX header.
  17. *********************/
  18. typedef struct {
  19.     BYTE pcx_id;                        /* Always 0x0A for PCX files */
  20.     BYTE version;                       /* Version of the PCX format */
  21.     BYTE encoding;                      /* 1 = RLE (RLL) compression */
  22.     BYTE bpp;                           /* Number of bits per pixel */
  23.     WORD upleftx, uplefty;              /* position of upper left corner */
  24.     WORD lorightx, lorighty;            /* lower right corner (inclusive) */
  25.     WORD display_xres, display_yres;    /* resolution in dpi of display */
  26.     BYTE palette[48];                   /* palette data if it fits */
  27.     BYTE reserved;
  28.     BYTE nplanes;                       /* number of bit planes of data */
  29.     WORD bytesperline;                  /* # bytes in an uncompressed line */
  30.     WORD palletteinfo;
  31.     BYTE reserved2[58];
  32. } PCX_HDR;
  33.  
  34. /********************
  35.    These two definitions are used to decompress data in the PCX file.
  36.    (The compressed count byte has the top two bits set).
  37. *********************/
  38. #define PCX_COMPRESSED 0xC0
  39. #define PCX_MASK 0x3F
  40.  
  41. /********************
  42.     These prototypes declare the PCX read subroutines.
  43. *********************/
  44. PCX_HDR *pcx_read_header(PCX_HDR *hdr, FILE *f);
  45. BYTE *pcx_alloc_line(PCX_HDR *hdr);
  46. BYTE *pcx_next_line(PCX_HDR *hdr, BYTE *line, FILE *f);
  47. void pcx_print_header(PCX_HDR *hdr, FILE *f);
  48.  
  49.  
  50.