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.48 by greg, Wed Apr 7 23:12:19 2021 UTC vs.
Revision 3.49 by greg, Mon Apr 12 22:16:02 2021 UTC

# Line 488 | Line 488 | double Ldmax
488                  histot += tms->histo[i];
489                  sum += (double)(j -= HISTEP) * tms->histo[i];
490          }
491        threshold = histot*0.002 + .5;
491          if (!histot)
492                  returnErr(TM_E_TMFAIL);
493 +        threshold = histot*0.025 + 1.;
494          Lwavg = tmLuminance( (double)sum / histot );
495                                          /* use linear tone mapping? */
496          if (tms->flags & TM_F_LINEAR || threshold < 4 ||
# Line 534 | Line 534 | double Ldmax
534                          free(cumf);
535                          goto linearmap;
536                  }
537 <        } while (trimmings > threshold);
537 >                threshold = 0.025*histot + 1.;
538 >
539 >        } while ((threshold > 4) & (trimmings > threshold));
540                                          /* allocate space for mapping */
541          if (!tmNewMap(tms))
542                  returnErr(TM_E_NOMEM);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines