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

Comparing ray/src/gen/mkillum.h (file contents):
Revision 2.7 by greg, Fri Sep 17 21:43:50 2004 UTC vs.
Revision 2.11 by greg, Fri Sep 21 05:53:21 2007 UTC

# Line 5 | Line 5
5   #ifndef _RAD_MKILLUM_H_
6   #define _RAD_MKILLUM_H_
7  
8 < #include  "standard.h"
9 < #include  "object.h"
10 < #include  "rtprocess.h"
8 > #include  "ray.h"
9 > #include  "otypes.h"
10  
11   #ifdef __cplusplus
12   extern "C" {
# Line 18 | Line 17 | extern "C" {
17   #define  IL_COLAVG      0x4             /* use average color */
18   #define  IL_DATCLB      0x8             /* OK to clobber data file */
19  
20 +                                /* up directions */
21 + typedef enum {
22 +        UDzneg=-3,
23 +        UDyneg=-2,
24 +        UDxneg=-1,
25 +        UDunknown=0,
26 +        UDxpos=1,
27 +        UDypos=2,
28 +        UDzpos=3
29 + } UpDir;
30 +
31 + struct BSDF_data {
32 +        double  om_scale;               /* maximum solid angle (sr/256) */
33 +        int     ninc;                   /* number of incoming directions */
34 +        int32   *inc_dir;               /* incoming direction codes */
35 +        BYTE    *inc_rad;               /* incoming radians to neighbor */
36 +        int     nout;                   /* number of outgoing directions */
37 +        int32   *out_dir;               /* outgoing direction codes */
38 +        BYTE    *out_rad;               /* outgoing radians to neighbor */
39 +        float   *bsdf;                  /* scattering distribution data */
40 + };                              /* bidirectional scattering distrib. func. */
41 +
42   struct illum_args {
43          int     flags;                  /* flags from list above */
44 +        UpDir   udir;                   /* up direction */
45 +        double  thick;                  /* object thickness */
46          char    matname[MAXSTR];        /* illum material name */
47          char    datafile[MAXSTR];       /* distribution data file name */
48          int     dfnum;                  /* data file number */
49          char    altmat[MAXSTR];         /* alternate material name */
50          int     sampdens;               /* point sample density */
51          int     nsamps;                 /* # of samples in each direction */
52 +        struct BSDF_data
53 +                *sd;                    /* scattering data (if set) */
54          float   minbrt;                 /* minimum average brightness */
55 <        float   col[3];                 /* computed average color */
55 >        COLOR   col;                    /* computed average color */
56   };                              /* illum options */
57  
58 < struct rtproc {
59 <        struct rtproc   *next;          /* next in list of processes */
60 <        SUBPROC pd;                     /* rtrace pipe descriptors */
61 <        float   *buf;                   /* rtrace i/o buffer */
62 <        int     bsiz;                   /* maximum rays for rtrace buffer */
38 <        float   **dest;                 /* destination for each ray result */
39 <        int     nrays;                  /* current length of rtrace buffer */
40 < };                              /* rtrace process */
58 > #define getBSDF_incvec(v,b,i)   decodedir(v, (b)->inc_dir[i])
59 > #define getBSDF_outvec(v,b,o)   decodedir(v, (b)->out_dir[o])
60 > #define getBSDF_incrad(b,i)     ((b)->om_scale*((b)->inc_rad[i] + .5));
61 > #define getBSDF_outrad(b,o)     ((b)->om_scale*((b)->out_rad[o] + .5));
62 > #define BSDF_data(b,i,o)        (b)->bsdf[(o)*(b)->ninc + (i)]
63  
64 < extern void printobj(char  *mod, register OBJREC  *obj);
65 < extern int average(register struct illum_args  *il, float  *da, int  n);
66 < extern void flatout(struct illum_args  *il, float  *da, int  n, int  m,
67 <        FVECT  u, FVECT  v, FVECT  w);
68 < extern void illumout(register struct illum_args  *il, OBJREC  *ob);
69 < extern void roundout(struct illum_args  *il, float  *da, int  n, int  m);
64 > extern struct BSDF_data *load_BSDF(char *fname);
65 > extern void free_BSDF(struct BSDF_data *b);
66 > extern void r_BSDF_incvec(FVECT v, struct BSDF_data *b, int i,
67 >                                double rv, MAT4 xm);
68 > extern void r_BSDF_outvec(FVECT v, struct BSDF_data *b, int o,
69 >                                double rv, MAT4 xm);
70 > extern int getBSDF_xfm(MAT4 xm, FVECT nrm, UpDir ud);
71 > extern void redistribute(struct BSDF_data *b, int nalt, int nazi,
72 >                                FVECT u, FVECT v, FVECT w, MAT4 xm);
73  
74 < /* The header file otypes.h has to follow definition of our struct's */
75 < #define FUN_ARGLIST     OBJREC *, struct illum_args *, struct rtproc *, char *
76 < #ifdef __cplusplus
77 < }
78 < #include  "otypes.h"
79 < extern "C" {
55 < #else
56 < #include  "otypes.h"
57 < #endif
74 > extern void printobj(char *mod, OBJREC *obj);
75 > extern int average(struct illum_args *il, COLORV *da, int n);
76 > extern void flatout(struct illum_args *il, COLORV *da, int n, int m,
77 >        FVECT u, FVECT v, FVECT w);
78 > extern void illumout(struct illum_args *il, OBJREC *ob);
79 > extern void roundout(struct illum_args *il, COLORV *da, int n, int m);
80  
81 < extern int o_default(FUN_ARGLIST);
82 < extern int o_face(FUN_ARGLIST);
83 < extern int o_sphere(FUN_ARGLIST);
84 < extern int o_ring(FUN_ARGLIST);
63 < extern void raysamp(float res[3], FVECT org, FVECT dir, struct rtproc *rt0);
64 < extern void rayflush(struct rtproc *rt, int doall);
65 < extern struct rtproc *raywait(struct rtproc *rt0);
81 > extern void newdist(int siz);
82 > extern int process_ray(RAY *r, int rv);
83 > extern void raysamp(int ndx, FVECT org, FVECT dir);
84 > extern void rayclean(void);
85  
86 + extern int my_default(OBJREC *, struct illum_args *, char *);
87 + extern int my_face(OBJREC *, struct illum_args *, char *);
88 + extern int my_sphere(OBJREC *, struct illum_args *, char *);
89 + extern int my_ring(OBJREC *, struct illum_args *, char *);
90 +
91 + extern COLORV * distarr;                /* distribution array */
92 + extern int      distsiz;
93 +
94 + extern char     *progname;
95  
96   #ifdef __cplusplus
97   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines