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.17 by greg, Fri Jan 7 21:41:06 2005 UTC vs.
Revision 3.19 by greg, Tue Nov 15 06:53:00 2005 UTC

# Line 68 | Line 68 | double gamval
68                          tmnew->inpsf = WHTEFFICACY;
69          tmnew->cmat[0][1] = tmnew->cmat[0][2] = tmnew->cmat[1][0] =
70          tmnew->cmat[1][2] = tmnew->cmat[2][0] = tmnew->cmat[2][1] = 0.;
71 +        tmnew->inpdat = NULL;
72          tmnew->hbrmin = 10; tmnew->hbrmax = -10;
73          tmnew->histo = NULL;
74          tmnew->mbrmin = 10; tmnew->mbrmax = -10;
# Line 86 | Line 87 | int
87   tmSetSpace(                     /* set input color space for conversions */
88   TMstruct        *tms,
89   RGBPRIMP        pri,
90 < double  sf
90 > double  sf,
91 > MEM_PTR dat
92   )
93   {
94          static const char funcName[] = "tmSetSpace";
# Line 97 | Line 99 | double sf
99          if (sf <= 1e-12)
100                  returnErr(TM_E_ILLEGAL);
101                                                  /* check if no change */
102 <        if (pri == tms->inppri && FEQ(sf, tms->inpsf))
102 >        if (pri == tms->inppri && FEQ(sf, tms->inpsf) && dat == tms->inpdat)
103                  returnOK;
104          tms->inppri = pri;                      /* let's set it */
105          tms->inpsf = sf;
106 +        tms->inpdat = dat;
107  
108          if (tms->flags & TM_F_BW) {             /* color doesn't matter */
109                  tms->monpri = tms->inppri;              /* eliminate xform */
# Line 233 | Line 236 | int    len
236                                  (int)(256.*pow(d, 1./tms->mongam));
237          }
238          returnOK;
239 + }
240 +
241 +
242 + TMbright
243 + tmCvLuminance(                          /* convert a single luminance */
244 + double  lum
245 + )
246 + {
247 +        double  d;
248 +
249 +        if (lum <= TM_NOLUM)
250 +                return(TM_NOBRT);
251 +        d = TM_BRTSCALE*log(lum);
252 +        if (d > 0.)
253 +                return((TMbright)(d+.5));
254 +        return((TMbright)(d-.5));
255   }
256  
257  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines