--- ray/src/cv/bsdfrep.h 2014/02/19 05:16:06 2.12 +++ ray/src/cv/bsdfrep.h 2014/03/08 18:16:49 2.15 @@ -1,4 +1,4 @@ -/* RCSid $Id: bsdfrep.h,v 2.12 2014/02/19 05:16:06 greg Exp $ */ +/* RCSid $Id: bsdfrep.h,v 2.15 2014/03/08 18:16:49 greg Exp $ */ /* * Definitions for BSDF representation used to interpolate measured data. * @@ -16,10 +16,12 @@ #define ANG2R(r) (int)((r)*((1<<16)/M_PI)) #define R2ANG(c) (((c)+.5)*(M_PI/(1<<16))) -typedef struct { - float vsum; /* DSF sum */ - unsigned int nval; /* number of values in sum */ - unsigned short crad; /* radius (coded angle) */ +typedef union { + struct { + float v; /* DSF sum */ + unsigned int n; /* number of values in sum */ + } sum; /* sum for averaging */ + float val[2]; /* comparison values */ } GRIDVAL; /* grid value */ typedef struct { @@ -106,7 +108,7 @@ extern MIGRATION *mig_list; extern char *progname; /* get theta value in degrees [0,180) range */ -#define get_theta180(v) ((180./M_PI)*acos((v)[2])) +#define get_theta180(v) ((180./M_PI)*Acos((v)[2])) /* get phi value in degrees, [0,360) range */ #define get_phi360(v) ((180./M_PI)*atan2((v)[1],(v)[0]) + 360.*((v)[1]<0))