1 |
< |
/* Copyright (c) 1992 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1996 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
302 |
|
} |
303 |
|
|
304 |
|
|
305 |
+ |
double |
306 |
+ |
rgb_bright(clr) |
307 |
+ |
COLOR clr; |
308 |
+ |
{ |
309 |
+ |
return(bright(clr)); |
310 |
+ |
} |
311 |
+ |
|
312 |
+ |
|
313 |
+ |
double |
314 |
+ |
xyz_bright(clr) |
315 |
+ |
COLOR clr; |
316 |
+ |
{ |
317 |
+ |
return(clr[CIEY]); |
318 |
+ |
} |
319 |
+ |
|
320 |
+ |
|
321 |
+ |
double (*ourbright)() = rgb_bright; |
322 |
+ |
|
323 |
+ |
|
324 |
|
headline(s) /* process line from header */ |
325 |
|
char *s; |
326 |
|
{ |
329 |
|
fputs(s, stdout); /* copy to output */ |
330 |
|
if (isaspect(s)) /* get aspect ratio */ |
331 |
|
inpaspect *= aspectval(s); |
332 |
< |
else if (isexpos(s)) |
332 |
> |
else if (isexpos(s)) /* get exposure */ |
333 |
|
hotlvl *= exposval(s); |
334 |
< |
else if (isformat(s)) { |
335 |
< |
formatval(fmt, s); |
336 |
< |
wrongformat = strcmp(fmt, COLRFMT); |
334 |
> |
else if (formatval(fmt, s)) { /* get format */ |
335 |
> |
wrongformat = 0; |
336 |
> |
if (!strcmp(COLRFMT, fmt)) |
337 |
> |
ourbright = rgb_bright; |
338 |
> |
else if (!strcmp(CIEFMT, fmt)) |
339 |
> |
ourbright = xyz_bright; |
340 |
> |
else |
341 |
> |
wrongformat = !globmatch(PICFMT, fmt); |
342 |
|
} |
343 |
|
} |
344 |
|
|
454 |
|
rad *= (y_r + x_c)/2.0; |
455 |
|
|
456 |
|
if (thresh > FTINY) { |
433 |
– |
xrad = CHECKRAD*THRESHRAD*rad/x_c + xbrad; |
434 |
– |
yrad = CHECKRAD*THRESHRAD*rad/y_r + ybrad; |
457 |
|
orad = CHECKRAD*THRESHRAD*rad + 1; |
458 |
+ |
xrad = orad/x_c + xbrad; |
459 |
+ |
yrad = orad/y_r + ybrad; |
460 |
|
obarsize = 2*orad + 1; |
461 |
|
} else { |
462 |
|
xrad = CHECKRAD*rad/x_c + 1; |
499 |
|
fputaspect(d, stdout); |
500 |
|
} |
501 |
|
/* record exposure */ |
502 |
< |
d = bright(exposure); |
502 |
> |
d = (*ourbright)(exposure); |
503 |
|
if (!FEQ(d,1.0)) |
504 |
|
fputexpos(d, stdout); |
505 |
|
/* record color correction */ |
526 |
|
int ybot; |
527 |
|
register int c; |
528 |
|
/* average input scanlines */ |
529 |
< |
while (nextrow < r+orad && nextrow < nrows) { |
529 |
> |
while (nextrow <= r+orad && nextrow < nrows) { |
530 |
|
ybot = (long)nextrow*yres/nrows; |
531 |
|
for (c = 0; c < ncols; c++) { |
532 |
|
dobox(ctmp, (int)((long)c*xres/ncols),ybot, c,nextrow); |
533 |
< |
greybar[nextrow%obarsize][c] = bright(ctmp); |
533 |
> |
greybar[nextrow%obarsize][c] = (*ourbright)(ctmp); |
534 |
|
} |
535 |
|
/* and zero output scanline */ |
536 |
|
bzero((char *)scoutbar[nextrow%obarsize], ncols*sizeof(COLOR)); |