30 |
|
extern "C" { |
31 |
|
#endif |
32 |
|
|
33 |
+ |
#ifdef _WIN32 |
34 |
+ |
#define strcasecmp stricmp |
35 |
+ |
#endif |
36 |
+ |
|
37 |
|
#define SDnameLn 128 /* maximum BSDF name length */ |
38 |
|
#define SDmaxCh 3 /* maximum # spectral channels */ |
39 |
|
|
71 |
|
} SDValue; |
72 |
|
|
73 |
|
/* Cached, encoded, cumulative distribution for one incident (solid) angle */ |
74 |
< |
#define SD_CDIST_BASE double cTotal; \ |
75 |
< |
struct SDCDst_s *next |
74 |
> |
#define SD_CDIST_BASE(styp) double cTotal; \ |
75 |
> |
struct styp *next |
76 |
|
typedef struct SDCDst_s { |
77 |
< |
SD_CDIST_BASE; /* base fields first */ |
77 |
> |
SD_CDIST_BASE(SDCDst_s); /* base fields first */ |
78 |
|
/* ...encoded distribution extends struct */ |
79 |
|
} SDCDst; |
80 |
|
|
118 |
|
/* Loaded BSDF data */ |
119 |
|
typedef struct { |
120 |
|
char name[SDnameLn]; /* BSDF name (usu. derived from file) */ |
121 |
+ |
char matn[SDnameLn]; /* material name */ |
122 |
+ |
char makr[SDnameLn]; /* manufacturer */ |
123 |
|
char *mgf; /* geometric description (if any) */ |
124 |
|
float dim[3]; /* width, height, thickness (meters) */ |
125 |
|
SDValue rLambFront; /* diffuse front reflectance */ |
136 |
|
*next; |
137 |
|
} *SDcacheList; /* Global BSDF cache */ |
138 |
|
|
139 |
< |
/* BSDF cache retention preference */ |
140 |
< |
#define SDretainNone 0 /* free unreferenced data*/ |
141 |
< |
#define SDretainBSDFs 1 /* keep loaded BSDFs in cache */ |
139 |
> |
/* BSDF cache retention policies */ |
140 |
> |
#define SDretainNone 0 /* free unreferenced BSDF data */ |
141 |
> |
#define SDretainBSDFs 1 /* keep loaded BSDFs in memory */ |
142 |
|
#define SDretainAll 2 /* also keep cumulative cache data */ |
143 |
|
|
144 |
|
extern int SDretainSet; /* =SDretainNone by default */ |
157 |
|
|
158 |
|
/* Allocate new spectral distribution function */ |
159 |
|
extern SDSpectralDF *SDnewSpectralDF(int nc); |
160 |
+ |
|
161 |
+ |
/* Add component(s) to spectral distribution function */ |
162 |
+ |
extern SDSpectralDF *SDaddComponent(SDSpectralDF *odf, int nadd); |
163 |
|
|
164 |
|
/* Free a spectral distribution function */ |
165 |
|
extern void SDfreeSpectralDF(SDSpectralDF *df); |