home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / PCXK53 / PCX.H < prev    next >
C/C++ Source or Header  |  1994-12-07  |  2KB  |  65 lines

  1. #include <stdio.h>
  2.  
  3. typedef char pathstr[80];
  4.  
  5. struct rgb_struct {
  6.   unsigned char r, g, b;
  7. };
  8.  
  9. // Structures
  10.  
  11. struct pcx_header_struct {
  12.   unsigned char signature, version, code, bits_per_plane;
  13.   int xmin, ymin, xmax, ymax;        // image dimensions
  14.   int hres, vres;                    // resolution of originating device
  15.   rgb_struct palette[16];
  16.   unsigned char reserved, num_planes;
  17.   int bytes_per_line;
  18.   unsigned char other_stuff[60];
  19. };
  20. struct VESA_info_struct {
  21.   unsigned char signature[4];
  22.   int  version;
  23.   int far *oem_ptr;
  24.   unsigned char capabilities[4];
  25.   unsigned int far *mode_list_ptr;
  26.   unsigned char reserved[256];
  27.   /* Structure is padded because some VESA BIOSes are
  28.      said to return too many bytes from function 0. */
  29. };
  30.  
  31. struct mode_info_struct {
  32.   int  attributes;
  33.   unsigned char windowA_atts, windowB_atts;
  34.   unsigned int granule_kb, window_size;
  35.   unsigned int windowA_start, windowB_start;
  36.   int  far *function_ptr;
  37.   unsigned int bytes_per_line;
  38.   unsigned int xres, yres;
  39.   unsigned char other_stuff[234];
  40. };
  41.  
  42. // Functions
  43.  
  44. int read_it(pathstr pic_file_name, int mode, int options);
  45. FILE *open_file(pathstr pic_file_name, char *file_mode,
  46.         pcx_header_struct *header);
  47. int get_mode(void);
  48. void set_mode(int mode, int options);
  49. char *report_error(int error);
  50. int we_support(unsigned int mode);
  51. int hardware_supports(unsigned int mode);
  52. int detect_VESA(VESA_info_struct *VESA_rec);
  53. int detect_VGA(void);
  54.  
  55. // Constants for constructing options word:
  56.  
  57. #define no_options 0
  58. #define save_mem   1        // preserve video memory not overwritten
  59. #define hcenter    2        // center the image horizontally
  60. #define vcenter    4        // center the image vertically
  61. #define blackout   8        // blank screen till whole image written
  62.  
  63. #define auto_set   0        // can be passed to read_it
  64.  
  65.