/*  %kw # %v    %n    %d    %t # */
/* Version # 3    PCXLAB.H    15-Dec-93    15:31:22 # */
/***********************************************************
 *  PCXLAB.H  -   PCX-Lab                                  *
 *  Function Prototypes, Constant and Type Definitions     *
 *  Copyright (c) 1993  Metagraphics Software Corporation  * 
 ***********************************************************/

typedef struct _pcxHead   /* PCX Header Record */
{                          
   Byte  pcxManf;      /* Manufacturer ID            */
   Byte  pcxVers;      /* Version number             */
   Byte  pcxEncode;    /* Encoding method (1=RLL)    */
   Byte  pcxBits;      /* Bits-per-pixel             */
   rect  pcxWndo;      /* Window dimensions (pixels) */
   Word  pcxResX;      /* Horz resolution (dpi)      */
   Word  pcxResY;      /* Vert resolution (dpi)      */
   Byte  pcxColor[48]; /* palette information        */
   Byte  pcxRsvd;      /*   (reserved)               */
   Byte  pcxPlanes;    /* Planes-per-pixel           */
   Word  pcxRowBytes;  /* Bytes per raster line      */
   Word  pcxPalInfo;   /* Palette style              */
   Word  pcxSizeX;     /* Horz screen size (pixels)  */
   Word  pcxSizeY;     /* Vert screen size (pixels)  */
   Byte  pcxfill[42];  /* pad total to 128 bytes     */
   long  pcxMWHand;    /* MetaWINDOW file handle	  */
   long  pcxMWIOBuf;   /* MetaWINDOW buffer offset	  */
   long  pcxMWIONdx;	  /* MetaWINDOW buffer index    */
}  pcxHead;


typedef struct _dcxHead   /* Intel CAS Version 1.2 DCX Header Record */
{                          
   long  dcxSig;           /* signature - 987654321   */
   long  dcxOffset[1024];  /* array of file positions */
}  dcxHead;


#ifdef __cplusplus      /* If C++, disable "mangling" */
extern "C" {
#endif

/* PCX file routines */
int      SEQ  ReadPCXInfo  (char *FNAME, pcxHead *PCXHDR,
                            palData *RGBCOLORS );
int      SEQ  ReadPCX      (char *FNAME, rect *SOURCER,
                            rect *DESTR );
int      SEQ  WritePCX     (char *FNAME, rect *SOURCER,
                            palData *RGBCOLORS );
/* PCX buffer routines */
int      SEQ  GetPCX       (void *BUF, rect *SOURCER,
                            rect *DESTR );

/* Incremental PCX routines */
unsigned SEQ  OpenPCX      (char *FNAME, pcxHead *PCXHDR,
									 palData *RGBCOLORS );
int      SEQ  NextPCX      ( pcxHead *PCXHDR, image *PCXIMAGE );
void     SEQ  ClosePCX     ( pcxHead *PCXHDR );

/* DCX library routines */
int      SEQ  ReadDCXInfo  (char *FNAME, pcxHead *PCXHDR,
                            palData *RGBCOLORS, int DCXNDX );
int      SEQ  ReadDCX      (char *FNAME, rect *SOURCER,
                            rect *DESTR, int DCXNDX );
unsigned SEQ  OpenDCX      (char *FNAME, pcxHead *PCXHDR,
									 palData *RGBCOLORS, int DCXNDX );

/* image transformation routines */
long     SEQ  ScaleImage   (image *SRCIMAGE, image *DSTIMAGE,
                            int DSTWIDTH, int DSTHEIGHT );
/*
long  SEQ  XlateImage      (image *SRCIMAGE, image *DSTIMAGE,
                            int DSTBITS, int DSTPLANES, long *XLTABLE);
*/

#ifdef __cplusplus
}
#endif


/* End of File  -  PCXLAB.H */
