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