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

Comparing ray/src/common/spec_rgb.c (file contents):
Revision 2.28 by greg, Fri Nov 17 20:02:07 2023 UTC vs.
Revision 2.31 by greg, Fri Dec 8 18:48:09 2023 UTC

# Line 270 | Line 270 | int  e
270          COLOR  ciecolor;
271  
272          spec_cie(ciecolor, s, e);
273 <        cie_rgb(col, ciecolor);
273 >        colortrans(col, xyz2rgbmat, ciecolor);
274   }
275  
276  
# 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 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;
# Line 346 | Line 346 | scolor2rgb(                    /* accurate conversion from spectrum to
346  
347  
348   double
349 < scolor_photopic(                /* compute scotopic integral for spectral color */
350 <        SCOLOR  scol
349 > scolor2photopic(                /* compute scotopic integral for spectral color */
350 >        SCOLOR  scol,
351 >        int ncs,
352 >        const float wlpt[4]
353   )
354   {
355 <        if (NCSAMP == 3)
355 >        if (ncs == 3)
356                  return bright(scol);
357  
358 <        return(spec_dot(scol, NCSAMP, WLPART, cie_y_cumul, CIE_Y_WLMIN, CIE_Y_WLMAX));
358 >        return(spec_dot(scol, ncs, wlpt, cie_y_cumul, CIE_Y_WLMIN, CIE_Y_WLMAX));
359   }
360  
361  
362   double
363 + scolor2scotopic(                /* compute Y channel for spectral color */
364 +        SCOLOR  scol,
365 +        int ncs,
366 +        const float wlpt[4]
367 + )
368 + {
369 +        return(spec_dot(scol, ncs, wlpt, scotopic_cumul, SCOTOPIC_WLMIN, SCOTOPIC_WLMAX));
370 + }
371 +
372 +
373 + double
374 + scolor2melanopic(               /* compute melanopic integral for spectral color */
375 +        SCOLOR  scol,
376 +        int ncs,
377 +        const float wlpt[4]
378 + )
379 + {
380 +        return(spec_dot(scol, ncs, wlpt, melanopic_cumul, MELANOPIC_WLMIN, MELANOPIC_WLMAX));
381 + }
382 +
383 +
384 + double
385 + scolor_photopic(                /* compute scotopic integral for spectral color */
386 +        SCOLOR  scol
387 + )
388 + {
389 +        return(scolor2photopic(scol, NCSAMP, WLPART));
390 + }
391 +
392 +
393 + double
394   scolor_scotopic(                /* compute Y channel for spectral color */
395          SCOLOR  scol
396   )
397   {
398 <        return(spec_dot(scol, NCSAMP, WLPART, scotopic_cumul, SCOTOPIC_WLMIN, SCOTOPIC_WLMAX));
398 >        return(scolor2scotopic(scol, NCSAMP, WLPART));
399   }
400  
401  
# Line 371 | Line 404 | scolor_melanopic(              /* compute melanopic integral for s
404          SCOLOR  scol
405   )
406   {
407 <        return(spec_dot(scol, NCSAMP, WLPART, melanopic_cumul, MELANOPIC_WLMIN, MELANOPIC_WLMAX));
407 >        return(scolor2melanopic(scol, NCSAMP, WLPART));
408   }
409  
410  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines