38 |
|
VIEW vwprev = STDVIEW; /* previous view */ |
39 |
|
int fnprev; /* frame number for previous view */ |
40 |
|
|
41 |
– |
char *progname; /* global argv[0] */ |
42 |
– |
|
41 |
|
typedef struct { |
42 |
|
VIEW *vp; /* view pointer */ |
43 |
|
int gotview; /* got view parameters? */ |
50 |
|
headline(char *s, void *p) |
51 |
|
{ |
52 |
|
IMGHEAD *ip = (IMGHEAD *)p; |
53 |
< |
char fmt[32]; |
53 |
> |
char fmt[MAXFMTLEN]; |
54 |
|
|
55 |
|
if (isview(s)) { |
56 |
|
ip->gotview += (sscanview(ip->vp, s) > 0); |
130 |
|
goto readerr; |
131 |
|
fclose(fp); |
132 |
|
sprintf(fname, zbfspec, fno); /* load depth buffer */ |
133 |
< |
if ((fd = open(fname, O_RDONLY)) < 0) { |
133 |
> |
if ((fd = open_float_depth(fname, (long)rs.xr*rs.yr)) < 0) { |
134 |
|
sprintf(errmsg, "cannot open depth buffer \"%s\"", fname); |
135 |
|
error(SYSTEM, errmsg); |
136 |
|
} |
205 |
|
} |
206 |
|
|
207 |
|
|
208 |
< |
/* Fill in missing pixels from immediate neighbors */ |
208 |
> |
/* Expand foreground pixels to mitigate aliasing/fill errors */ |
209 |
|
static void |
210 |
|
fill_missing(void) |
211 |
|
{ |
212 |
|
int n, m; |
213 |
|
|
214 |
|
for (n = imres.xr*imres.yr; n--; ) |
215 |
< |
if (zbuf[n] >= .9*FHUGE && |
218 |
< |
zbuf[m = neigh_zmin(zbuf,n)] < .9*FHUGE) |
215 |
> |
if (zbuf[n] > 1.25*zbuf[m = neigh_zmin(zbuf,n)]) |
216 |
|
copycolor(imbuf[n], imbuf[m]); |
217 |
|
} |
218 |
|
|
389 |
|
{ |
390 |
|
double fstart, fend, fstep, fcur; |
391 |
|
|
392 |
< |
progname = argv[0]; |
392 |
> |
fixargv0(argv[0]); /* sets global progname */ |
393 |
|
SET_DEFAULT_BINARY(); |
394 |
|
if (argc != 5) |
395 |
|
goto userr; |
396 |
|
/* get frame range & sampling */ |
397 |
|
switch (sscanf(argv[1], "%lf,%lf/%d", &fstart, &fend, &nsamps)) { |
398 |
|
case 1: |
402 |
– |
nsamps = 0; |
399 |
|
fend = fstart; |
400 |
+ |
nsamps = 0; |
401 |
|
break; |
402 |
|
case 2: |
403 |
|
nsamps = 0; |
405 |
|
case 3: |
406 |
|
if (fend < fstart) |
407 |
|
goto userr; |
408 |
+ |
if (fend <= fstart+FTINY) |
409 |
+ |
nsamps = 0; |
410 |
|
break; |
411 |
|
default: |
412 |
|
goto userr; |
437 |
|
write_average(stdout); |
438 |
|
return(fflush(stdout) == EOF); |
439 |
|
userr: |
440 |
< |
fprintf(stderr, "Usage: %s f0,f1 HDRspec ZBUFspec MVOspec\n", progname); |
440 |
> |
fprintf(stderr, "Usage: %s f0,f1[/n] HDRspec ZBUFspec MVOspec\n", progname); |
441 |
|
return(1); |
442 |
|
} |