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