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

Comparing src/common/spec_rgb.c (file contents):
Revision 2.27 by greg, Wed Nov 15 18:02:52 2023 UTC vs.
Revision 2.29 by greg, Tue Nov 21 01:30:20 2023 UTC

# Line 278 | Line 278 | static double
278   spec_dot(                       /* spectrum dot-product with cumulative observer */
279          SCOLOR scol,
280          int  ncs,
281 <        float wlpt[4],
281 >        const float wlpt[4],
282          const unsigned short cumul[],
283          int  wlmin,
284          int  wlmax
# Line 297 | Line 297 | spec_dot(                      /* spectrum dot-product with cumulative ob
297  
298          while (n < ncs) {
299                  int     wl0 = wl1;
300 <                wl1 = (int)(ncs==3 ? wlpt[ncs-1-n] : wlpt[3] + (n+1)*wlstp);
300 >                wl1 = (int)(ncs==3 ? wlpt[2-n] : wlpt[3] + (n+1)*wlstp);
301                  if (wl1 >= wlmax) {
302 <                        sum += (65535 - cumul[wl0-wlmin]) * scol[n];
302 >                        sum += (65535 - cumul[wl0-wlmin]) * scol[ncs-1-n];
303                          break;
304                  }
305 <                sum += (cumul[wl1-wlmin] - cumul[wl0-wlmin]) * scol[n++];
305 >                sum += (cumul[wl1-wlmin] - cumul[wl0-wlmin]) * scol[ncs-1-n++];
306          }
307          return(sum * (1./65535.));
308   }
# Line 313 | Line 313 | scolor2cie(                    /* accurate conversion from spectrum to
313          COLOR col,
314          SCOLOR scol,
315          int ncs,
316 <        float wlpt[4]
316 >        const float wlpt[4]
317   )
318   {
319          if (ncs == 3) {         /* not a spectrum! */
# Line 331 | Line 331 | scolor2rgb(                    /* accurate conversion from spectrum to
331          COLOR col,
332          SCOLOR scol,
333          int ncs,
334 <        float wlpt[4]
334 >        const float wlpt[4]
335   )
336   {
337          COLOR   ciecolor;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines