--- ray/src/common/spec_rgb.c 2009/11/20 17:50:50 2.18 +++ ray/src/common/spec_rgb.c 2010/01/04 19:40:14 2.20 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: spec_rgb.c,v 2.18 2009/11/20 17:50:50 greg Exp $"; +static const char RCSid[] = "$Id: spec_rgb.c,v 2.20 2010/01/04 19:40:14 greg Exp $"; #endif /* * Convert colors and spectral ranges. @@ -241,16 +241,21 @@ colorprimsOK( /* are color primaries reasonable? */ RGBPRIMS pr ) { - int i; + int i, j; for (i = 0; i < 4; i++) { - if ((pr[i][CIEX] <= -.5 | (pr[i][CIEY] <= -.5)) + if ((pr[i][CIEX] <= -.5) | (pr[i][CIEY] <= -.5)) return(0); if ((pr[i][CIEX] >= 1.5) | (pr[i][CIEY] >= 1.5)) return(0); if (pr[i][CIEX] + pr[i][CIEY] >= 1.5) return(0); } + for (i = 0; i < 4; i++) + for (j = i+1; j < 4; j++) + if (CEQ(pr[i][CIEX],pr[j][CIEX]) && + CEQ(pr[i][CIEY],pr[j][CIEY])) + return(0); return(1); }