| 1 |
/* x11wd.h - the following defs are taken from various X.V11R2 header files |
| 2 |
*/ |
| 3 |
|
| 4 |
#ifndef X11WD_H_INCLUDED |
| 5 |
#define X11WD_H_INCLUDED |
| 6 |
|
| 7 |
enum byteorder {LSBFirst=0, MSBFirst=1}; |
| 8 |
/* They used to be defined wrongly as macros: 2000.05.08 -Bryan |
| 9 |
|
| 10 |
#define LSBFirst 0 |
| 11 |
#define MSBFirst 1 |
| 12 |
*/ |
| 13 |
|
| 14 |
#define XYBitmap 0 |
| 15 |
#define XYPixmap 1 |
| 16 |
#define ZPixmap 2 |
| 17 |
|
| 18 |
enum visualclass {StaticGray=0,GrayScale=1,StaticColor=2,PseudoColor=3, |
| 19 |
TrueColor=4, DirectColor=5}; |
| 20 |
|
| 21 |
/* They used to be defined wrongly as macros: 2000.05.08 -Bryan |
| 22 |
#define StaticGray 0 |
| 23 |
#define GrayScale 1 |
| 24 |
#define StaticColor 2 |
| 25 |
#define PseudoColor 3 |
| 26 |
#define TrueColor 4 |
| 27 |
#define DirectColor 5 |
| 28 |
*/ |
| 29 |
|
| 30 |
typedef uint32_t xwdval; |
| 31 |
#define XWDVAL_MAX ((xwdval)(-1)) |
| 32 |
#define X11WD_FILE_VERSION 7 |
| 33 |
typedef struct { |
| 34 |
xwdval header_size; /* Size of the entire file header (bytes). */ |
| 35 |
xwdval file_version; /* X11WD_FILE_VERSION */ |
| 36 |
xwdval pixmap_format; /* Pixmap format */ |
| 37 |
xwdval pixmap_depth; /* Pixmap depth */ |
| 38 |
xwdval pixmap_width; /* Pixmap width */ |
| 39 |
xwdval pixmap_height; /* Pixmap height */ |
| 40 |
xwdval xoffset; /* Bitmap x offset */ |
| 41 |
xwdval byte_order; /* MSBFirst, LSBFirst */ |
| 42 |
xwdval bitmap_unit; /* Bitmap unit */ |
| 43 |
xwdval bitmap_bit_order; /* MSBFirst, LSBFirst */ |
| 44 |
xwdval bitmap_pad; /* Bitmap scanline pad */ |
| 45 |
xwdval bits_per_pixel; /* Bits per pixel */ |
| 46 |
xwdval bytes_per_line; /* Bytes per scanline */ |
| 47 |
xwdval visual_class; /* Class of colormap */ |
| 48 |
xwdval red_mask; /* Z red mask */ |
| 49 |
xwdval green_mask; /* Z green mask */ |
| 50 |
xwdval blue_mask; /* Z blue mask */ |
| 51 |
xwdval bits_per_rgb; /* Log base 2 of distinct color values */ |
| 52 |
xwdval colormap_entries; |
| 53 |
/* I have no idea what this is. An old comment says "number of |
| 54 |
entries in colormap," but readers seem to use 'ncolors' for that |
| 55 |
instead. That's how Pnmtoxwd sets ncolors, and is how Xwdtopnm |
| 56 |
interprets it. Xwdtopnm doesn't even look at 'colormap_entries'. |
| 57 |
|
| 58 |
This could be an old mistake; maybe colormap_entries was |
| 59 |
originally the number of entries in the colormap, and ncolors |
| 60 |
was the number of distinct colors in the image (which might be |
| 61 |
less than colormap_entries or, for direct color, could be much |
| 62 |
larger). |
| 63 |
*/ |
| 64 |
xwdval ncolors; |
| 65 |
/* Number of entries in the color map (for direct color, it's the |
| 66 |
number of entries in each of them). See 'colormap_entries'. |
| 67 |
*/ |
| 68 |
xwdval window_width; /* Window width */ |
| 69 |
xwdval window_height; /* Window height */ |
| 70 |
int32_t window_x; /* Window upper left X coordinate */ |
| 71 |
int32_t window_y; /* Window upper left Y coordinate */ |
| 72 |
xwdval window_bdrwidth; /* Window border width */ |
| 73 |
} X11WDFileHeader; |
| 74 |
|
| 75 |
typedef struct { |
| 76 |
uint32_t num; |
| 77 |
unsigned short red, green, blue; |
| 78 |
char flags; /* do_red, do_green, do_blue */ |
| 79 |
char pad; |
| 80 |
} X11XColor; |
| 81 |
|
| 82 |
#endif |