24 |
|
|
25 |
|
#define sub_add(sub) (2-(sub)) /* map subtractive to additive pri. */ |
26 |
|
|
27 |
+ |
#ifdef BSD |
28 |
+ |
#define clearlbuf() bzero((char *)lpat, sizeof(lpat)) |
29 |
+ |
#else |
30 |
+ |
#define clearlbuf() (void)memset((char *)lpat, 0, sizeof(lpat)) |
31 |
+ |
#endif |
32 |
|
|
33 |
+ |
long lpat[NCOLS][3]; |
34 |
+ |
|
35 |
+ |
|
36 |
|
main(argc, argv) |
37 |
|
int argc; |
38 |
|
char *argv[]; |
76 |
|
} |
77 |
|
/* set line spacing (overlap for knitting) */ |
78 |
|
fputs("\0333\042", stdout); |
79 |
+ |
/* clear line buffer */ |
80 |
+ |
clearlbuf(); |
81 |
|
/* put out scanlines */ |
82 |
|
for (i = yres-1; i >= 0; i--) { |
83 |
|
if (freadcolrs(scanline, xres, input) < 0) { |
101 |
|
int len; |
102 |
|
int y; |
103 |
|
{ |
94 |
– |
static long pat[NCOLS][3]; |
104 |
|
int bpos; |
105 |
|
register long c; |
106 |
|
register int i, j; |
109 |
|
|
110 |
|
for (j = 0; j < 3; j++) |
111 |
|
for (i = 0; i < len; i++) |
112 |
< |
pat[i][j] |= (long)colbit(scan[i],i,j) << bpos; |
112 |
> |
lpat[i][j] |= (long)colbit(scan[i],i,j) << bpos; |
113 |
|
|
114 |
|
} else { |
115 |
|
|
120 |
|
putchar(len & 255); |
121 |
|
putchar(len >> 8); |
122 |
|
for (i = 0; i < len; i++) { |
123 |
< |
c = pat[i][j] | colbit(scan[i],i,j); |
123 |
> |
c = lpat[i][j] | colbit(scan[i],i,j); |
124 |
|
/* repeat this row */ |
125 |
< |
pat[i][j] = (c & 1) << 23; |
125 |
> |
lpat[i][j] = (c & 1) << 23; |
126 |
|
putchar(c>>16); |
127 |
|
putchar(c>>8 & 255); |
128 |
|
putchar(c & 255); |