File: xwd.h

package info (click to toggle)
xli 1.16-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,360 kB
  • ctags: 2,046
  • sloc: ansic: 21,972; sh: 197; makefile: 182
file content (83 lines) | stat: -rw-r--r-- 3,713 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* #ident	"@(#)x11:contrib/clients/xloadimage/xwd.h 1.6 94/07/29 Labtam" */
/* xwd.h:
 *
 * portable-ized xwd file information.  they could have made this easier.
 *
 * jim frost 07.24.90
 *
 * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
 * copyright information.
 */

#define XWD_VERSION 7 /* XWD version we support */

#define sizeofGenericXWDHeader 100
typedef struct {
  byte header_size[4];      /* Size of the entire file header (bytes). */
  byte file_version[4];	    /* XWD_FILE_VERSION */
  byte pixmap_format[4];    /* Pixmap format */
  byte pixmap_depth[4];	    /* Pixmap depth */
  byte pixmap_width[4];     /* Pixmap width */
  byte pixmap_height[4];    /* Pixmap height */
  byte xoffset[4];          /* Bitmap x offset */
  byte byte_order[4];       /* MSBFirst, LSBFirst */
  byte bitmap_unit[4];      /* Bitmap unit */
  byte bitmap_bit_order[4]; /* MSBFirst, LSBFirst */
  byte bitmap_pad[4];       /* Bitmap scanline pad */
  byte bits_per_pixel[4];   /* Bits per pixel */
  byte bytes_per_line[4];   /* Bytes per scanline */
  byte visual_class[4];     /* Class of colormap */
  byte red_mask[4];         /* Z red mask */
  byte green_mask[4];       /* Z green mask */
  byte blue_mask[4];        /* Z blue mask */
  byte bits_per_rgb[4];     /* Log2 of distinct color values */
  byte colormap_entries[4]; /* Number of entries in colormap */
  byte ncolors[4];          /* Number of Color structures */
  byte window_width[4];     /* Window width */
  byte window_height[4];    /* Window height */
  byte window_x[4];         /* Window upper left X coordinate */
  byte window_y[4];         /* Window upper left Y coordinate */
  byte window_bdrwidth[4];  /* Window border width */
} GenericXWDHeader;

typedef struct {
  unsigned int header_size;      /* Size of the entire file header (bytes). */
  unsigned int file_version;     /* XWD_FILE_VERSION */
  unsigned int pixmap_format;    /* Pixmap format */
  unsigned int pixmap_depth;     /* Pixmap depth */
  unsigned int pixmap_width;     /* Pixmap width */
  unsigned int pixmap_height;    /* Pixmap height */
  unsigned int xoffset;          /* Bitmap x offset */
  unsigned int byte_order;       /* MSBFirst, LSBFirst */
  unsigned int bitmap_unit;      /* Bitmap unit */
  unsigned int bitmap_bit_order; /* MSBFirst, LSBFirst */
  unsigned int bitmap_pad;       /* Bitmap scanline pad */
  unsigned int bits_per_pixel;   /* Bits per pixel */
  unsigned int bytes_per_line;   /* Bytes per scanline */
  unsigned int visual_class;     /* Class of colormap */
/*unsigned int red_mask;*/       /* Z red mask */
/*unsigned int green_mask;*/     /* Z green mask */
/*unsigned int blue_mask;*/      /* Z blue mask */
/*unsigned int bits_per_rgb;*/   /* Log2 of distinct color values */
  unsigned int colormap_entries; /* Number of entries in colormap */
  unsigned int ncolors;          /* Number of Color structures */
/*unsigned int window_width;*/   /* Window width */
/*unsigned int window_height;*/  /* Window height */
/*unsigned int window_x;*/       /* Window upper left X coordinate */
/*unsigned int window_y;*/       /* Window upper left Y coordinate */
/*unsigned int window_bdrwidth;*//* Window border width */
} XWDHeader;

#define sizeofXWDColor 12
typedef struct {
  byte pixel[4]; /* pixel value for this color */
  byte red[2];   /* red intensity */
  byte green[2]; /* green intensity */
  byte blue[2];  /* blue intensity */
  byte flags;    /* XColor flags (ignored) */
  byte pad;
} XWDColor;

#define NOT_XWD 0 /* definitely not an XWD file */
#define XWD_MSB 1 /* looks like XWD file created on MSBFirst machine */
#define XWD_LSB 2 /* looks like XWD file created on LSBFirst machine */