1 /* $Header$ */
2 
3 #include "tiff.h"
4 
5 /*
6  * Description of header for files containing raster images
7  */
8 struct rasterfile {
9 	char	ras_magic[4];		/* magic number */
10 	int32	ras_width;		/* width (pixels) of image */
11 	int32	ras_height;		/* height (pixels) of image */
12 	int32	ras_depth;		/* depth (1, 8, or 24 bits) of pixel */
13 	int32	ras_length;		/* length (bytes) of image */
14 	int32	ras_type;		/* type of file; see RT_* below */
15 	int32	ras_maptype;		/* type of colormap; see RMT_* below */
16 	int32	ras_maplength;		/* length (bytes) of following map */
17 	/* color map follows for ras_maplength bytes, followed by image */
18 };
19 #define	RAS_MAGIC	"\x59\xa6\x6a\x95"
20 #define	RAS_MAGIC_INV	"\x95\x6a\xa6\x59"
21 
22 	/* Sun supported ras_type's */
23 #define RT_OLD		0	/* Raw pixrect image in 68000 byte order */
24 #define RT_STANDARD	1	/* Raw pixrect image in 68000 byte order */
25 #define RT_BYTE_ENCODED	2	/* Run-length compression of bytes */
26 #define RT_EXPERIMENTAL 0xffff	/* Reserved for testing */
27 
28 	/* Sun registered ras_maptype's */
29 #define RMT_RAW		2
30 	/* Sun supported ras_maptype's */
31 #define RMT_NONE	0	/* ras_maplength is expected to be 0 */
32 #define RMT_EQUAL_RGB	1	/* red[ras_maplength/3],green[],blue[] */
33 
34 /*
35  * NOTES:
36  * 	Each line of the image is rounded out to a multiple of 16 bits.
37  *   This corresponds to the rounding convention used by the memory pixrect
38  *   package (/usr/include/pixrect/memvar.h) of the SunWindows system.
39  *	The ras_encoding field (always set to 0 by Sun's supported software)
40  *   was renamed to ras_length in release 2.0.  As a result, rasterfiles
41  *   of type 0 generated by the old software claim to have 0 length; for
42  *   compatibility, code reading rasterfiles must be prepared to compute the
43  *   true length from the width, height, and depth fields.
44  */
45