ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/ccolor.c
(Generate patch)

Comparing ray/src/common/ccolor.c (file contents):
Revision 3.5 by greg, Tue Jun 26 17:59:16 2012 UTC vs.
Revision 3.6 by greg, Tue Jul 17 23:40:24 2012 UTC

# Line 112 | Line 112 | c_fromSharpRGB(float cin[3], C_COLOR *cout)
112          return(xyz[1]);
113   }
114  
115 < /* assign arbitrary spectrum */
115 > /* assign arbitrary spectrum and return Y value */
116   double
117   c_sset(C_COLOR *clr, double wlmin, double wlmax, const float spec[], int nwl)
118   {
# Line 134 | Line 134 | c_sset(C_COLOR *clr, double wlmin, double wlmax, const
134                  wlmax -= wlstep;
135                  --nwl;
136          }
137 +        if ((nwl <= 1) | (wlmin >= wlmax))
138 +                return(0.);
139          imax = nwl;                     /* box filter if necessary */
140          boxpos = 0;
141          boxstep = 1;
# Line 229 | Line 231 | c_ccvt(C_COLOR *clr, int fl)
231                  clr->cx = x / z;
232                  clr->cy = y / z;
233                  clr->flags |= C_CSXY;
234 <        } else if (fl & C_CSSPEC) {     /* cxy -> cspec */
234 >        }
235 >        if (fl & C_CSSPEC) {            /* cxy -> cspec */
236                  x = clr->cx;
237                  y = clr->cy;
238                  z = 1. - x - y;
# Line 331 | Line 334 | c_cmult(C_COLOR *cres, C_COLOR *c1, double y1, C_COLOR
334                          cres->ssum += cres->ssamp[i] = cmix[i] / cmax;
335                  cres->flags = C_CDSPEC|C_CSSPEC;
336  
337 <                c_ccvt(cres, C_CSEFF);                  /* don't touch below */
337 >                c_ccvt(cres, C_CSEFF);                  /* below is correct */
338                  yres = y1 * y2 * c_y31.ssum * C_CLPWM /
339                          (c1->eff*c1->ssum * c2->eff*c2->ssum) *
340                          cres->eff*( cres->ssum*(double)cmax +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines