5 |
|
* G. Ward |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#ifndef _BSDFREP_H_ |
9 |
+ |
#define _BSDFREP_H_ |
10 |
+ |
|
11 |
|
#include "bsdf.h" |
12 |
|
|
13 |
< |
#define DEBUG 1 |
13 |
> |
#ifdef __cplusplus |
14 |
> |
extern "C" { |
15 |
> |
#endif |
16 |
|
|
17 |
|
#ifndef GRIDRES |
18 |
|
#define GRIDRES (1<<8) /* grid resolution per side */ |
21 |
|
#define ANG2R(r) (int)((r)*((1<<16)/M_PI)) |
22 |
|
#define R2ANG(c) (((c)+.5)*(M_PI/(1<<16))) |
23 |
|
|
24 |
< |
typedef struct { |
25 |
< |
float vsum; /* DSF sum */ |
26 |
< |
unsigned int nval; /* number of values in sum */ |
27 |
< |
unsigned short crad; /* radius (coded angle) */ |
24 |
> |
typedef union { |
25 |
> |
struct { |
26 |
> |
float v; /* DSF sum */ |
27 |
> |
unsigned int n; /* number of values in sum */ |
28 |
> |
} sum; /* sum for averaging */ |
29 |
> |
float val[2]; /* comparison values */ |
30 |
|
} GRIDVAL; /* grid value */ |
31 |
|
|
32 |
|
typedef struct { |
64 |
|
#define INP_QUAD3 4 /* 180-270 degree quadrant */ |
65 |
|
#define INP_QUAD4 8 /* 270-360 degree quadrant */ |
66 |
|
|
67 |
+ |
/* name and manufacturer if known */ |
68 |
+ |
extern char bsdf_name[]; |
69 |
+ |
extern char bsdf_manuf[]; |
70 |
|
/* active grid resolution */ |
71 |
|
extern int grid_res; |
72 |
|
/* coverage/symmetry using INP_QUAD? flags */ |
113 |
|
extern char *progname; |
114 |
|
|
115 |
|
/* get theta value in degrees [0,180) range */ |
116 |
< |
#define get_theta180(v) ((180./M_PI)*acos((v)[2])) |
116 |
> |
#define get_theta180(v) ((180./M_PI)*Acos((v)[2])) |
117 |
|
/* get phi value in degrees, [0,360) range */ |
118 |
|
#define get_phi360(v) ((180./M_PI)*atan2((v)[1],(v)[0]) + 360.*((v)[1]<0)) |
119 |
|
|
193 |
|
/* Find edge(s) for interpolating the given vector, applying symmetry */ |
194 |
|
extern int get_interp(MIGRATION *miga[3], FVECT invec); |
195 |
|
|
196 |
+ |
/* Advect and allocate new RBF along edge (internal call) */ |
197 |
+ |
extern RBFNODE * e_advect_rbf(const MIGRATION *mig, |
198 |
+ |
const FVECT invec, int lobe_lim); |
199 |
+ |
|
200 |
+ |
/* Compute distance between two RBF lobes (internal call) */ |
201 |
+ |
extern double lobe_distance(RBFVAL *rbf1, RBFVAL *rbf2); |
202 |
+ |
|
203 |
+ |
/* Compute mass transport plan (internal call) */ |
204 |
+ |
extern void plan_transport(MIGRATION *mig); |
205 |
+ |
|
206 |
|
/* Partially advect between recorded incident angles and allocate new RBF */ |
207 |
|
extern RBFNODE * advect_rbf(const FVECT invec, int lobe_lim); |
208 |
+ |
|
209 |
+ |
#ifdef __cplusplus |
210 |
+ |
} |
211 |
+ |
#endif |
212 |
+ |
#endif /* _BSDFREP_H_ */ |