| 19 |
|
extern char *malloc(); |
| 20 |
|
extern float *matchlamp(); |
| 21 |
|
|
| 22 |
+ |
#define FEQ(a,b) ((a) >= .98*(b) && (a) <= 1.02*(b)) |
| 23 |
+ |
|
| 24 |
|
#define CHECKRAD 1.5 /* radius to check for filtering */ |
| 25 |
|
|
| 26 |
|
COLOR exposure = WHTCOLOR; /* exposure for the frame */ |
| 123 |
|
d = pow(2.0, atof(argv[i+1])); |
| 124 |
|
else |
| 125 |
|
d = atof(argv[i+1]); |
| 126 |
+ |
if (d < 1e-20 || d > 1e20) { |
| 127 |
+ |
fprintf(stderr, |
| 128 |
+ |
"%s: exposure out of range\n", |
| 129 |
+ |
argv[0]); |
| 130 |
+ |
exit(1); |
| 131 |
+ |
} |
| 132 |
|
switch (argv[i][2]) { |
| 133 |
|
case '\0': |
| 134 |
|
scalecolor(exposure, d); |
| 374 |
|
|
| 375 |
|
scan2init() /* prepare scanline arrays */ |
| 376 |
|
{ |
| 377 |
+ |
COLOR ctmp; |
| 378 |
|
double d; |
| 379 |
|
register int i; |
| 380 |
|
|
| 404 |
|
fprintf(stderr, "%s: out of memory\n", progname); |
| 405 |
|
quit(1); |
| 406 |
|
} |
| 407 |
< |
/* record pixel aspect and exposure */ |
| 407 |
> |
/* record pixel aspect ratio */ |
| 408 |
|
if (!correctaspect) { |
| 409 |
|
d = x_c / y_r; |
| 410 |
< |
if (d < .99 || d > 1.01) |
| 410 |
> |
if (!FEQ(d,1.0)) |
| 411 |
|
fputaspect(d, stdout); |
| 412 |
|
} |
| 413 |
+ |
/* record exposure */ |
| 414 |
|
d = bright(exposure); |
| 415 |
< |
if (d < .995 || d > 1.005) |
| 415 |
> |
if (!FEQ(d,1.0)) |
| 416 |
|
fputexpos(d, stdout); |
| 417 |
+ |
/* record color correction */ |
| 418 |
+ |
copycolor(ctmp, exposure); |
| 419 |
+ |
scalecolor(ctmp, 1.0/d); |
| 420 |
+ |
if (!FEQ(colval(ctmp,RED),colval(ctmp,GRN)) || |
| 421 |
+ |
!FEQ(colval(ctmp,GRN),colval(ctmp,BLU))) |
| 422 |
+ |
fputcolcor(ctmp, stdout); |
| 423 |
|
printf("\n"); |
| 424 |
< |
fputresolu(YMAJOR|YDECR, ncols, nrows, stdout); /* resolution */ |
| 424 |
> |
/* write out resolution */ |
| 425 |
> |
fputresolu(YMAJOR|YDECR, ncols, nrows, stdout); |
| 426 |
|
} |
| 427 |
|
|
| 428 |
|
|