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

Comparing ray/src/common/tonemap.c (file contents):
Revision 3.51 by greg, Tue May 4 21:50:54 2021 UTC vs.
Revision 3.54 by greg, Sat Jan 15 16:57:46 2022 UTC

# Line 95 | Line 95 | tmSetSpace(                    /* set input color space for conversions
95   TMstruct        *tms,
96   RGBPRIMP        pri,
97   double  sf,
98 < MEM_PTR dat
98 > void    *dat
99   )
100   {
101          static const char funcName[] = "tmSetSpace";
# Line 321 | Line 321 | int    len
321                                  cmon[BLU] += d;
322                          }
323                  } else if (tms->flags & TM_F_BW) {
324 <                        cmon[RED] = cmon[GRN] = cmon[BLU] = lum;
324 >                        int     j = 3;
325 >                        while (j--) cs[3*i+j] = tms->cdiv[j]/(TM_BRES>>8);
326 >                        continue;
327                  }
328                  d = tms->clf[RED]*cmon[RED]/lum;
329                  cs[3*i  ] = d>=.999f ? 255 : gamtab[(int)(1024.f*d)];
# Line 491 | Line 493 | double Ldmax
493          }
494          if (!histot)
495                  returnErr(TM_E_TMFAIL);
496 <        threshold = histot/40 + 1;
496 >        threshold = histot/500 + 1;
497          Lwavg = tmLuminance( (double)sum / histot );
498                                          /* use linear tone mapping? */
499 <        if (tms->flags & TM_F_LINEAR || threshold < 4 ||
499 >        if (tms->flags & TM_F_LINEAR ||
500                          tms->hbrmax - tms->hbrmin < TM_BRTSCALE*logLddyn)
501                  goto linearmap;
502                                          /* clamp histogram */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines