home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / xwd.h < prev    next >
Text File  |  1993-10-21  |  4KB  |  81 lines

  1. /* xwd.h:
  2.  *
  3.  * portable-ized xwd file information.  they could have made this easier.
  4.  *
  5.  * jim frost 07.24.90
  6.  *
  7.  * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
  8.  * copyright information.
  9.  */
  10.  
  11. #define XWD_VERSION 7 /* XWD version we support */
  12.  
  13. typedef struct {
  14.   byte header_size[4];      /* Size of the entire file header (bytes). */
  15.   byte file_version[4];        /* XWD_FILE_VERSION */
  16.   byte pixmap_format[4];    /* Pixmap format */
  17.   byte pixmap_depth[4];        /* Pixmap depth */
  18.   byte pixmap_width[4];     /* Pixmap width */
  19.   byte pixmap_height[4];    /* Pixmap height */
  20.   byte xoffset[4];          /* Bitmap x offset */
  21.   byte byte_order[4];       /* MSBFirst, LSBFirst */
  22.   byte bitmap_unit[4];      /* Bitmap unit */
  23.   byte bitmap_bit_order[4]; /* MSBFirst, LSBFirst */
  24.   byte bitmap_pad[4];       /* Bitmap scanline pad */
  25.   byte bits_per_pixel[4];   /* Bits per pixel */
  26.   byte bytes_per_line[4];   /* Bytes per scanline */
  27.   byte visual_class[4];     /* Class of colormap */
  28.   byte red_mask[4];         /* Z red mask */
  29.   byte green_mask[4];       /* Z green mask */
  30.   byte blue_mask[4];        /* Z blue mask */
  31.   byte bits_per_rgb[4];     /* Log2 of distinct color values */
  32.   byte colormap_entries[4]; /* Number of entries in colormap */
  33.   byte ncolors[4];          /* Number of Color structures */
  34.   byte window_width[4];     /* Window width */
  35.   byte window_height[4];    /* Window height */
  36.   byte window_x[4];         /* Window upper left X coordinate */
  37.   byte window_y[4];         /* Window upper left Y coordinate */
  38.   byte window_bdrwidth[4];  /* Window border width */
  39. } GenericXWDHeader;
  40.  
  41. typedef struct {
  42.   unsigned int header_size;      /* Size of the entire file header (bytes). */
  43.   unsigned int file_version;     /* XWD_FILE_VERSION */
  44.   unsigned int pixmap_format;    /* Pixmap format */
  45.   unsigned int pixmap_depth;     /* Pixmap depth */
  46.   unsigned int pixmap_width;     /* Pixmap width */
  47.   unsigned int pixmap_height;    /* Pixmap height */
  48.   unsigned int xoffset;          /* Bitmap x offset */
  49.   unsigned int byte_order;       /* MSBFirst, LSBFirst */
  50.   unsigned int bitmap_unit;      /* Bitmap unit */
  51.   unsigned int bitmap_bit_order; /* MSBFirst, LSBFirst */
  52.   unsigned int bitmap_pad;       /* Bitmap scanline pad */
  53.   unsigned int bits_per_pixel;   /* Bits per pixel */
  54.   unsigned int bytes_per_line;   /* Bytes per scanline */
  55.   unsigned int visual_class;     /* Class of colormap */
  56. /*unsigned int red_mask;*/       /* Z red mask */
  57. /*unsigned int green_mask;*/     /* Z green mask */
  58. /*unsigned int blue_mask;*/      /* Z blue mask */
  59. /*unsigned int bits_per_rgb;*/   /* Log2 of distinct color values */
  60.   unsigned int colormap_entries; /* Number of entries in colormap */
  61.   unsigned int ncolors;          /* Number of Color structures */
  62. /*unsigned int window_width;*/   /* Window width */
  63. /*unsigned int window_height;*/  /* Window height */
  64. /*unsigned int window_x;*/       /* Window upper left X coordinate */
  65. /*unsigned int window_y;*/       /* Window upper left Y coordinate */
  66. /*unsigned int window_bdrwidth;*//* Window border width */
  67. } XWDHeader;
  68.  
  69. typedef struct {
  70.   byte pixel[4]; /* pixel value for this color */
  71.   byte red[2];   /* red intensity */
  72.   byte green[2]; /* green intensity */
  73.   byte blue[2];  /* blue intensity */
  74.   byte flags;    /* XColor flags (ignored) */
  75.   byte pad;
  76. } XWDColor;
  77.  
  78. #define NOT_XWD 0 /* definitely not an XWD file */
  79. #define XWD_MSB 1 /* looks like XWD file created on MSBFirst machine */
  80. #define XWD_LSB 2 /* looks like XWD file created on LSBFirst machine */
  81.