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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 2.111 by greg, Mon Dec 11 18:54:42 2023 UTC vs.
Revision 2.113 by greg, Thu Jan 2 01:54:49 2025 UTC

# Line 87 | Line 87 | static double nextray(FVECT org, FVECT dir);
87   static void tabin(RAY *r);
88   static void ourtrace(RAY *r);
89  
90 < static void  putscolor(COLORV *scol);
90 > static void  putscolor(COLORV *scol, double sf);
91  
92   static oputf_t *ray_out[32], *every_out[32];
93   static putf_t *putreal;
# Line 684 | Line 684 | oputr(                         /* print mirrored contribution */
684          RAY  *r
685   )
686   {
687 <        putscolor(r->mcol);
687 >        putscolor(r->mcol, out_scalefactor);
688   }
689  
690  
# Line 708 | Line 708 | oputx(                         /* print unmirrored contribution */
708          copyscolor(cdiff, r->rcol);
709          sopscolor(cdiff, -=, r->mcol);
710  
711 <        putscolor(cdiff);
711 >        putscolor(cdiff, out_scalefactor);
712   }
713  
714  
# Line 726 | Line 726 | oputv(                         /* print value */
726          RAY  *r
727   )
728   {
729 <        putscolor(r->rcol);
729 >        putscolor(r->rcol, out_scalefactor);
730   }
731  
732  
# Line 739 | Line 739 | oputV(                         /* print value contribution */
739  
740          raycontrib(contr, r, PRIMARY);
741          smultscolor(contr, r->rcol);
742 <        putscolor(contr);
742 >        putscolor(contr, out_scalefactor);
743   }
744  
745  
# Line 856 | Line 856 | oputW(                         /* print coefficient */
856          else
857                  raycontrib(contr, r, PRIMARY);
858  
859 <        putscolor(contr);
859 >        putscolor(contr, 1.);
860   }
861  
862  
# Line 954 | Line 954 | putf(RREAL *v, int n)          /* output binary float(s) */
954  
955  
956   static void
957 < putscolor(COLORV *scol)         /* output (spectral) color */
957 > putscolor(COLORV *scol, double sf)      /* output (spectral) color */
958   {
959          static COLORMAT xyz2myrgbmat;
960          SCOLOR          my_scol;
961          COLOR           col;
962 <                                        /* apply scalefactor if any */
963 <        if (out_scalefactor != 1.) {
964 <                copyscolor(my_scol, scol);
965 <                scalescolor(my_scol, out_scalefactor);
966 <                scol = my_scol;
967 <        }
968 <        if (sens_curve != NULL) {       /* single channel output */
969 <                RREAL   v = (*sens_curve)(scol);
962 >                                        /* single channel output? */
963 >        if (sens_curve != NULL) {
964 >                RREAL   v = (*sens_curve)(scol) * sf;
965                  (*putreal)(&v, 1);
966                  return;
967 +        }
968 +        if (sf != 1.) {                 /* apply scalefactor if any */
969 +                copyscolor(my_scol, scol);
970 +                scalescolor(my_scol, sf);
971 +                scol = my_scol;
972          }
973          if (out_prims == NULL) {        /* full spectral reporting */
974                  if (outform == 'c') {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines