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.34 by greg, Mon Feb 9 20:48:08 2009 UTC vs.
Revision 3.36 by greg, Fri Apr 22 14:35:54 2011 UTC

# Line 134 | Line 134 | MEM_PTR        dat
134                  if (tms->inppri != tms->monpri &&
135                                  PRIMEQ(tms->inppri, tms->monpri))
136                          tms->inppri = tms->monpri;      /* no xform */
137 <                comprgb2rgbWBmat(tms->cmat, tms->inppri, tms->monpri);
137 >                if (!comprgb2rgbWBmat(tms->cmat, tms->inppri, tms->monpri))
138 >                        returnErr(TM_E_ILLEGAL);
139          }
140          for (i = 0; i < 3; i++)
141                  for (j = 0; j < 3; j++)
142                          tms->cmat[i][j] *= tms->inpsf;
143                                                  /* set color divisors */
144          for (i = 0; i < 3; i++)
145 <                if (tms->clf[i] > .001)
146 <                        tms->cdiv[i] =
146 <                                256.*pow(tms->clf[i], 1./tms->mongam);
147 <                else
148 <                        tms->cdiv[i] = 1;
145 >                tms->cdiv[i] = 256.*pow(tms->clf[i] < .001 ? .001 :
146 >                                                tms->clf[i], 1./tms->mongam);
147                                                  /* notify packages */
148          for (i = tmNumPkgs; i--; )
149                  if (tms->pd[i] != NULL && tmPkg[i]->NewSpace != NULL)
# Line 180 | Line 178 | double lum
178   #endif
179                  return(TM_NOBRT);
180          d = TM_BRTSCALE*log(lum);
181 <        if (d > 0.)
184 <                return((TMbright)(d+.5));
185 <        return((TMbright)(d-.5));
181 >        return((TMbright)(d + .5 - (d < 0.)));
182   }
183  
184  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines