67 |
|
return(-1); |
68 |
|
} |
69 |
|
/* set line spacing (overlap for knitting) */ |
70 |
< |
fputs("\0333\042", stdout); |
70 |
> |
fputs("\0333\036", stdout); |
71 |
|
/* put out scanlines */ |
72 |
|
for (i = yres-1; i >= 0; i--) { |
73 |
|
if (freadscan(scanline, xres, input) < 0) { |
95 |
|
register long c; |
96 |
|
register int i, j; |
97 |
|
|
98 |
< |
if (bpos = y % 23) { |
98 |
> |
if (bpos = y % 20) { |
99 |
|
|
100 |
< |
for (j = 0; j < 3; j++) |
101 |
< |
for (i = 0; i < len; i++) |
102 |
< |
pat[i][j] |= (long)colbit(scan[i],i,j) << bpos; |
100 |
> |
if (y > 20 & bpos < 4) /* knit bits */ |
101 |
> |
for (j = 0; j < 3; j++) |
102 |
> |
for (i = 0; i < len; i++) |
103 |
> |
pat[i][j] |= (long)colbit(scan[i],i,j) |
104 |
> |
<< (i+j & 4 ? bpos+24 : bpos); |
105 |
> |
else |
106 |
> |
for (j = 0; j < 3; j++) |
107 |
> |
for (i = 0; i < len; i++) |
108 |
> |
pat[i][j] |= (long)colbit(scan[i],i,j) |
109 |
> |
<< bpos; |
110 |
|
|
111 |
|
} else { |
112 |
|
|
114 |
|
|
115 |
|
for (j = 0; j < 3; j++) { |
116 |
|
fputs("\033%O", stdout); |
117 |
< |
putchar(len & 255); |
117 |
> |
putchar(len & 0xff); |
118 |
|
putchar(len >> 8); |
119 |
|
for (i = 0; i < len; i++) { |
120 |
< |
if (y!=0 & i+j) { /* knit bit */ |
121 |
< |
c = pat[i][j]; |
122 |
< |
pat[i][j] = colbit(scan[i],i,j) << 23; |
123 |
< |
} else { |
124 |
< |
c = pat[i][j] | colbit(scan[i],i,j); |
125 |
< |
pat[i][j] = 0; |
126 |
< |
} |
127 |
< |
putchar(c>>16); |
128 |
< |
putchar(c>>8 & 255); |
122 |
< |
putchar(c & 255); |
120 |
> |
c = pat[i][j]; |
121 |
> |
pat[i][j] = c>>4 & 0xf00000; |
122 |
> |
if (i+j & 4) /* knit last bit */ |
123 |
> |
pat[i][j] |= colbit(scan[i],i,j) << 20; |
124 |
> |
else |
125 |
> |
c |= colbit(scan[i],i,j); |
126 |
> |
putchar(c>>16 & 0xff); |
127 |
> |
putchar(c>>8 & 0xff); |
128 |
> |
putchar(c & 0xff); |
129 |
|
} |
130 |
|
putchar('\r'); |
131 |
|
} |