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