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

Comparing ray/src/common/ccolor.c (file contents):
Revision 3.12 by greg, Thu Jan 4 01:55:42 2024 UTC vs.
Revision 3.13 by greg, Thu Jan 4 16:14:50 2024 UTC

# Line 210 | Line 210 | c_equiv(C_COLOR *c1, C_COLOR *c2)
210  
211          if (c1 == c2)
212                  return(1);
213 <        c_ccvt(c1, C_CSXY);             /* first check chromaticities */
214 <        c_ccvt(c2, C_CSXY);
213 >        if ((c1->flags ^ c2->flags) & (C_CDXY|C_CDSPEC))
214 >                return(0);              /* defined differently, so no */
215 >        c_ccvt(c1, C_CSXY);
216 >        c_ccvt(c2, C_CSXY);             /* first check chromaticities */
217          if (fabs(c1->cx - c2->cx) + fabs(c1->cy - c2->cy) > .015)
218                  return(0);              /* mismatch means definitely different */
219 <        if (c1->flags & c2->flags & C_CDXY)
220 <                return(1);              /* done if both defined as (x,y) */
219 <        c_ccvt(c1, C_CSSPEC);           /* else compare spectra */
220 <        c_ccvt(c2, C_CSSPEC);
219 >        if (c1->flags & C_CDXY)
220 >                return(1);              /* done if defined as (x,y) */
221          thresh = C_CMAXV/200*(c1->ssum + c2->ssum);
222 <        for (i = 0; i < C_CNSS; i++)
222 >        for (i = 0; i < C_CNSS; i++)    /* else compare spectra */
223                  if (labs(c1->ssamp[i]*c2->ssum - c2->ssamp[i]*c1->ssum) > thresh)
224                          return(0);
225          return(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines