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.26 by greg, Thu May 18 01:58:18 2006 UTC vs.
Revision 3.28 by greg, Wed Aug 9 16:26:54 2006 UTC

# Line 232 | Line 232 | int            len
232   )
233   {
234          static const char funcName[] = "tmCvGrays";
235        double  d;
235          int     i;
236  
237          if (tms == NULL)
# Line 459 | Line 458 | double gamval
458          if (gamval < MINGAM)
459                  gamval = tms->mongam;
460          d = log(expmult/tms->inpsf);
461 <        for (i = tms->mbrmax-tms->mbrmin+1; i--; )
462 <                tms->lumap[i] = 256. * exp(
461 >        for (i = tms->mbrmax-tms->mbrmin+1; i--; ) {
462 >                double  val = 256. * exp(
463                          ( d + (tms->mbrmin+i)*(1./TM_BRTSCALE) )
464 <                        / gamval );
464 >                        / gamval);
465 >                tms->lumap[i] = val >= (double)0xffff ? 0xffff : (int)val;
466 >        }
467          returnOK;
468   }
469  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines