ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/tmapcolrs.c
(Generate patch)

Comparing ray/src/common/tmapcolrs.c (file contents):
Revision 3.7 by gwlarson, Tue Oct 27 09:16:53 1998 UTC vs.
Revision 3.8 by gwlarson, Tue Oct 27 09:32:54 1998 UTC

# Line 93 | Line 93 | int    len;
93                  ls[i] = bi;
94                  if (cs == TM_NOCHROM)                   /* no color? */
95                          continue;
96                if (tmTop->flags & TM_F_BW)
97                        cmon[RED] = cmon[GRN] = cmon[BLU] = li;
96                                                          /* mesopic adj. */
97                  if (tmTop->flags & TM_F_MESOPIC && bi < BMESUPPER) {
98                          register int    pf, sli = normscot(cmon);
99                          if (bi < BMESLOWER)
100                                  cmon[RED] = cmon[GRN] = cmon[BLU] = sli;
101                          else {
102 +                                if (tmTop->flags & TM_F_BW)
103 +                                        cmon[RED] = cmon[GRN] = cmon[BLU] = li;
104                                  pf = photofact[bi-BMESLOWER];
105                                  sli *= 256 - pf;
106                                  cmon[RED] = ( sli + pf*cmon[RED] ) >> 8;
107                                  cmon[GRN] = ( sli + pf*cmon[GRN] ) >> 8;
108                                  cmon[BLU] = ( sli + pf*cmon[BLU] ) >> 8;
109                          }
110 +                } else if (tmTop->flags & TM_F_BW) {
111 +                        cmon[RED] = cmon[GRN] = cmon[BLU] = li;
112                  }
113                  bi = ( (int4)GAMTSZ*cd->clfb[RED]*cmon[RED]/li ) >> 8;
114                  cs[3*i  ] = bi>=GAMTSZ ? 255 : cd->gamb[bi];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines