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.44 by greg, Wed Feb 24 03:48:52 2021 UTC vs.
Revision 3.45 by greg, Wed Feb 24 20:35:22 2021 UTC

# Line 484 | Line 484 | double Ldmax
484                  histot += tms->histo[i];
485                  sum += (double)(j -= HISTEP) * tms->histo[i];
486          }
487 <        threshold = histot*0.005 + .5;
487 >        threshold = histot*0.002 + .5;
488          if (!histot)
489                  returnErr(TM_E_TMFAIL);
490          Lwavg = tmLuminance( (double)sum / histot );
# Line 503 | Line 503 | double Ldmax
503          do {                            /* iterate to solution */
504                  sum = 0;                /* cumulative probability */
505                  for (i = 0; i < histlen; i++) {
506 <                        cumf[i] = (double)sum/histot;
507 <                        sum += histo[i];
506 >                        cumf[i] = sum/histot;
507 >                        sum += (double)histo[i];
508                  }
509                  cumf[histlen] = 1.;
510                  Tr = histot * (double)(tms->hbrmax - tms->hbrmin) /
511 <                        ((double)histlen*TM_BRTSCALE) / logLddyn;
511 >                                ((double)TM_BRTSCALE*histlen*logLddyn);
512                  ceiling = Tr + 1.;
513                  trimmings = 0;          /* clip to envelope */
514                  for (i = histlen; i--; ) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines