--- ray/src/common/color.h 2004/03/28 20:33:12 2.28 +++ ray/src/common/color.h 2009/05/21 18:08:43 2.30 @@ -1,4 +1,4 @@ -/* RCSid $Id: color.h,v 2.28 2004/03/28 20:33:12 schorsch Exp $ */ +/* RCSid $Id: color.h,v 2.30 2009/05/21 18:08:43 greg Exp $ */ /* * color.h - header for routines using pixel color values. * @@ -158,7 +158,7 @@ typedef float COLORMAT[3][3]; /* color coordinate con #define PRIMARYSTR "PRIMARIES=" #define LPRIMARYSTR 10 #define isprims(hl) (!strncmp(hl,PRIMARYSTR,LPRIMARYSTR)) -#define primsval(p,hl) sscanf(hl+LPRIMARYSTR, \ +#define primsval(p,hl) sscanf((hl)+LPRIMARYSTR, \ "%f %f %f %f %f %f %f %f", \ &(p)[RED][CIEX],&(p)[RED][CIEY], \ &(p)[GRN][CIEX],&(p)[GRN][CIEY], \ @@ -176,7 +176,7 @@ typedef float COLORMAT[3][3]; /* color coordinate con #define COLCORSTR "COLORCORR=" #define LCOLCORSTR 10 #define iscolcor(hl) (!strncmp(hl,COLCORSTR,LCOLCORSTR)) -#define colcorval(cc,hl) sscanf(hl+LCOLCORSTR,"%f %f %f", \ +#define colcorval(cc,hl) sscanf((hl)+LCOLCORSTR,"%f %f %f", \ &(cc)[RED],&(cc)[GRN],&(cc)[BLU]) #define fputcolcor(cc,fp) fprintf(fp,"%s %f %f %f\n",COLCORSTR, \ (cc)[RED],(cc)[GRN],(cc)[BLU]) @@ -218,14 +218,15 @@ extern int clipgamut(COLOR col, double brt, int gamut, extern void colortrans(COLOR c2, COLORMAT mat, COLOR c1); extern void multcolormat(COLORMAT m3, COLORMAT m2, COLORMAT m1); -extern void compxyz2rgbmat(COLORMAT mat, RGBPRIMS pr); -extern void comprgb2xyzmat(COLORMAT mat, RGBPRIMS pr); -extern void comprgb2rgbmat(COLORMAT mat, RGBPRIMS pr1, RGBPRIMS pr2); -extern void compxyzWBmat(COLORMAT mat, float wht1[2], +extern int colorprimsOK(RGBPRIMS pr); +extern int compxyz2rgbmat(COLORMAT mat, RGBPRIMS pr); +extern int comprgb2xyzmat(COLORMAT mat, RGBPRIMS pr); +extern int comprgb2rgbmat(COLORMAT mat, RGBPRIMS pr1, RGBPRIMS pr2); +extern int compxyzWBmat(COLORMAT mat, float wht1[2], float wht2[2]); -extern void compxyz2rgbWBmat(COLORMAT mat, RGBPRIMS pr); -extern void comprgb2xyzWBmat(COLORMAT mat, RGBPRIMS pr); -extern void comprgb2rgbWBmat(COLORMAT mat, RGBPRIMS pr1, RGBPRIMS pr2); +extern int compxyz2rgbWBmat(COLORMAT mat, RGBPRIMS pr); +extern int comprgb2xyzWBmat(COLORMAT mat, RGBPRIMS pr); +extern int comprgb2rgbWBmat(COLORMAT mat, RGBPRIMS pr1, RGBPRIMS pr2); /* defined in colrops.c */ extern int setcolrcor(double (*f)(double, double), double a2); extern int setcolrinv(double (*f)(double, double), double a2);