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); |