| 1 |
schorsch |
3.2 |
/* RCSid: $Id: rasterfile.h,v 3.1 2003/02/22 02:07:28 greg Exp $ */ |
| 2 |
greg |
3.1 |
/* @(#)rasterfile.h 1.11 89/08/21 SMI */ |
| 3 |
|
|
|
| 4 |
|
|
/* |
| 5 |
|
|
* Description of header for files containing raster images |
| 6 |
|
|
*/ |
| 7 |
schorsch |
3.2 |
#ifndef _RAD_RASTERFILE_H_ |
| 8 |
|
|
#define _RAD_RASTERFILE_H_ |
| 9 |
greg |
3.1 |
|
| 10 |
schorsch |
3.2 |
#ifdef __cplusplus |
| 11 |
|
|
extern "C" { |
| 12 |
|
|
#endif |
| 13 |
greg |
3.1 |
|
| 14 |
|
|
struct rasterfile { |
| 15 |
|
|
int ras_magic; /* magic number */ |
| 16 |
|
|
int ras_width; /* width (pixels) of image */ |
| 17 |
|
|
int ras_height; /* height (pixels) of image */ |
| 18 |
|
|
int ras_depth; /* depth (1, 8, or 24 bits) of pixel */ |
| 19 |
|
|
int ras_length; /* length (bytes) of image */ |
| 20 |
|
|
int ras_type; /* type of file; see RT_* below */ |
| 21 |
|
|
int ras_maptype; /* type of colormap; see RMT_* below */ |
| 22 |
|
|
int ras_maplength; /* length (bytes) of following map */ |
| 23 |
|
|
/* color map follows for ras_maplength bytes, followed by image */ |
| 24 |
|
|
}; |
| 25 |
|
|
#define RAS_MAGIC 0x59a66a95 |
| 26 |
|
|
|
| 27 |
|
|
/* Sun supported ras_type's */ |
| 28 |
|
|
#define RT_OLD 0 /* Raw pixrect image in 68000 byte order */ |
| 29 |
|
|
#define RT_STANDARD 1 /* Raw pixrect image in 68000 byte order */ |
| 30 |
|
|
#define RT_BYTE_ENCODED 2 /* Run-length compression of bytes */ |
| 31 |
|
|
#define RT_FORMAT_RGB 3 /* XRGB or RGB instead of XBGR or BGR */ |
| 32 |
|
|
#define RT_FORMAT_TIFF 4 /* tiff <-> standard rasterfile */ |
| 33 |
|
|
#define RT_FORMAT_IFF 5 /* iff (TAAC format) <-> standard rasterfile */ |
| 34 |
|
|
#define RT_EXPERIMENTAL 0xffff /* Reserved for testing */ |
| 35 |
|
|
|
| 36 |
|
|
/* Sun registered ras_maptype's */ |
| 37 |
|
|
#define RMT_RAW 2 |
| 38 |
|
|
/* Sun supported ras_maptype's */ |
| 39 |
|
|
#define RMT_NONE 0 /* ras_maplength is expected to be 0 */ |
| 40 |
|
|
#define RMT_EQUAL_RGB 1 /* red[ras_maplength/3],green[],blue[] */ |
| 41 |
|
|
|
| 42 |
|
|
/* |
| 43 |
|
|
* NOTES: |
| 44 |
|
|
* Each line of the image is rounded out to a multiple of 16 bits. |
| 45 |
|
|
* This corresponds to the rounding convention used by the memory pixrect |
| 46 |
|
|
* package (/usr/include/pixrect/memvar.h) of the SunWindows system. |
| 47 |
|
|
* The ras_encoding field (always set to 0 by Sun's supported software) |
| 48 |
|
|
* was renamed to ras_length in release 2.0. As a result, rasterfiles |
| 49 |
|
|
* of type 0 generated by the old software claim to have 0 length; for |
| 50 |
|
|
* compatibility, code reading rasterfiles must be prepared to compute the |
| 51 |
|
|
* true length from the width, height, and depth fields. |
| 52 |
|
|
*/ |
| 53 |
|
|
|
| 54 |
schorsch |
3.2 |
#ifdef __cplusplus |
| 55 |
|
|
} |
| 56 |
|
|
#endif |
| 57 |
|
|
#endif /* _RAD_RASTERFILE_H_ */ |
| 58 |
|
|
|