| 19 |
|
#include "calcomp.h" |
| 20 |
|
|
| 21 |
|
#define MAXINP 32 /* maximum number of input files */ |
| 22 |
+ |
#define WINSIZ 9 /* scanline window size */ |
| 23 |
+ |
#define MIDSCN 4 /* current scan position */ |
| 24 |
|
|
| 25 |
|
struct { |
| 26 |
< |
char *name; /* file name */ |
| 26 |
> |
char *name; /* file or command name */ |
| 27 |
|
FILE *fp; /* stream pointer */ |
| 28 |
< |
COLOR *scan; /* input scanline */ |
| 28 |
> |
COLOR *scan[WINSIZ]; /* input scanline window */ |
| 29 |
|
COLOR coef; /* coefficient */ |
| 30 |
+ |
COLOR expos; /* recorded exposure */ |
| 31 |
|
} input[MAXINP]; /* input pictures */ |
| 32 |
|
|
| 33 |
|
int nfiles; /* number of input files */ |
| 34 |
|
|
| 35 |
< |
char *vcolin[3] = {"ri", "gi", "bi"}; |
| 36 |
< |
char *vcolout[3] = {"ro", "go", "bo"}; |
| 37 |
< |
#define vbrtin "li" |
| 38 |
< |
#define vbrtout "lo" |
| 35 |
> |
char vcolin[3][4] = {"ri", "gi", "bi"}; |
| 36 |
> |
char vcolout[3][4] = {"ro", "go", "bo"}; |
| 37 |
> |
char vbrtin[] = "li"; |
| 38 |
> |
char vbrtout[] = "lo"; |
| 39 |
> |
char vcolexp[3][4] = {"re", "ge", "be"}; |
| 40 |
> |
char vbrtexp[] = "le"; |
| 41 |
|
|
| 42 |
< |
#define vnfiles "nfiles" |
| 43 |
< |
#define vxres "xres" |
| 44 |
< |
#define vyres "yres" |
| 45 |
< |
#define vxpos "x" |
| 46 |
< |
#define vypos "y" |
| 42 |
> |
char vnfiles[] = "nfiles"; |
| 43 |
> |
char vxmax[] = "xmax"; |
| 44 |
> |
char vymax[] = "ymax"; |
| 45 |
> |
char vxres[] = "xres"; |
| 46 |
> |
char vyres[] = "yres"; |
| 47 |
> |
char vxpos[] = "x"; |
| 48 |
> |
char vypos[] = "y"; |
| 49 |
|
|
| 50 |
|
int nowarn = 0; /* no warning messages? */ |
| 51 |
|
|
| 52 |
< |
int xres=0, yres=0; /* picture resolution */ |
| 52 |
> |
int xmax = 0, ymax = 0; /* input resolution */ |
| 53 |
|
|
| 54 |
< |
int xpos, ypos; /* picture position */ |
| 54 |
> |
int xscan, yscan; /* input position */ |
| 55 |
|
|
| 56 |
+ |
int xres, yres; /* output resolution */ |
| 57 |
|
|
| 58 |
< |
tputs(s) /* put out string preceded by a tab */ |
| 51 |
< |
char *s; |
| 52 |
< |
{ |
| 53 |
< |
putchar('\t'); |
| 54 |
< |
fputs(s, stdout); |
| 55 |
< |
} |
| 58 |
> |
int xpos, ypos; /* output position */ |
| 59 |
|
|
| 60 |
+ |
int wrongformat = 0; |
| 61 |
|
|
| 62 |
+ |
FILE *popen(); |
| 63 |
+ |
|
| 64 |
+ |
|
| 65 |
|
main(argc, argv) |
| 66 |
|
int argc; |
| 67 |
|
char *argv[]; |
| 68 |
|
{ |
| 69 |
< |
extern double l_redin(), l_grnin(), l_bluin(), l_brtin(), atof(); |
| 69 |
> |
int original; |
| 70 |
|
double f; |
| 71 |
< |
int a; |
| 72 |
< |
|
| 73 |
< |
funset(vcolin[RED], 1, l_redin); |
| 67 |
< |
funset(vcolin[GRN], 1, l_grnin); |
| 68 |
< |
funset(vcolin[BLU], 1, l_bluin); |
| 69 |
< |
funset(vbrtin, 1, l_brtin); |
| 70 |
< |
|
| 71 |
< |
for (a = 1; a < argc; a++) |
| 71 |
> |
int a, i; |
| 72 |
> |
/* scan options */ |
| 73 |
> |
for (a = 1; a < argc; a++) { |
| 74 |
|
if (argv[a][0] == '-') |
| 75 |
|
switch (argv[a][1]) { |
| 74 |
– |
case '\0': |
| 75 |
– |
case 's': |
| 76 |
– |
case 'c': |
| 77 |
– |
goto getfiles; |
| 76 |
|
case 'x': |
| 79 |
– |
xres = atoi(argv[++a]); |
| 80 |
– |
break; |
| 77 |
|
case 'y': |
| 78 |
< |
yres = atoi(argv[++a]); |
| 79 |
< |
break; |
| 78 |
> |
a++; |
| 79 |
> |
continue; |
| 80 |
|
case 'w': |
| 81 |
|
nowarn = !nowarn; |
| 82 |
< |
break; |
| 82 |
> |
continue; |
| 83 |
|
case 'f': |
| 88 |
– |
fcompile(argv[++a]); |
| 89 |
– |
break; |
| 84 |
|
case 'e': |
| 85 |
< |
scompile(argv[++a], NULL, 0); |
| 86 |
< |
break; |
| 93 |
< |
default: |
| 94 |
< |
goto usage; |
| 85 |
> |
a++; |
| 86 |
> |
continue; |
| 87 |
|
} |
| 88 |
< |
else |
| 89 |
< |
break; |
| 90 |
< |
getfiles: |
| 91 |
< |
for (nfiles = 0; nfiles < MAXINP; nfiles++) |
| 88 |
> |
break; |
| 89 |
> |
} |
| 90 |
> |
/* process files */ |
| 91 |
> |
for (nfiles = 0; nfiles < MAXINP; nfiles++) { |
| 92 |
|
setcolor(input[nfiles].coef, 1.0, 1.0, 1.0); |
| 93 |
+ |
setcolor(input[nfiles].expos, 1.0, 1.0, 1.0); |
| 94 |
+ |
} |
| 95 |
|
nfiles = 0; |
| 96 |
+ |
original = 0; |
| 97 |
|
for ( ; a < argc; a++) { |
| 98 |
|
if (nfiles >= MAXINP) { |
| 99 |
|
eputs(argv[0]); |
| 106 |
|
input[nfiles].name = "<stdin>"; |
| 107 |
|
input[nfiles].fp = stdin; |
| 108 |
|
break; |
| 109 |
+ |
case 'o': |
| 110 |
+ |
original++; |
| 111 |
+ |
continue; |
| 112 |
|
case 's': |
| 113 |
|
f = atof(argv[++a]); |
| 114 |
|
scalecolor(input[nfiles].coef, f); |
| 123 |
|
} |
| 124 |
|
else { |
| 125 |
|
input[nfiles].name = argv[a]; |
| 126 |
< |
input[nfiles].fp = fopen(argv[a], "r"); |
| 126 |
> |
input[nfiles].fp = argv[a][0]=='!' ? |
| 127 |
> |
popen(argv[a]+1, "r") : |
| 128 |
> |
fopen(argv[a], "r"); |
| 129 |
|
if (input[nfiles].fp == NULL) { |
| 130 |
|
perror(argv[a]); |
| 131 |
|
quit(1); |
| 132 |
|
} |
| 133 |
|
} |
| 134 |
< |
fputs(input[nfiles].name, stdout); |
| 135 |
< |
fputs(":\n", stdout); |
| 136 |
< |
getheader(input[nfiles].fp, tputs); |
| 137 |
< |
if (fgetresolu(&xpos, &ypos, input[nfiles].fp) != |
| 138 |
< |
(YMAJOR|YDECR)) { |
| 139 |
< |
eputs(input[nfiles].name); |
| 140 |
< |
eputs(": bad picture size\n"); |
| 141 |
< |
quit(1); |
| 134 |
> |
checkfile(); |
| 135 |
> |
if (original) { |
| 136 |
> |
colval(input[nfiles].coef,RED) /= |
| 137 |
> |
colval(input[nfiles].expos,RED); |
| 138 |
> |
colval(input[nfiles].coef,GRN) /= |
| 139 |
> |
colval(input[nfiles].expos,GRN); |
| 140 |
> |
colval(input[nfiles].coef,BLU) /= |
| 141 |
> |
colval(input[nfiles].expos,BLU); |
| 142 |
|
} |
| 143 |
– |
if (xres == 0 && yres == 0) { |
| 144 |
– |
xres = xpos; |
| 145 |
– |
yres = ypos; |
| 146 |
– |
} else if (xpos != xres || ypos != yres) { |
| 147 |
– |
eputs(argv[0]); |
| 148 |
– |
eputs(": resolution mismatch\n"); |
| 149 |
– |
quit(1); |
| 150 |
– |
} |
| 151 |
– |
input[nfiles].scan = (COLOR *)emalloc(xres*sizeof(COLOR)); |
| 143 |
|
nfiles++; |
| 144 |
+ |
original = 0; |
| 145 |
|
} |
| 146 |
+ |
init(); /* set constants */ |
| 147 |
+ |
/* go back and get expressions */ |
| 148 |
+ |
for (a = 1; a < argc; a++) { |
| 149 |
+ |
if (argv[a][0] == '-') |
| 150 |
+ |
switch (argv[a][1]) { |
| 151 |
+ |
case 'x': |
| 152 |
+ |
varset(vxres, ':', eval(argv[++a])); |
| 153 |
+ |
continue; |
| 154 |
+ |
case 'y': |
| 155 |
+ |
varset(vyres, ':', eval(argv[++a])); |
| 156 |
+ |
continue; |
| 157 |
+ |
case 'w': |
| 158 |
+ |
continue; |
| 159 |
+ |
case 'f': |
| 160 |
+ |
fcompile(argv[++a]); |
| 161 |
+ |
continue; |
| 162 |
+ |
case 'e': |
| 163 |
+ |
scompile(argv[++a], NULL, 0); |
| 164 |
+ |
continue; |
| 165 |
+ |
} |
| 166 |
+ |
break; |
| 167 |
+ |
} |
| 168 |
+ |
/* set/get output resolution */ |
| 169 |
+ |
if (!vardefined(vxres)) |
| 170 |
+ |
varset(vxres, ':', (double)xmax); |
| 171 |
+ |
if (!vardefined(vyres)) |
| 172 |
+ |
varset(vyres, ':', (double)ymax); |
| 173 |
+ |
xres = varvalue(vxres) + .5; |
| 174 |
+ |
yres = varvalue(vyres) + .5; |
| 175 |
+ |
if (xres <= 0 || yres <= 0) { |
| 176 |
+ |
eputs(argv[0]); |
| 177 |
+ |
eputs(": illegal output resolution\n"); |
| 178 |
+ |
quit(1); |
| 179 |
+ |
} |
| 180 |
+ |
/* complete header */ |
| 181 |
|
printargs(argc, argv, stdout); |
| 182 |
+ |
fputformat(COLRFMT, stdout); |
| 183 |
|
putchar('\n'); |
| 184 |
|
fputresolu(YMAJOR|YDECR, xres, yres, stdout); |
| 185 |
+ |
/* combine pictures */ |
| 186 |
|
combine(); |
| 187 |
|
quit(0); |
| 188 |
|
usage: |
| 189 |
|
eputs("Usage: "); |
| 190 |
|
eputs(argv[0]); |
| 191 |
< |
eputs(" [-w][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] picture ..]\n"); |
| 191 |
> |
eputs( |
| 192 |
> |
" [-w][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n"); |
| 193 |
|
quit(1); |
| 194 |
|
} |
| 195 |
|
|
| 196 |
|
|
| 197 |
+ |
tputs(s) /* put out string preceded by a tab */ |
| 198 |
+ |
char *s; |
| 199 |
+ |
{ |
| 200 |
+ |
char fmt[32]; |
| 201 |
+ |
double d; |
| 202 |
+ |
COLOR ctmp; |
| 203 |
+ |
|
| 204 |
+ |
if (isformat(s)) { /* check format */ |
| 205 |
+ |
formatval(fmt, s); |
| 206 |
+ |
wrongformat = strcmp(fmt, COLRFMT); |
| 207 |
+ |
return; /* don't echo */ |
| 208 |
+ |
} |
| 209 |
+ |
if (isexpos(s)) { /* exposure */ |
| 210 |
+ |
d = exposval(s); |
| 211 |
+ |
scalecolor(input[nfiles].expos, d); |
| 212 |
+ |
} else if (iscolcor(s)) { /* color correction */ |
| 213 |
+ |
colcorval(ctmp, s); |
| 214 |
+ |
multcolor(input[nfiles].expos, ctmp); |
| 215 |
+ |
} |
| 216 |
+ |
/* echo line */ |
| 217 |
+ |
putchar('\t'); |
| 218 |
+ |
fputs(s, stdout); |
| 219 |
+ |
} |
| 220 |
+ |
|
| 221 |
+ |
|
| 222 |
+ |
checkfile() /* ready a file */ |
| 223 |
+ |
{ |
| 224 |
+ |
int xinp, yinp; |
| 225 |
+ |
register int i; |
| 226 |
+ |
/* process header */ |
| 227 |
+ |
fputs(input[nfiles].name, stdout); |
| 228 |
+ |
fputs(":\n", stdout); |
| 229 |
+ |
getheader(input[nfiles].fp, tputs, NULL); |
| 230 |
+ |
if (wrongformat) { |
| 231 |
+ |
eputs(input[nfiles].name); |
| 232 |
+ |
eputs(": not in Radiance picture format\n"); |
| 233 |
+ |
quit(1); |
| 234 |
+ |
} |
| 235 |
+ |
if (fgetresolu(&xinp, &yinp, input[nfiles].fp) != (YMAJOR|YDECR)) { |
| 236 |
+ |
eputs(input[nfiles].name); |
| 237 |
+ |
eputs(": bad picture size\n"); |
| 238 |
+ |
quit(1); |
| 239 |
+ |
} |
| 240 |
+ |
if (xmax == 0 && ymax == 0) { |
| 241 |
+ |
xmax = xinp; |
| 242 |
+ |
ymax = yinp; |
| 243 |
+ |
} else if (xinp != xmax || yinp != ymax) { |
| 244 |
+ |
eputs(input[nfiles].name); |
| 245 |
+ |
eputs(": resolution mismatch\n"); |
| 246 |
+ |
quit(1); |
| 247 |
+ |
} |
| 248 |
+ |
/* allocate scanlines */ |
| 249 |
+ |
for (i = 0; i < WINSIZ; i++) |
| 250 |
+ |
input[nfiles].scan[i] = (COLOR *)emalloc(xmax*sizeof(COLOR)); |
| 251 |
+ |
} |
| 252 |
+ |
|
| 253 |
+ |
|
| 254 |
+ |
init() /* perform final setup */ |
| 255 |
+ |
{ |
| 256 |
+ |
double l_colin(), l_expos(); |
| 257 |
+ |
register int i; |
| 258 |
+ |
/* define constants */ |
| 259 |
+ |
varset(vnfiles, ':', (double)nfiles); |
| 260 |
+ |
varset(vxmax, ':', (double)xmax); |
| 261 |
+ |
varset(vymax, ':', (double)ymax); |
| 262 |
+ |
/* set functions */ |
| 263 |
+ |
for (i = 0; i < 3; i++) { |
| 264 |
+ |
funset(vcolexp[i], 1, ':', l_expos); |
| 265 |
+ |
funset(vcolin[i], 1, '=', l_colin); |
| 266 |
+ |
} |
| 267 |
+ |
funset(vbrtexp, 1, ':', l_expos); |
| 268 |
+ |
funset(vbrtin, 1, '=', l_colin); |
| 269 |
+ |
} |
| 270 |
+ |
|
| 271 |
+ |
|
| 272 |
|
combine() /* combine pictures */ |
| 273 |
|
{ |
| 274 |
|
EPNODE *coldef[3], *brtdef; |
| 286 |
|
brtdef = eparse(vbrtout); |
| 287 |
|
else |
| 288 |
|
brtdef = NULL; |
| 184 |
– |
/* predefine variables */ |
| 185 |
– |
varset(vnfiles, (double)nfiles); |
| 186 |
– |
varset(vxres, (double)xres); |
| 187 |
– |
varset(vyres, (double)yres); |
| 289 |
|
/* allocate scanline */ |
| 290 |
|
scanout = (COLOR *)emalloc(xres*sizeof(COLOR)); |
| 291 |
+ |
/* set input position */ |
| 292 |
+ |
yscan = ymax+MIDSCN; |
| 293 |
|
/* combine files */ |
| 294 |
|
for (ypos = yres-1; ypos >= 0; ypos--) { |
| 295 |
< |
for (i = 0; i < nfiles; i++) |
| 296 |
< |
if (freadscan(input[i].scan, xres, input[i].fp) < 0) { |
| 194 |
< |
eputs(input[i].name); |
| 195 |
< |
eputs(": read error\n"); |
| 196 |
< |
quit(1); |
| 197 |
< |
} |
| 198 |
< |
varset(vypos, (double)ypos); |
| 295 |
> |
advance(); |
| 296 |
> |
varset(vypos, '=', (double)ypos); |
| 297 |
|
for (xpos = 0; xpos < xres; xpos++) { |
| 298 |
< |
varset(vxpos, (double)xpos); |
| 298 |
> |
xscan = (long)xpos*xmax/xres; |
| 299 |
> |
varset(vxpos, '=', (double)xpos); |
| 300 |
|
eclock++; |
| 301 |
|
if (brtdef != NULL) { |
| 302 |
|
d = evalue(brtdef); |
| 306 |
|
} else { |
| 307 |
|
for (j = 0; j < 3; j++) { |
| 308 |
|
if (coldef[j] != NULL) { |
| 309 |
< |
colval(scanout[xpos],j) = evalue(coldef[j]); |
| 309 |
> |
d = evalue(coldef[j]); |
| 310 |
|
} else { |
| 311 |
< |
colval(scanout[xpos],j) = 0.0; |
| 311 |
> |
d = 0.0; |
| 312 |
|
for (i = 0; i < nfiles; i++) |
| 313 |
< |
colval(scanout[xpos],j) += |
| 215 |
< |
colval(input[i].coef,j) * |
| 216 |
< |
colval(input[i].scan[xpos],j); |
| 313 |
> |
d += colval(input[i].scan[MIDSCN][xscan],j); |
| 314 |
|
} |
| 315 |
< |
if (colval(scanout[xpos],j) < 0.0) |
| 316 |
< |
colval(scanout[xpos],j) = 0.0; |
| 315 |
> |
if (d < 0.0) |
| 316 |
> |
d = 0.0; |
| 317 |
> |
colval(scanout[xpos],j) = d; |
| 318 |
|
} |
| 319 |
|
} |
| 320 |
|
} |
| 327 |
|
} |
| 328 |
|
|
| 329 |
|
|
| 330 |
< |
double |
| 233 |
< |
colin(fn, ci) /* return color value for picture */ |
| 234 |
< |
register int fn, ci; |
| 330 |
> |
advance() /* read in data for next scanline */ |
| 331 |
|
{ |
| 332 |
< |
if (fn == 0) |
| 333 |
< |
return((double)nfiles); |
| 334 |
< |
if (fn < 1 || fn > nfiles) { |
| 239 |
< |
errno = EDOM; |
| 240 |
< |
return(0.0); |
| 241 |
< |
} |
| 242 |
< |
return(colval(input[fn-1].scan[xpos],ci)); |
| 243 |
< |
} |
| 332 |
> |
int ytarget; |
| 333 |
> |
register COLOR *st; |
| 334 |
> |
register int i, j; |
| 335 |
|
|
| 336 |
< |
|
| 337 |
< |
double |
| 338 |
< |
l_redin() /* get red color */ |
| 339 |
< |
{ |
| 340 |
< |
return(colin((int)(argument(1)+.5), RED)); |
| 336 |
> |
for (ytarget = (long)ypos*ymax/yres; yscan > ytarget; yscan--) |
| 337 |
> |
for (i = 0; i < nfiles; i++) { |
| 338 |
> |
st = input[i].scan[WINSIZ-1]; |
| 339 |
> |
for (j = WINSIZ-1; j > 0; j--) /* rotate window */ |
| 340 |
> |
input[i].scan[j] = input[i].scan[j-1]; |
| 341 |
> |
input[i].scan[0] = st; |
| 342 |
> |
if (yscan <= MIDSCN) /* hit bottom? */ |
| 343 |
> |
continue; |
| 344 |
> |
if (freadscan(st, xmax, input[i].fp) < 0) { /* read */ |
| 345 |
> |
eputs(input[i].name); |
| 346 |
> |
eputs(": read error\n"); |
| 347 |
> |
quit(1); |
| 348 |
> |
} |
| 349 |
> |
for (j = 0; j < xmax; j++) /* adjust color */ |
| 350 |
> |
multcolor(st[j], input[i].coef); |
| 351 |
> |
} |
| 352 |
|
} |
| 353 |
|
|
| 354 |
|
|
| 355 |
|
double |
| 356 |
< |
l_grnin() /* get green color */ |
| 356 |
> |
l_expos(nam) /* return picture exposure */ |
| 357 |
> |
register char *nam; |
| 358 |
|
{ |
| 359 |
< |
return(colin((int)(argument(1)+.5), GRN)); |
| 257 |
< |
} |
| 359 |
> |
register int fn, n; |
| 360 |
|
|
| 361 |
< |
|
| 362 |
< |
double |
| 363 |
< |
l_bluin() /* get blue color */ |
| 364 |
< |
{ |
| 365 |
< |
return(colin((int)(argument(1)+.5), BLU)); |
| 361 |
> |
fn = argument(1) - .5; |
| 362 |
> |
if (fn < 0 || fn >= nfiles) |
| 363 |
> |
return(1.0); |
| 364 |
> |
if (nam == vbrtexp) |
| 365 |
> |
return(bright(input[fn].expos)); |
| 366 |
> |
n = 3; |
| 367 |
> |
while (n--) |
| 368 |
> |
if (nam == vcolexp[n]) |
| 369 |
> |
return(colval(input[fn].expos,n)); |
| 370 |
> |
eputs("Bad call to l_expos()!\n"); |
| 371 |
> |
quit(1); |
| 372 |
|
} |
| 373 |
|
|
| 374 |
|
|
| 375 |
|
double |
| 376 |
< |
l_brtin() /* get brightness value */ |
| 376 |
> |
l_colin(nam) /* return color value for picture */ |
| 377 |
> |
register char *nam; |
| 378 |
|
{ |
| 379 |
< |
register int fn; |
| 379 |
> |
int fn; |
| 380 |
> |
register int n, xoff, yoff; |
| 381 |
> |
double d; |
| 382 |
|
|
| 383 |
< |
fn = argument(1)+.5; |
| 384 |
< |
if (fn == 0) |
| 383 |
> |
d = argument(1); |
| 384 |
> |
if (d > -.5 && d < .5) |
| 385 |
|
return((double)nfiles); |
| 386 |
< |
if (fn < 1 || fn > nfiles) { |
| 386 |
> |
fn = d - .5; |
| 387 |
> |
if (fn < 0 || fn >= nfiles) { |
| 388 |
|
errno = EDOM; |
| 389 |
|
return(0.0); |
| 390 |
|
} |
| 391 |
< |
return(bright(input[fn-1].scan[xpos])); |
| 391 |
> |
xoff = yoff = 0; |
| 392 |
> |
n = nargum(); |
| 393 |
> |
if (n >= 2) { |
| 394 |
> |
d = argument(2); |
| 395 |
> |
if (d < 0.0) { |
| 396 |
> |
xoff = d-.5; |
| 397 |
> |
if (xscan+xoff < 0) |
| 398 |
> |
xoff = -xscan; |
| 399 |
> |
} else { |
| 400 |
> |
xoff = d+.5; |
| 401 |
> |
if (xscan+xoff >= xmax) |
| 402 |
> |
xoff = xmax-1-xscan; |
| 403 |
> |
} |
| 404 |
> |
} |
| 405 |
> |
if (n >= 3) { |
| 406 |
> |
d = argument(3); |
| 407 |
> |
if (d < 0.0) { |
| 408 |
> |
yoff = d-.5; |
| 409 |
> |
if (yoff+MIDSCN < 0) |
| 410 |
> |
yoff = -MIDSCN; |
| 411 |
> |
if (yscan+yoff < 0) |
| 412 |
> |
yoff = -yscan; |
| 413 |
> |
} else { |
| 414 |
> |
yoff = d+.5; |
| 415 |
> |
if (yoff+MIDSCN >= WINSIZ) |
| 416 |
> |
yoff = WINSIZ-1-MIDSCN; |
| 417 |
> |
if (yscan+yoff >= ymax) |
| 418 |
> |
yoff = ymax-1-yscan; |
| 419 |
> |
} |
| 420 |
> |
} |
| 421 |
> |
if (nam == vbrtin) |
| 422 |
> |
return(bright(input[fn].scan[MIDSCN+yoff][xscan+xoff])); |
| 423 |
> |
n = 3; |
| 424 |
> |
while (n--) |
| 425 |
> |
if (nam == vcolin[n]) |
| 426 |
> |
return(colval(input[fn].scan[MIDSCN+yoff][xscan+xoff],n)); |
| 427 |
> |
eputs("Bad call to l_colin()!\n"); |
| 428 |
> |
quit(1); |
| 429 |
|
} |
| 430 |
|
|
| 431 |
|
|