]>
iEval git - xfishtank.git/blob - rasttofish/rast.h
1 /* rast.h - header file for Sun raster files
3 ** The format of a Sun raster file is as follows. First, a struct
4 ** rasterfile. Note the 32-bit magic number at the beginning; this
5 ** identifies the file type and lets you figure out whether you need
6 ** to do little-endian / big-endian byte-swapping or not. (The PBMPLUS
7 ** implementation does not do byte-swapping; instead, it reads all
8 ** multi-byte values a byte at a time.)
10 ** After the struct is an optional colormap. If ras_maptype is RMT_NONE,
11 ** no map is present; if it's RMT_EQUAL_RGB then the map consists of
12 ** three unsigned-char arrays ras_maplength long, one each for r g and b.
13 ** I don't know what RMT_RAW means. Black and white bitmaps are stored
14 ** as ras_maptype == RMT_NONE and ras_depth == 1, with the bits stored
15 ** eight to a byte MSB first.
17 ** Finally comes the image data. If ras_type is RT_OLD or RT_STANDARD,
18 ** the data is just plain old uncompressed bytes, padded out to a multiple
19 ** of 16 bits in each row. If ras_type is RT_BYTE_ENCODED, a run-length
20 ** compression scheme is used: an escape-byte of 128 indicates a run;
21 ** the next byte is a count, and the one after that is the byte to be
22 ** replicated. The one exception to this is if the count is 1; then
23 ** there is no third byte in the packet, it means to put a single 128
24 ** in the data stream.
34 #define RAS_MAGIC 0x59a66a95
40 #define RT_OLD 0 /* Raw pixrect image in 68000 byte order */
41 #define RT_STANDARD 1 /* Raw pixrect image in 68000 byte order */
42 #define RT_BYTE_ENCODED 2 /* Run-length compression of bytes */
43 #define RT_FORMAT_RGB 3 /* XRGB or RGB instead of XBGR or BGR */
44 #define RT_FORMAT_TIFF 4 /* tiff <-> standard rasterfile */
45 #define RT_FORMAT_IFF 5 /* iff (TAAC format) <-> standard rasterfile */
46 #define RT_EXPERIMENTAL 0xffff /* Reserved for testing */
49 #define RMT_EQUAL_RGB 1
56 int (*pro_stencil
) ();
57 int (*pro_batchrop
) ();
59 int (*pro_destroy
) ();
63 struct pixrect
*(*pro_region
) ();
64 int (*pro_putcolormap
) ();
65 int (*pro_getcolormap
) ();
66 int (*pro_putattributes
) ();
67 int (*pro_getattributes
) ();
78 struct pixrectops
*pr_ops
;
79 struct pr_size pr_size
;
81 struct mpr_data
*pr_data
; /* work-alike only handles memory pixrects */
86 unsigned char *md_image
; /* note, byte not short -- avoid pr_flip() */
87 struct pr_pos md_offset
;
95 unsigned char *map
[3];
98 /* And the routine definitions. */
100 struct pixrect
*mem_create
ARGS((int w
, int h
, int depth
));
101 void mem_free
ARGS((struct pixrect
* p
));
104 ARGS((struct pixrect
* p
, FILE * out
, colormap_t
* colormap
, int type
, int copy_flag
));
106 int pr_load_header
ARGS((FILE * in
, struct rasterfile
* hP
));
108 int pr_load_colormap
ARGS((FILE * in
, struct rasterfile
* hP
, colormap_t
* colormap
));
110 struct pixrect
*pr_load_image
ARGS((FILE * in
, struct rasterfile
* hP
, colormap_t
* colormap
));
This page took 0.04406 seconds and 4 git commands to generate.