typedef struct _xwd_file_header {
  int header_size;      /* Size of the entire file header (bytes). */
  int file_version;     /* XWD_FILE_VERSION */
  int pixmap_format;    /* Pixmap format */
                        /*  0    =    1-bit XY Bitmap
                            1    =    single plane XY Pixmap
                            2    =    multiple plane Z Pixmap  */
  int pixmap_depth;     /* Pixmap depth */
  int pixmap_width;     /* Pixmap width */
  int pixmap_height;    /* Pixmap height */
  int xoffset;          /* Bitmap x offset */
  int byte_order;       /* MSBFirst, LSBFirst */
  int bitmap_unit;      /* Bitmap unit:  8, 16, or 32  */
  int bitmap_bit_order; /* MSBFirst, LSBFirst */
                        /*  0    =   little endian
                            1    =    big endian  */
  int bitmap_pad;       /* Bitmap scanline bit padding */
  int bits_per_pixel;   /* Bits per pixel */
                        /*  1            <-->  StaticGray, GrayScale
                            2-15  (8)    <-->  StaticColor, PseudoColor
                            16, 24, 32  <-->  TrueColor, DirectColor  */
  int bytes_per_line;   /* Bytes per scanline */
  int visual_class;     /* Class of colormap */
                        /*  even<--> static: cannot change in memory
                            odd  <--> dynamic: can change
                            0    =    StaticGray
                            1    =    GrayScale
                            2    =    StaticColor
                            3    =    PseudoColor
                            4    =    TrueColor
                            5    =    DirectColor  */
  int red_mask;         /* Z red mask */
  int green_mask;       /* Z green mask */
  int blue_mask;        /* Z blue mask */
  int bits_per_rgb;     /* Log2 of distinct color values */
  int colormap_entries; /* Number of entries in colormap */
  int ncolors;          /* Number of Color structures */
  int window_width;     /* Window width */
  int window_height;    /* Window height */
  int window_x;         /* Window upper left X coordinate */
  int window_y;         /* Window upper left Y coordinate */
  int window_bdrwidth;  /* Window border width */
  int header_end;       /* Pad to fill out word */
} XWDFileHeader;


typedef struct {
  int    pixel;
  short  red;
  short  green;
  short  blue;
  char  flags;
  char  pad;
} XWDColor;

