61 |
|
COLOR *ourspict; /* output pixel sums (averaging) */ |
62 |
|
float *ourweigh = NULL; /* output pixel weights (averaging) */ |
63 |
|
float *ourzbuf; /* corresponding z-buffer */ |
64 |
< |
COLOR *ourbpict = NULL; /* blurred picture */ |
64 |
> |
COLOR *ourbpict = NULL; /* blurred picture (view averaging) */ |
65 |
|
|
66 |
|
VIEW avgview; /* average view for -B option */ |
67 |
|
int nvavg; /* number of views averaged */ |
76 |
|
COLOR backcolor = BLKCOLOR; /* background color (float) */ |
77 |
|
double backz = 0.0; /* background z value */ |
78 |
|
int normdist = 1; /* i/o normalized distance? */ |
79 |
+ |
char ourfmt[LPICFMT+1] = PICFMT; /* original picture format */ |
80 |
|
double ourexp = -1; /* original picture exposure */ |
81 |
|
int expadj = 0; /* exposure adjustment (f-stops) */ |
82 |
|
double rexpadj = 1; /* real exposure adjustment */ |
93 |
|
#define childpid (PDesc[2]) |
94 |
|
unsigned short queue[PACKSIZ][2]; /* pending pixels */ |
95 |
|
int packsiz; /* actual packet size */ |
96 |
< |
int queuesiz; /* number of pixels pending */ |
96 |
> |
int queuesiz = 0; /* number of pixels pending */ |
97 |
|
|
98 |
|
extern double movepixel(); |
99 |
|
|
252 |
|
rexpadj = pow(2.0, (double)expadj); |
253 |
|
} |
254 |
|
/* set view */ |
255 |
< |
if (nextview(doblur ? stdin : NULL) == EOF) { |
255 |
> |
if (nextview(doblur ? stdin : (FILE *)NULL) == EOF) { |
256 |
|
fprintf(stderr, "%s: no view on standard input!\n", |
257 |
|
progname); |
258 |
|
exit(1); |
309 |
|
ourexp = rexpadj; |
310 |
|
if (ourexp < .995 | ourexp > 1.005) |
311 |
|
fputexpos(ourexp, stdout); |
312 |
< |
fputformat(COLRFMT, stdout); |
312 |
> |
if (strcmp(ourfmt, PICFMT)) /* print format if known */ |
313 |
> |
fputformat(ourfmt, stdout); |
314 |
|
putc('\n', stdout); |
315 |
|
/* write picture */ |
316 |
|
writepicture(); |
336 |
|
if (isheadid(s)) |
337 |
|
return; |
338 |
|
if (formatval(fmt, s)) { |
339 |
< |
wrongformat = strcmp(fmt, COLRFMT); |
339 |
> |
if (globmatch(ourfmt, fmt)) { |
340 |
> |
wrongformat = 0; |
341 |
> |
strcpy(ourfmt, fmt); |
342 |
> |
} else |
343 |
> |
wrongformat = 1; |
344 |
|
return; |
345 |
|
} |
346 |
|
if (nvavg < 2) { |
522 |
|
{ |
523 |
|
double m4t[4][4]; |
524 |
|
|
525 |
< |
if (vw1->type != VT_PER && vw1->type != VT_PAR) |
525 |
> |
if (vw1->type != VT_PER & vw1->type != VT_PAR) |
526 |
|
return(0); |
527 |
< |
if (vw2->type != VT_PER && vw2->type != VT_PAR) |
527 |
> |
if (vw2->type != VT_PER & vw2->type != VT_PAR) |
528 |
|
return(0); |
529 |
|
setident4(xfmat); |
530 |
|
xfmat[0][0] = vw1->hvec[0]; |
641 |
|
y1 = p0->y + c1*s1y/l1; |
642 |
|
for (c2 = l2; c2-- > 0; ) { |
643 |
|
x = x1 + c2*s2x/l2; |
644 |
< |
if (x < 0 || x >= hresolu) |
644 |
> |
if (x < 0 | x >= hresolu) |
645 |
|
continue; |
646 |
|
y = y1 + c2*s2y/l2; |
647 |
< |
if (y < 0 || y >= vresolu) |
647 |
> |
if (y < 0 | y >= vresolu) |
648 |
|
continue; |
649 |
|
if (averaging) { |
650 |
|
if (zscan(y)[x] <= 0 || zscan(y)[x]-z |
679 |
|
if (usematrix) { |
680 |
|
pos[0] += theirview.hoff - .5; |
681 |
|
pos[1] += theirview.voff - .5; |
682 |
< |
if (normdist && theirview.type == VT_PER) |
682 |
> |
if (normdist & theirview.type == VT_PER) |
683 |
|
d = sqrt(1. + pos[0]*pos[0]*theirview.hn2 |
684 |
|
+ pos[1]*pos[1]*theirview.vn2); |
685 |
|
else |
713 |
|
if (pos[2] <= 0) |
714 |
|
return(0); |
715 |
|
} |
716 |
< |
if (pos[0] < 0 || pos[0] >= 1-FTINY || pos[1] < 0 || pos[1] >= 1-FTINY) |
716 |
> |
if (pos[0] < 0 | pos[0] >= 1-FTINY | pos[1] < 0 | pos[1] >= 1-FTINY) |
717 |
|
return(0); |
718 |
|
if (!averaging) |
719 |
|
return(1); |
930 |
|
for (x = 0; x < hresolu; x++) |
931 |
|
if (zscan(y)[x] <= 0) |
932 |
|
(*fill)(x,y); |
933 |
+ |
if (fill == rcalfill) |
934 |
+ |
clearqueue(); |
935 |
|
} |
936 |
|
|
937 |
|
|