91 |
|
if (argv[i+1][0] == '-' || argv[i+1][0] == '+') |
92 |
|
d = pow(2.0, d); |
93 |
|
if (argv[i][0] == '-') |
94 |
< |
doexposure = 100; |
94 |
> |
expval *= d; |
95 |
|
scalecolor(exposure, d); |
96 |
– |
expval *= d; |
96 |
|
doexposure++; |
97 |
|
i++; |
98 |
|
break; |
198 |
|
setmode(fileno(fin), O_BINARY); |
199 |
|
#endif |
200 |
|
/* get header */ |
201 |
< |
if (header && checkheader(fin, fmtid, stdout) < 0) { |
202 |
< |
fprintf(stderr, "%s: wrong input format\n", progname); |
203 |
< |
quit(1); |
204 |
< |
} |
201 |
> |
if (header) { |
202 |
> |
if (checkheader(fin, fmtid, stdout) < 0) { |
203 |
> |
fprintf(stderr, "%s: wrong input format\n", |
204 |
> |
progname); |
205 |
> |
quit(1); |
206 |
> |
} |
207 |
> |
} else |
208 |
> |
newheader("RADIANCE", stdout); |
209 |
|
/* get resolution */ |
210 |
|
if ((resolution && !fgetsresolu(&picres, fin)) || |
211 |
|
picres.xr <= 0 || picres.yr <= 0) { |
214 |
|
} |
215 |
|
/* add to header */ |
216 |
|
printargs(i, argv, stdout); |
217 |
< |
if (doexposure > 100) |
217 |
> |
if (expval < .99 || expval > 1.01) |
218 |
|
fputexpos(expval, stdout); |
219 |
|
fputformat(COLRFMT, stdout); |
220 |
|
putchar('\n'); |
239 |
|
} |
240 |
|
if (header) { |
241 |
|
printargs(i, argv, stdout); |
242 |
< |
if (doexposure > 100) |
242 |
> |
if (expval < .99 || expval > 1.01) |
243 |
|
fputexpos(expval, stdout); |
244 |
|
fputformat(fmtid, stdout); |
245 |
|
putchar('\n'); |
260 |
|
double d; |
261 |
|
COLOR ctmp; |
262 |
|
|
263 |
< |
if (isformat(line)) { |
261 |
< |
formatval(fmt, line); |
263 |
> |
if (formatval(fmt, line)) |
264 |
|
wrongformat = strcmp(fmt, COLRFMT); |
265 |
< |
} else if (original && isexpos(line)) { |
265 |
> |
else if (original && isexpos(line)) { |
266 |
|
d = 1.0/exposval(line); |
267 |
|
scalecolor(exposure, d); |
268 |
|
doexposure++; |