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.5 by greg, Sun Oct 15 14:08:01 1995 UTC vs.
Revision 2.6 by greg, Wed Oct 2 11:05:18 1996 UTC

# Line 145 | Line 145 | register RGBPRIMS  pr;
145   {
146          double  C_rD, C_gD, C_bD;
147  
148 +        if (pr == stdprims) {   /* can use xyz2rgbmat */
149 +                cpcolormat(mat, xyz2rgbmat);
150 +                return;
151 +        }
152          C_rD = (1./pr[WHT][CIEY]) *
153                          ( pr[WHT][CIEX]*(pr[GRN][CIEY] - pr[BLU][CIEY]) -
154                            pr[WHT][CIEY]*(pr[GRN][CIEX] - pr[BLU][CIEX]) +
# Line 191 | Line 195 | register RGBPRIMS  pr;
195   {
196          double  C_rD, C_gD, C_bD, D;
197  
198 +        if (pr == stdprims) {   /* can use rgb2xyzmat */
199 +                cpcolormat(mat, rgb2xyzmat);
200 +                return;
201 +        }
202          C_rD = (1./pr[WHT][CIEY]) *
203                          ( pr[WHT][CIEX]*(pr[GRN][CIEY] - pr[BLU][CIEY]) -
204                            pr[WHT][CIEY]*(pr[GRN][CIEX] - pr[BLU][CIEX]) +
# Line 224 | Line 232 | RGBPRIMS  pr1, pr2;
232   {
233          COLORMAT  pr1toxyz, xyztopr2;
234  
235 <        if (pr1 == stdprims)    /* can use rgb2xyzmat */
236 <                cpcolormat(pr1toxyz, rgb2xyzmat);
237 <        else                    /* otherwise compute it */
238 <                comprgb2xyzmat(pr1toxyz, pr1);
239 <        if (pr2 == stdprims)    /* can use xyz2rgbmat */
240 <                cpcolormat(xyztopr2, xyz2rgbmat);
241 <        else                    /* otherwise compute it */
242 <                compxyz2rgbmat(xyztopr2, pr2);
235 >        if (pr1 == pr2) {
236 >                mat[0][0] = mat[1][1] = mat[2][2] = 1.0;
237 >                mat[0][1] = mat[0][2] = mat[1][0] =
238 >                mat[1][2] = mat[2][0] = mat[2][1] = 0.0;
239 >                return;
240 >        }
241 >        comprgb2xyzmat(pr1toxyz, pr1);
242 >        compxyz2rgbmat(xyztopr2, pr2);
243                                  /* combine transforms */
244          multcolormat(mat, pr1toxyz, xyztopr2);
245   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines