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