ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/rast.h
Revision: 1.2
Committed: Mon Jul 14 22:24:00 2003 UTC (21 years, 3 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Changes since 1.1: +13 -1 lines
Log Message:
Instrumented headers against multiple inclusion and for use from C++.
Moved includes in headers out of "C" scope.

File Contents

# Content
1 /* RCSid: $Id: rast.h,v 1.1 2003/02/22 02:07:26 greg Exp $ */
2 /*
3 * Structures for line segment output to raster files
4 */
5 #ifndef _RAD_RAST_H_
6 #define _RAD_RAST_H_
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 #define NUMSCANS 16 /* number of scanlines per block */
13
14 typedef struct { /* raster scanline block */
15 unsigned char *cols[NUMSCANS];
16 int ybot, ytop; /* ybot is scan[0] */
17 int xleft, xright;
18 int width;
19 } SCANBLOCK;
20
21 extern int ydown; /* y going down? */
22
23 extern int minwidth; /* minimum line width */
24
25 extern SCANBLOCK outblock; /* output span */
26
27 #define IBLK 0 /* index for black */
28 #define IRED 1
29 #define IGRN 2
30 #define IBLU 3
31 #define IYEL 4
32 #define IMAG 5
33 #define ICYN 6
34 #define IWHT 7
35
36 #define pixtog(x,y,c) { register unsigned char \
37 *cp = outblock.cols[(y)-outblock.ybot]+(x); \
38 *cp = ((~*cp ^ (c)<<3)&070) | (*cp&07); }
39
40 #define pixmix(x,y,c) (outblock.cols[(y)-outblock.ybot][x] &= 070|(c))
41
42 #define someabove(p,y) (CONV((p)->xy[YMX],dysize) > (y))
43 #define somebelow(p,y) (CONV((p)->xy[YMN],dysize) < (y))
44
45 #define inthis(p) (ydown ? someabove(p,outblock.ybot-1) : \
46 somebelow(p,outblock.ytop+1))
47 #define innext(p) (ydown ? somebelow(p,outblock.ybot) : \
48 someabove(p,outblock.ytop))
49
50 #ifdef __cplusplus
51 }
52 #endif
53 #endif /* _RAD_RAST_H_ */
54