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.35 by greg, Mon Mar 7 20:49:19 2011 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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines