--- ray/src/px/pcond2.c 1996/10/04 18:34:57 3.3 +++ ray/src/px/pcond2.c 1997/01/30 17:06:27 3.6 @@ -60,10 +60,8 @@ COLOR * nextscan() /* read and condition next scanline */ { if (nread >= numscans(&inpres)) { -#ifdef DEBUG - fputs("done\n", stderr); -#endif - return(NULL); + free((char *)scanbuf); + return(scanbuf = NULL); } if (what2do&DO_ACUITY) acuscan(scanbuf, nread); @@ -99,23 +97,12 @@ firstscan() /* return first processed scanline */ comprgb2rgbmat(mbcond.cmat, inprims, outprims); else compxyz2rgbmat(mbcond.cmat, outprims); - if (what2do&DO_ACUITY) { -#ifdef DEBUG - fprintf(stderr, "%s: initializing acuity sampling...", - progname); -#endif + if (what2do&DO_ACUITY) initacuity(); -#ifdef DEBUG - fprintf(stderr, "done\n"); -#endif - } scanbuf = (COLOR *)malloc(scanlen(&inpres)*sizeof(COLOR)); if (scanbuf == NULL) syserror("malloc"); nread = 0; -#ifdef DEBUG - fprintf(stderr, "%s: processing image...", progname); -#endif return(nextscan()); } @@ -153,6 +140,7 @@ register struct mbc *mb; register int i, j; while (len--) { + colortrans(sl[0], mb->cmat, sl[0]); for (i = 0; i < 3; i++) { d = colval(sl[0],i); for (j = 0; j < 4 && mb->xa[i][j+1] <= d; j++) @@ -161,7 +149,6 @@ register struct mbc *mb; (d - mb->xa[i][j])*mb->ya[i][j+1] ) / (mb->xa[i][j+1] - mb->xa[i][j]); } - colortrans(sl[0], mb->cmat, sl[0]); sl++; } } @@ -229,19 +216,19 @@ register struct mbc *mb; inpflags |= 040; else if (!(inpflags & 0100) && sscanf(buf, - "ro = %f*rn + %f*gn + %f*bn", + "r = %f*r1 + %f*g1 + %f*b1", &mb->cmat[0][0], &mb->cmat[0][1], &mb->cmat[0][2]) == 3) inpflags |= 0100; else if (!(inpflags & 0200) && sscanf(buf, - "go = %f*rn + %f*gn + %f*bn", + "g = %f*r1 + %f*g1 + %f*b1", &mb->cmat[1][0], &mb->cmat[1][1], &mb->cmat[1][2]) == 3) inpflags |= 0200; else if (!(inpflags & 0400) && sscanf(buf, - "bo = %f*rn + %f*gn + %f*bn", + "b = %f*r1 + %f*g1 + %f*b1", &mb->cmat[2][0], &mb->cmat[2][1], &mb->cmat[2][2]) == 3) inpflags |= 0400;