| 1 |
greg |
3.2 |
/* RCSid $Id$ */
|
| 2 |
greg |
3.1 |
/*
|
| 3 |
|
|
* bsdf_t.h
|
| 4 |
|
|
*
|
| 5 |
|
|
* Support for variable-resolution BSDF trees
|
| 6 |
|
|
*
|
| 7 |
|
|
* Created by Greg Ward on 2/2/11.
|
| 8 |
|
|
*
|
| 9 |
|
|
*/
|
| 10 |
|
|
|
| 11 |
|
|
#ifndef _BSDF_T_H_
|
| 12 |
|
|
#define _BSDF_T_H_
|
| 13 |
|
|
|
| 14 |
|
|
#ifdef __cplusplus
|
| 15 |
|
|
extern "C" {
|
| 16 |
|
|
#endif
|
| 17 |
|
|
|
| 18 |
|
|
#define SD_MAXDIM 4 /* maximum expected # dimensions */
|
| 19 |
|
|
|
| 20 |
|
|
/* Basic node structure for variable-resolution BSDF data */
|
| 21 |
|
|
typedef struct SDNode_s {
|
| 22 |
|
|
short ndim; /* number of dimensions */
|
| 23 |
|
|
short log2GR; /* log(2) of grid resolution (< 0 for tree) */
|
| 24 |
|
|
union {
|
| 25 |
|
|
struct SDNode_s *t[1]; /* subtree pointers */
|
| 26 |
|
|
float v[1]; /* scattering value(s) */
|
| 27 |
|
|
} u; /* subtrees or values (extends struct) */
|
| 28 |
|
|
} SDNode;
|
| 29 |
|
|
|
| 30 |
|
|
/* Load a variable-resolution BSDF tree from an open XML file */
|
| 31 |
|
|
extern SDError SDloadTre(SDData *sd, ezxml_t fl);
|
| 32 |
|
|
|
| 33 |
|
|
/* Our matrix handling routines */
|
| 34 |
|
|
extern const SDFunc SDhandleTre;
|
| 35 |
|
|
|
| 36 |
|
|
#ifdef __cplusplus
|
| 37 |
|
|
}
|
| 38 |
|
|
#endif
|
| 39 |
|
|
#endif /* ! _BSDF_T_H_ */
|