34 |
|
|
35 |
|
typedef struct { |
36 |
|
float peak; /* lobe value at peak */ |
37 |
+ |
C_CHROMA chroma; /* encoded chromaticity */ |
38 |
|
unsigned short crad; /* radius (coded angle) */ |
39 |
< |
unsigned char gx, gy; /* grid position */ |
39 |
> |
unsigned short gx, gy; /* grid position */ |
40 |
|
} RBFVAL; /* radial basis function value */ |
41 |
|
|
42 |
|
struct s_rbfnode; /* forward declaration of RBF struct */ |
83 |
|
extern int input_orient; |
84 |
|
extern int output_orient; |
85 |
|
|
86 |
+ |
/* represented colorimetry */ |
87 |
+ |
typedef enum {RBCphotopic, RBCtristimulus, RBCspectral, RBCunknown} RBColor; |
88 |
+ |
|
89 |
+ |
extern RBColor rbf_colorimetry; |
90 |
+ |
|
91 |
+ |
extern const char *RBCident[]; |
92 |
+ |
|
93 |
|
/* log BSDF histogram */ |
94 |
|
#define HISTLEN 256 |
95 |
|
#define BSDF2BIG (1./M_PI) |
122 |
|
|
123 |
|
#define BSDFREP_FMT "BSDF_RBFmesh" |
124 |
|
|
125 |
+ |
#define BSDFREP_MAGIC 0x5a3c |
126 |
+ |
|
127 |
|
/* global argv[0] */ |
128 |
|
extern char *progname; |
129 |
|
|
135 |
|
/* our loaded grid for this incident angle */ |
136 |
|
extern double theta_in_deg, phi_in_deg; |
137 |
|
extern GRIDVAL dsf_grid[GRIDRES][GRIDRES]; |
138 |
+ |
extern float (*spec_grid)[GRIDRES][GRIDRES]; |
139 |
+ |
extern int nspec_grid; |
140 |
|
|
141 |
|
/* Register new input direction */ |
142 |
|
extern int new_input_direction(double new_theta, double new_phi); |
168 |
|
/* Evaluate BSDF at the given normalized outgoing direction */ |
169 |
|
extern double eval_rbfrep(const RBFNODE *rp, const FVECT outvec); |
170 |
|
|
171 |
+ |
extern SDError eval_rbfcol(SDValue *sv, |
172 |
+ |
const RBFNODE *rp, const FVECT outvec); |
173 |
+ |
|
174 |
|
/* Insert a new directional scattering function in our global list */ |
175 |
|
extern int insert_dsf(RBFNODE *newrbf); |
176 |
|
|
197 |
|
/* Read a BSDF mesh interpolant from the given binary stream */ |
198 |
|
extern int load_bsdf_rep(FILE *ifp); |
199 |
|
|
200 |
+ |
/* Set up visible spectrum sampling */ |
201 |
+ |
extern void set_spectral_samples(int nspec); |
202 |
+ |
|
203 |
|
/* Start new DSF input grid */ |
204 |
|
extern void new_bsdf_data(double new_theta, double new_phi); |
205 |
|
|
206 |
|
/* Add BSDF data point */ |
207 |
|
extern void add_bsdf_data(double theta_out, double phi_out, |
208 |
< |
double val, int isDSF); |
208 |
> |
const double val[], int isDSF); |
209 |
|
|
210 |
|
/* Count up filled nodes and build RBF representation from current grid */ |
211 |
|
extern RBFNODE * make_rbfrep(void); |