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.46 by greg, Tue Mar 2 20:09:14 2021 UTC vs.
Revision 3.47 by greg, Wed Apr 7 21:13:52 2021 UTC

# Line 425 | Line 425 | double  Lddyn
425   )
426   {
427          static const char funcName[] = "tmFixedMapping";
428 <        int     maxV = (1L<<(8*sizeof(TMAP_TYP))) - 1;
429 <        double  minD;
430 <        int     i;
428 >        const int       maxV = (1L<<(8*sizeof(TMAP_TYP))) - 1;
429 >        double          minD;
430 >        int             i;
431          
432          if (!tmNewMap(tms))
433                  returnErr(TM_E_NOMEM);
# Line 443 | Line 443 | double  Lddyn
443                          break;          /* map initialized to zeroes */
444                  d = (d - minD)/(1. - minD);
445                  d = TM_BRES*pow(d, 1./gamval);
446 <                tms->lumap[i] = (d >= maxV) ? maxV : (int)d;
446 >                tms->lumap[i] = (d > maxV) ? maxV : (int)d;
447          }
448          returnOK;
449   }
# Line 688 | Line 688 | TMstruct       *tms
688          tms->mbrmin = tms->hbrmin;
689          tms->mbrmax = tms->hbrmax;
690          if (tms->mbrmin > tms->mbrmax)
691 <                return 0;
691 >                return(0);
692          if (tms->lumap == NULL)
693                  tms->lumap = (TMAP_TYP *)calloc(tms->mbrmax-tms->mbrmin+1,
694                                                  sizeof(TMAP_TYP));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines