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.24 by greg, Wed May 10 15:34:17 2006 UTC vs.
Revision 3.27 by schorsch, Wed Jun 7 17:52:03 2006 UTC

# Line 53 | Line 53 | double gamval
53                  tmnew->clf[GRN] = rgb2xyzmat[1][1];
54                  tmnew->clf[BLU] = rgb2xyzmat[1][2];
55          } else {
56 <                comprgb2xyzWBmat(cmat, tmnew->monpri=monpri);
56 >                comprgb2xyzmat(cmat, tmnew->monpri=monpri);
57                  tmnew->clf[RED] = cmat[1][0];
58                  tmnew->clf[GRN] = cmat[1][1];
59                  tmnew->clf[BLU] = cmat[1][2];
# Line 116 | Line 116 | MEM_PTR        dat
116                          tms->clf[CIEX] = tms->clf[CIEZ] = 0.;
117                          tms->clf[CIEY] = 1.;
118                  } else {
119 <                        comprgb2xyzWBmat(tms->cmat, tms->monpri);
119 >                        comprgb2xyzmat(tms->cmat, tms->monpri);
120                          tms->clf[RED] = tms->cmat[1][0];
121                          tms->clf[GRN] = tms->cmat[1][1];
122                          tms->clf[BLU] = tms->cmat[1][2];
# 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 262 | Line 261 | int    len
261   )
262   {
263          static const char funcName[] = "tmCvColors";
265        static COLOR    csmall = {.5*MINLUM, .5*MINLUM, .5*MINLUM};
264          static BYTE     gamtab[1024];
265          static double   curgam = .0;
266          COLOR   cmon;
# Line 301 | Line 299 | int    len
299                  lum =   tms->clf[RED]*cmon[RED] +
300                          tms->clf[GRN]*cmon[GRN] +
301                          tms->clf[BLU]*cmon[BLU] ;
302 <                if (lum <= TM_NOLUM)                    /* convert brightness */
302 >                if (lum <= TM_NOLUM) {                  /* convert brightness */
303 >                        lum = cmon[RED] = cmon[GRN] = cmon[BLU] = TM_NOLUM;
304                          ls[i] = TM_NOBRT;
305 <                else
305 >                } else
306                          ls[i] = tmCvLumLUfp(&lum);
307                  if (cs == TM_NOCHROM)                   /* no color? */
308                          continue;
309                  if (tms->flags & TM_F_MESOPIC && lum < LMESUPPER) {
310                          slum = scotlum(cmon);           /* mesopic adj. */
311 <                        if (lum < LMESLOWER)
311 >                        if (lum < LMESLOWER) {
312                                  cmon[RED] = cmon[GRN] = cmon[BLU] = slum;
313 <                        else {
313 >                        } else {
314                                  d = (lum - LMESLOWER)/(LMESUPPER - LMESLOWER);
315                                  if (tms->flags & TM_F_BW)
316                                          cmon[RED] = cmon[GRN] =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines