ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/bsdfrep.h
(Generate patch)

Comparing ray/src/cv/bsdfrep.h (file contents):
Revision 2.14 by greg, Sat Mar 8 06:37:59 2014 UTC vs.
Revision 2.20 by greg, Thu Aug 21 10:33:48 2014 UTC

# Line 5 | Line 5
5   *      G. Ward
6   */
7  
8 + #ifndef _BSDFREP_H_
9 + #define _BSDFREP_H_
10 +
11   #include "bsdf.h"
12  
13 < #define DEBUG           1
13 > #ifdef __cplusplus
14 > extern "C" {
15 > #endif
16  
17   #ifndef GRIDRES
18   #define GRIDRES         (1<<8)          /* grid resolution per side */
# Line 16 | Line 21
21   #define ANG2R(r)        (int)((r)*((1<<16)/M_PI))
22   #define R2ANG(c)        (((c)+.5)*(M_PI/(1<<16)))
23  
24 < typedef struct {
25 <        float           vsum;           /* DSF sum */
26 <        unsigned int    nval;           /* number of values in sum */
24 > typedef union {
25 >        struct {
26 >                float           v;              /* DSF sum */
27 >                unsigned int    n;              /* number of values in sum */
28 >        }       sum;                    /* sum for averaging */
29 >        float   val[2];                 /* comparison values */
30   } GRIDVAL;                      /* grid value */
31  
32   typedef struct {
# Line 82 | Line 90 | extern unsigned long   bsdf_hist[HISTLEN];
90  
91                                  /* BSDF value for boundary regions */
92   extern double           bsdf_min;
93 + extern float            bsdf_spec_peak;
94 + extern int              bsdf_spec_crad;
95  
96                                  /* processed incident DSF measurements */
97   extern RBFNODE          *dsf_list;
# Line 140 | Line 150 | extern void            ovec_from_pos(FVECT vec, int xpos, int yp
150   /* Compute grid position from normalized input/output vector */
151   extern void             pos_from_vec(int pos[2], const FVECT vec);
152  
153 < /* Evaluate RBF for DSF at the given normalized outgoing direction */
153 > /* Evaluate BSDF at the given normalized outgoing direction */
154   extern double           eval_rbfrep(const RBFNODE *rp, const FVECT outvec);
155  
156   /* Insert a new directional scattering function in our global list */
# Line 185 | Line 195 | extern void            build_mesh(void);
195   /* Find edge(s) for interpolating the given vector, applying symmetry */
196   extern int              get_interp(MIGRATION *miga[3], FVECT invec);
197  
198 + /* Return single-lobe specular RBF for the given incident direction */
199 + extern RBFNODE *        def_rbf_spec(const FVECT invec);
200 +
201   /* Advect and allocate new RBF along edge (internal call) */
202   extern RBFNODE *        e_advect_rbf(const MIGRATION *mig,
203                                          const FVECT invec, int lobe_lim);
204  
205 + /* Compute distance between two RBF lobes (internal call) */
206 + extern double           lobe_distance(RBFVAL *rbf1, RBFVAL *rbf2);
207 +
208 + /* Compute mass transport plan (internal call) */
209 + extern void             plan_transport(MIGRATION *mig);
210 +
211   /* Partially advect between recorded incident angles and allocate new RBF */
212   extern RBFNODE *        advect_rbf(const FVECT invec, int lobe_lim);
213 +
214 + #ifdef __cplusplus
215 + }
216 + #endif
217 + #endif  /* _BSDFREP_H_ */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines