| 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 |
|
|
| 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 */ |
| 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)); |