33 |
|
b_vecf *ob_vec; /* get output vector from index */ |
34 |
|
b_ndxf *ob_ndx; /* get output index from vector */ |
35 |
|
b_ohmf *ob_ohm; /* get output proj. SA for index */ |
36 |
+ |
C_CHROMA *chroma; /* chromaticity data */ |
37 |
|
float bsdf[1]; /* scattering data (extends struct) */ |
38 |
|
} SDMat; |
39 |
|
|
47 |
|
#define mBSDF_value(b,i,o) (b)->bsdf[(o)*(b)->ninc + (i)] |
48 |
|
|
49 |
|
/* Holder for cumulative distribution (sum of BSDF * projSA) */ |
50 |
< |
typedef struct { |
51 |
< |
SD_CDIST_BASE; /* base fields; must come first */ |
50 |
> |
typedef struct SDMatCDst_s { |
51 |
> |
SD_CDIST_BASE(SDMatCDst_s); /* base fields; must come first */ |
52 |
|
int indx; /* incident angle index */ |
53 |
|
void *ob_priv; /* private data for generator */ |
54 |
|
b_vecf *ob_vec; /* outbound vector generator */ |
63 |
|
|
64 |
|
/* Our matrix handling routines */ |
65 |
|
extern SDFunc SDhandleMtx; |
66 |
+ |
|
67 |
+ |
/******** Klems basis declarations for more intimate access ********/ |
68 |
+ |
|
69 |
+ |
#define MAXLATS 46 /* maximum number of latitudes */ |
70 |
+ |
|
71 |
+ |
/* BSDF angle specification */ |
72 |
+ |
typedef struct { |
73 |
+ |
char name[64]; /* basis name */ |
74 |
+ |
int nangles; /* total number of directions */ |
75 |
+ |
struct { |
76 |
+ |
float tmin; /* starting theta */ |
77 |
+ |
int nphis; /* number of phis (0 term) */ |
78 |
+ |
} lat[MAXLATS+1]; /* latitudes */ |
79 |
+ |
} ANGLE_BASIS; |
80 |
+ |
|
81 |
+ |
#define MAXABASES 7 /* limit on defined bases */ |
82 |
+ |
|
83 |
+ |
extern ANGLE_BASIS abase_list[MAXABASES]; |
84 |
+ |
|
85 |
+ |
extern int nabases; /* current number of defined bases */ |
86 |
+ |
|
87 |
+ |
extern C_COLOR mtx_RGB_prim[3]; /* matrix RGB primaries */ |
88 |
+ |
extern float mtx_RGB_coef[3]; /* corresponding Y coefficients */ |
89 |
+ |
|
90 |
+ |
/* Get color or grayscale value for BSDF in the given directions */ |
91 |
+ |
extern int mBSDF_color(float coef[], const SDMat *b, int i, int o); |
92 |
+ |
|
93 |
+ |
/* Get vector for this angle basis index (front exiting) */ |
94 |
+ |
extern b_vecf fo_getvec; |
95 |
+ |
|
96 |
+ |
/* Get index corresponding to the given vector (front exiting) */ |
97 |
+ |
extern b_ndxf fo_getndx; |
98 |
+ |
|
99 |
+ |
/* Get projected solid angle for this angle basis index (universal) */ |
100 |
+ |
extern b_ohmf io_getohm; |
101 |
+ |
|
102 |
+ |
/* Get vector for this angle basis index (back incident) */ |
103 |
+ |
extern b_vecf bi_getvec; |
104 |
+ |
|
105 |
+ |
/* Get index corresponding to the vector (back incident) */ |
106 |
+ |
extern b_ndxf bi_getndx; |
107 |
+ |
|
108 |
+ |
/* Get vector for this angle basis index (back exiting) */ |
109 |
+ |
extern b_vecf bo_getvec; |
110 |
+ |
|
111 |
+ |
/* Get index corresponding to the vector (back exiting) */ |
112 |
+ |
extern b_ndxf bo_getndx; |
113 |
+ |
|
114 |
+ |
/* Get vector for this angle basis index (front incident) */ |
115 |
+ |
extern b_vecf fi_getvec; |
116 |
+ |
|
117 |
+ |
/* Get index corresponding to the vector (front incident) */ |
118 |
+ |
extern b_ndxf fi_getndx; |
119 |
|
|
120 |
|
#ifdef __cplusplus |
121 |
|
} |