1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
18 |
|
|
19 |
|
double gamma = 2.0; /* gamma correction */ |
20 |
|
|
21 |
+ |
int bradj = 0; /* brightness adjustment */ |
22 |
+ |
|
23 |
|
char *progname; |
24 |
|
|
25 |
|
char errmsg[128]; |
47 |
|
case 'r': |
48 |
|
reverse = !reverse; |
49 |
|
break; |
50 |
+ |
case 'e': |
51 |
+ |
if (argv[i+1][0] != '+' && argv[i+1][0] != '-') |
52 |
+ |
goto userr; |
53 |
+ |
bradj = atoi(argv[++i]); |
54 |
+ |
break; |
55 |
|
default: |
56 |
|
goto userr; |
57 |
|
} |
104 |
|
} |
105 |
|
quiterr(NULL); |
106 |
|
userr: |
107 |
< |
fprintf(stderr, "Usage: %s [-g gamma] {input|-} output\n", progname); |
101 |
< |
fprintf(stderr, " or: %s -r [-g gamma] input [output|-]\n", |
107 |
> |
fprintf(stderr, "Usage: %s [-g gamma][-e +/-stops] {input|-} output\n", |
108 |
|
progname); |
109 |
+ |
fprintf(stderr, " or: %s -r [-g gamma][-e +/-stops] input [output|-]\n", |
110 |
+ |
progname); |
111 |
|
exit(1); |
112 |
|
} |
113 |
|
|
185 |
|
for (j = 0; j < ymax; j++) { |
186 |
|
if (freadcolrs(inl, xmax, rafp) < 0) |
187 |
|
quiterr("error reading RADIANCE file"); |
188 |
+ |
if (bradj) |
189 |
+ |
shiftcolrs(inl, xmax, bradj); |
190 |
|
colrs_gambs(inl, xmax); |
191 |
|
for (i = 0; i < xmax; i++) { |
192 |
|
putc(inl[i][RED], bnfp[0]); |
217 |
|
if (feof(bnfp[0]) || feof(bnfp[1]) || feof(bnfp[2])) |
218 |
|
quiterr("error reading barney file"); |
219 |
|
gambs_colrs(outline, xmax); |
220 |
+ |
if (bradj) |
221 |
+ |
shiftcolrs(outline, xmax, bradj); |
222 |
|
if (fwritecolrs(outline, xmax, rafp) < 0) |
223 |
|
quiterr("error writing RADIANCE file"); |
224 |
|
} |