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.32 by greg, Wed Jan 17 17:36:20 2024 UTC vs.
Revision 2.33 by greg, Mon Aug 12 18:57:00 2024 UTC

# Line 346 | Line 346 | scolor2rgb(                    /* accurate conversion from spectrum to
346   }
347  
348  
349 + void
350 + scolor_out(                     /* prepare (spectral) color for output */
351 +        COLORV *cout,
352 +        RGBPRIMP primp,
353 +        SCOLOR cres
354 + )
355 + {
356 +        static COLORMAT xyz2myp;
357 +        static RGBPRIMP lastp = NULL;
358 +
359 +        if (!primp) {                   /* output is spectral */
360 +                copyscolor(cout, cres);
361 +        } else if (primp == stdprims) { /* output is standard RGB */
362 +                scolor_rgb(cout, cres);
363 +        } else if (primp == xyzprims) { /* output is XYZ */
364 +                scolor_cie(cout, cres);
365 +                scalecolor(cout, WHTEFFICACY);
366 +        } else if (NCSAMP > 3) {        /* spectral -> custom RGB */
367 +                COLOR   xyz;
368 +                if (lastp != primp)
369 +                        compxyz2rgbWBmat(xyz2myp, lastp=primp);
370 +                scolor_cie(xyz, cres);
371 +                colortrans(cout, xyz2myp, xyz);
372 +                clipgamut(cout, xyz[CIEY], CGAMUT_LOWER, cblack, cwhite);
373 +        } else {                        /* else copy unknown RGB */
374 +                copycolor(cout, cres);
375 +        }
376 + }
377 +
378 +
379   double
380   scolor2photopic(                /* compute scotopic integral for spectral color */
381          SCOLOR  scol,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines