7 |
|
*/ |
8 |
|
|
9 |
|
#include "platform.h" |
10 |
+ |
#include "paths.h" |
11 |
+ |
#include "rtprocess.h" |
12 |
|
#include "pcond.h" |
13 |
|
|
14 |
|
|
108 |
|
case 'e': |
109 |
|
if (i+1 >= argc) goto userr; |
110 |
|
scalef = atof(argv[++i]); |
111 |
< |
if (argv[i][0] == '+' | argv[i][0] == '-') |
111 |
> |
if ((argv[i][0] == '+') | (argv[i][0] == '-')) |
112 |
|
scalef = pow(2.0, scalef); |
113 |
|
what2do |= DO_LINEAR; |
114 |
|
break; |
153 |
|
progname); |
154 |
|
exit(1); |
155 |
|
} |
156 |
< |
if (outprims == stdprims & inprims != stdprims) |
156 |
> |
if ((outprims == stdprims) & (inprims != stdprims)) |
157 |
|
outprims = inprims; |
158 |
|
Bldmin = Bl(ldmax/lddyn); |
159 |
|
Bldmax = Bl(ldmax); |
169 |
|
SET_FILE_BINARY(stdout); |
170 |
|
getahead(); /* load input header */ |
171 |
|
printargs(argc, argv, stdout); /* add to output header */ |
172 |
< |
if (mbcalfile == NULL & outprims != stdprims) |
172 |
> |
if ((mbcalfile == NULL) & (outprims != stdprims)) |
173 |
|
fputprims(outprims, stdout); |
174 |
|
if ((what2do & (DO_PREHIST|DO_VEIL|DO_ACUITY)) != DO_PREHIST) |
175 |
|
getfovimg(); /* get foveal sample image? */ |
307 |
|
|
308 |
|
getfovimg() /* load foveal sampled image */ |
309 |
|
{ |
310 |
< |
extern FILE *popen(); |
309 |
< |
char combuf[128]; |
310 |
> |
char combuf[PATH_MAX]; |
311 |
|
FILE *fp; |
312 |
|
int x, y; |
313 |
|
/* compute image size */ |
322 |
|
} |
323 |
|
if ((fovimg = (COLOR *)malloc(fvxr*fvyr*sizeof(COLOR))) == NULL) |
324 |
|
syserror("malloc"); |
325 |
< |
sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d %s", fvxr, fvyr, infn); |
325 |
> |
sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d \"%s\"", fvxr, fvyr, infn); |
326 |
|
if ((fp = popen(combuf, "r")) == NULL) |
327 |
|
syserror("popen"); |
328 |
|
getheader(fp, NULL, NULL); /* skip header */ |
329 |
< |
if (fgetresolu(&x, &y, fp) < 0 || x != fvxr | y != fvyr) |
329 |
> |
if (fgetresolu(&x, &y, fp) < 0 || (x != fvxr) | (y != fvyr)) |
330 |
|
goto readerr; |
331 |
|
for (y = 0; y < fvyr; y++) |
332 |
|
if (freadscan(fovscan(y), fvxr, fp) < 0) |