--- ray/src/common/bsdf_t.h 2011/02/18 00:40:25 3.1 +++ ray/src/common/bsdf_t.h 2011/04/24 19:39:21 3.6 @@ -1,7 +1,10 @@ +/* RCSid $Id: bsdf_t.h,v 3.6 2011/04/24 19:39:21 greg Exp $ */ /* * bsdf_t.h * - * Support for variable-resolution BSDF trees + * Support for variable-resolution BSDF trees. + * Assumes "bsdf.h" already included. + * Include after "ezxml.h" for SDloadTre() declaration. * * Created by Greg Ward on 2/2/11. * @@ -26,11 +29,32 @@ typedef struct SDNode_s { } u; /* subtrees or values (extends struct) */ } SDNode; +/* Variable-resolution BSDF holder */ +typedef struct { + int isxmit; /* transmitted component? */ + SDNode *st; /* BSDF tree */ +} SDTre; + +/* Holder for cumulative distribution (sum of BSDF * projSA) */ +typedef struct { + SD_CDIST_BASE; /* base fields; must come first */ + double clim[2][2]; /* input coordinate limits */ + double max_psa; /* maximum projected solid angle */ + int isxmit; /* transmitted component? */ + int calen; /* cumulative array length */ + struct { + unsigned hndx; /* hilbert index */ + unsigned cuml; /* cumulative value */ + } carr[1]; /* cumulative array (extends struct) */ +} SDTreCDst; + +#ifdef _EZXML_H /* Load a variable-resolution BSDF tree from an open XML file */ -extern SDError SDloadTre(SDData *sd, ezxml_t fl); +extern SDError SDloadTre(SDData *sd, ezxml_t wtl); +#endif /* Our matrix handling routines */ -extern const SDFunc SDhandleTre; +extern SDFunc SDhandleTre; #ifdef __cplusplus }