ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/rast.h
Revision: 1.3
Committed: Mon Nov 18 22:12:32 2019 UTC (4 years, 5 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R3, HEAD
Changes since 1.2: +3 -3 lines
Log Message:
Renamed "dysize" to avoid Linux library conflict

File Contents

# User Rev Content
1 greg 1.3 /* RCSid: $Id: rast.h,v 1.2 2003/07/14 22:24:00 schorsch Exp $ */
2 greg 1.1 /*
3     * Structures for line segment output to raster files
4     */
5 schorsch 1.2 #ifndef _RAD_RAST_H_
6     #define _RAD_RAST_H_
7    
8     #ifdef __cplusplus
9     extern "C" {
10     #endif
11 greg 1.1
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 greg 1.3 #define someabove(p,y) (CONV((p)->xy[YMX],dysiz) > (y))
43     #define somebelow(p,y) (CONV((p)->xy[YMN],dysiz) < (y))
44 greg 1.1
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 schorsch 1.2
50     #ifdef __cplusplus
51     }
52     #endif
53     #endif /* _RAD_RAST_H_ */
54