--- ray/src/px/pinterp.c 1995/09/15 22:04:04 2.25 +++ ray/src/px/pinterp.c 1995/10/16 11:40:16 2.27 @@ -76,6 +76,7 @@ COLR backcolr = BLKCOLR; /* background color */ COLOR backcolor = BLKCOLOR; /* background color (float) */ double backz = 0.0; /* background z value */ int normdist = 1; /* i/o normalized distance? */ +char ourfmt[LPICFMT+1] = PICFMT; /* original picture format */ double ourexp = -1; /* original picture exposure */ int expadj = 0; /* exposure adjustment (f-stops) */ double rexpadj = 1; /* real exposure adjustment */ @@ -92,7 +93,7 @@ int PDesc[3] = {-1,-1,-1}; /* rtrace process descript #define childpid (PDesc[2]) unsigned short queue[PACKSIZ][2]; /* pending pixels */ int packsiz; /* actual packet size */ -int queuesiz; /* number of pixels pending */ +int queuesiz = 0; /* number of pixels pending */ extern double movepixel(); @@ -308,7 +309,8 @@ char *argv[]; ourexp = rexpadj; if (ourexp < .995 | ourexp > 1.005) fputexpos(ourexp, stdout); - fputformat(COLRFMT, stdout); + if (strcmp(ourfmt, PICFMT)) /* print format if known */ + fputformat(ourfmt, stdout); putc('\n', stdout); /* write picture */ writepicture(); @@ -334,7 +336,11 @@ char *s; if (isheadid(s)) return; if (formatval(fmt, s)) { - wrongformat = strcmp(fmt, COLRFMT); + if (globmatch(ourfmt, fmt)) { + wrongformat = 0; + strcpy(ourfmt, fmt); + } else + wrongformat = 1; return; } if (nvavg < 2) { @@ -924,6 +930,8 @@ int (*fill)(); for (x = 0; x < hresolu; x++) if (zscan(y)[x] <= 0) (*fill)(x,y); + if (fill == rcalfill) + clearqueue(); } @@ -1178,7 +1186,7 @@ clearqueue() /* process queue */ if (averaging) { setcolor(sscan(queue[i][1])[queue[i][0]], fbp[0], fbp[1], fbp[2]); - wscan(queue[i][1])[queue[i][0]] = MAXWT; + wscan(queue[i][1])[queue[i][0]] = 1; } else setcolr(pscan(queue[i][1])[queue[i][0]], fbp[0], fbp[1], fbp[2]);