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.3 by greg, Fri Apr 18 13:59:46 1997 UTC vs.
Revision 3.5 by gwlarson, Thu Oct 8 16:31:02 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Regents of the University of California */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4 < static char SCCSid[] = "$SunId$ LBL";
4 > static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
# Line 52 | Line 52 | int    len;
52  
53          if (tmTop == NULL)
54                  returnErr(TM_E_TMINVAL);
55 <        if (ls == NULL | scan == NULL | len <= 0)
55 >        if (ls == NULL | scan == NULL | len < 0)
56                  returnErr(TM_E_ILLEGAL);
57          if (tmNeedMatrix(tmTop)) {              /* need floating point */
58                  register COLOR  *newscan;
# 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;
98                                                          /* mesopic adj. */
99                  if (tmTop->flags & TM_F_MESOPIC && bi < BMESUPPER) {
100                          register int    pf, sli = normscot(cmon);
101                          if (bi < BMESLOWER)
102                                  cmon[RED] = cmon[GRN] = cmon[BLU] = sli;
103                          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;
110                  }
111                  bi = ( (int4)GAMTSZ*cd->clfb[RED]*cmon[RED]/li ) >> 8;
112                  cs[3*i  ] = bi>=GAMTSZ ? 255 : cd->gamb[bi];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines