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

Comparing ray/src/common/spec_rgb.c (file contents):
Revision 2.6 by greg, Wed Oct 2 11:05:18 1996 UTC vs.
Revision 2.7 by greg, Thu Jan 30 19:14:39 1997 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1990 Regents of the University of California */
1 > /* Copyright (c) 1997 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 109 | Line 109 | int  s, e;             /* starting and ending wavelengths */
109   }
110  
111  
112 < colortrans(c2, mat, c1)         /* convert c1 by mat and put into c2 */
112 > colortrans(c2, mat, c1, noneg)  /* convert c1 by mat and put into c2 */
113   register COLORMAT  mat;
114   register COLOR  c1, c2;
115 + int     noneg;
116   {
117          static float  cout[3];
118  
119          cout[0] = mat[0][0]*c1[0] + mat[0][1]*c1[1] + mat[0][2]*c1[2];
120          cout[1] = mat[1][0]*c1[0] + mat[1][1]*c1[1] + mat[1][2]*c1[2];
121          cout[2] = mat[2][0]*c1[0] + mat[2][1]*c1[1] + mat[2][2]*c1[2];
122 <        if((c2[0] = cout[0]) < 0.) c2[0] = 0.;
123 <        if((c2[1] = cout[1]) < 0.) c2[1] = 0.;
124 <        if((c2[2] = cout[2]) < 0.) c2[2] = 0.;
122 >        if (!noneg)
123 >                return;
124 >        if ((c2[0] = cout[0]) < 0.) c2[0] = 0.;
125 >        if ((c2[1] = cout[1]) < 0.) c2[1] = 0.;
126 >        if ((c2[2] = cout[2]) < 0.) c2[2] = 0.;
127   }
128  
129  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines