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.23 by greg, Wed May 10 15:21:58 2006 UTC vs.
Revision 3.24 by greg, Wed May 10 15:34:17 2006 UTC

# Line 23 | Line 23 | struct tmPackage       *tmPkg[TM_MAXPKG];
23   int     tmNumPkgs = 0;                  /* number of registered packages */
24  
25                                          /* luminance->brightness lookup */
26 < static TMbright         *tmFloat2BrtLUT;
26 > static TMbright         *tmFloat2BrtLUT = NULL;
27  
28   #define tmCvLumLUfp(pf) tmFloat2BrtLUT[*(int32 *)(pf) >> 15]
29  
# Line 239 | Line 239 | int            len
239                  returnErr(TM_E_TMINVAL);
240          if ((ls == NULL) | (scan == NULL) | (len < 0))
241                  returnErr(TM_E_ILLEGAL);
242 +        if (tmFloat2BrtLUT == NULL)                     /* initialize */
243 +                tmCvLums(NULL, NULL, 0);
244          for (i = len; i--; ) {
245                  float   lum = tms->inpsf * scan[i];
246                  if (lum <= TM_NOLUM)
# Line 271 | Line 273 | int    len
273                  returnErr(TM_E_TMINVAL);
274          if ((ls == NULL) | (scan == NULL) | (len < 0))
275                  returnErr(TM_E_ILLEGAL);
276 <        tmCvLums(NULL, NULL, 0);                        /* initialize */
276 >        if (tmFloat2BrtLUT == NULL)                     /* initialize */
277 >                tmCvLums(NULL, NULL, 0);
278          if (cs != TM_NOCHROM && fabs(tms->mongam - curgam) > .02) {
279                  curgam = tms->mongam;                   /* (re)build table */
280                  for (i = 1024; i--; )

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines