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