--- ray/src/px/pcond2.c 1997/02/05 16:08:18 3.8 +++ ray/src/px/pcond2.c 2003/07/27 22:12:03 3.11 @@ -1,11 +1,9 @@ -/* Copyright (c) 1997 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: pcond2.c,v 3.11 2003/07/27 22:12:03 schorsch Exp $"; #endif - /* * Input and output conditioning routines for pcond. + * Added white-balance adjustment 10/01 (GW). */ #include "pcond.h" @@ -67,7 +65,7 @@ nextscan() /* read and condition next scanline */ if (nread >= numscans(&inpres)) { if (cwarpfile != NULL) free3dw(cwarp); - free((char *)scanbuf); + free((void *)scanbuf); return(scanbuf = NULL); } if (what2do&DO_ACUITY) @@ -89,7 +87,7 @@ nextscan() /* read and condition next scanline */ mbscan(scanbuf, scanlen(&inpres), &mbcond); else if (cwarpfile != NULL) /* device color space warp */ cwscan(scanbuf, scanlen(&inpres), cwarp); - else if (lumf == cielum | inprims != outprims) + else if ((lumf == cielum) | (inprims != outprims)) matscan(scanbuf, scanlen(&inpres), mbcond.cmat); nread++; return(scanbuf); @@ -106,9 +104,9 @@ firstscan() /* return first processed scanline */ syserror(cwarpfile); } else if (lumf == rgblum) - comprgb2rgbmat(mbcond.cmat, inprims, outprims); + comprgb2rgbWBmat(mbcond.cmat, inprims, outprims); else - compxyz2rgbmat(mbcond.cmat, outprims); + compxyz2rgbWBmat(mbcond.cmat, outprims); if (what2do&DO_ACUITY) initacuity(); scanbuf = (COLOR *)malloc(scanlen(&inpres)*sizeof(COLOR)); @@ -253,19 +251,19 @@ register struct mbc *mb; inpflags |= 040; else if (!(inpflags & 0100) && sscanf(buf, - "r = %f*r1 + %f*g1 + %f*b1", + "ro = %f*rn + %f*gn + %f*bn", &mb->cmat[0][0], &mb->cmat[0][1], &mb->cmat[0][2]) == 3) inpflags |= 0100; else if (!(inpflags & 0200) && sscanf(buf, - "g = %f*r1 + %f*g1 + %f*b1", + "go = %f*rn + %f*gn + %f*bn", &mb->cmat[1][0], &mb->cmat[1][1], &mb->cmat[1][2]) == 3) inpflags |= 0200; else if (!(inpflags & 0400) && sscanf(buf, - "b = %f*r1 + %f*g1 + %f*b1", + "bo = %f*rn + %f*gn + %f*bn", &mb->cmat[2][0], &mb->cmat[2][1], &mb->cmat[2][2]) == 3) inpflags |= 0400;