8 |
|
#include <math.h> |
9 |
|
|
10 |
|
#include "rtio.h" |
11 |
+ |
#include "paths.h" |
12 |
|
#include "platform.h" |
13 |
|
#include "color.h" |
14 |
|
#include "tonemap.h" |
19 |
|
|
20 |
|
double gamcor = 2.2; /* gamma correction value */ |
21 |
|
|
21 |
– |
char *progname; |
22 |
– |
|
22 |
|
static void quiterr(const char *err); |
23 |
|
static void tmap2bmp(char *fnin, char *fnout, char *expec, |
24 |
|
RGBPRIMP monpri, double gamval); |
42 |
|
RESOLU rs; |
43 |
|
int i; |
44 |
|
|
45 |
< |
progname = argv[0]; |
45 |
> |
fixargv0(argv[0]); /* assigns progname */ |
46 |
|
|
47 |
|
for (i = 1; i < argc; i++) |
48 |
|
if (argv[i][0] == '-' && argv[i][1]) |
218 |
|
rgbinp = TM_XYZPRIM; |
219 |
|
return(0); |
220 |
|
} |
221 |
+ |
if (!strcmp(fmt,SPECFMT)) |
222 |
+ |
return(0); |
223 |
|
return(-1); |
224 |
|
} |
225 |
|
if (isprims(s)) { /* get input primaries */ |
227 |
|
rgbinp = myinprims; |
228 |
|
return(0); |
229 |
|
} |
230 |
+ |
if (isncomp(s)) { |
231 |
+ |
NCSAMP = ncompval(s); |
232 |
+ |
return(0); |
233 |
+ |
} |
234 |
+ |
if (iswlsplit(s)) { |
235 |
+ |
wlsplitval(WLPART, s); |
236 |
+ |
return(0); |
237 |
+ |
} |
238 |
|
/* should I grok colcorr also? */ |
239 |
|
return(0); |
240 |
|
} |
278 |
|
} |
279 |
|
/* convert each scanline */ |
280 |
|
for ( ; y != yend; y += ystp) { |
281 |
< |
if (freadcolrs(scanin, bwr->hdr->width, rfp) < 0) |
281 |
> |
if (fread2colrs(scanin, bwr->hdr->width, rfp, NCSAMP, WLPART) < 0) |
282 |
|
quiterr("error reading Radiance picture"); |
283 |
|
if (usexfm) |
284 |
|
for (x = bwr->hdr->width; x--; ) { |