Back to index

radiance  4R0+20100331
mkillum.h
Go to the documentation of this file.
00001 /* RCSid: $Id: mkillum.h,v 2.17 2009/06/12 17:37:37 greg Exp $ */
00002 /*
00003  * Common definitions for mkillum
00004  */
00005 #ifndef _RAD_MKILLUM_H_
00006 #define _RAD_MKILLUM_H_
00007 
00008 #include  "ray.h"
00009 #include  "otypes.h"
00010 #include  "bsdf.h"
00011 #include  "random.h"
00012 
00013 #ifdef __cplusplus
00014 extern "C" {
00015 #endif
00016                             /* illum flags */
00017 #define  IL_LIGHT    0x1           /* light rather than illum */
00018 #define  IL_COLDST   0x2           /* use color distribution */
00019 #define  IL_COLAVG   0x4           /* use average color */
00020 #define  IL_DATCLB   0x8           /* OK to clobber data file */
00021 
00022 struct illum_args {
00023        int    flags;               /* flags from list above */
00024        UpDir  udir;                /* up direction */
00025        double thick;               /* object thickness */
00026        char   matname[MAXSTR];     /* illum material name */
00027        char   datafile[MAXSTR];    /* distribution data file name */
00028        int    dfnum;               /* data file number */
00029        char   altmat[MAXSTR];             /* alternate material name */
00030        int    sampdens;            /* point sample density */
00031        int    nsamps;                     /* # of samples in each direction */
00032        struct BSDF_data
00033               *sd;                 /* scattering data (if set) */
00034        float  minbrt;                     /* minimum average brightness */
00035        COLOR  col;                 /* computed average color */
00036 };                          /* illum options */
00037 
00038 extern void redistribute(struct BSDF_data *b, int nalt, int nazi,
00039                             FVECT u, FVECT v, FVECT w, MAT4 xm);
00040 
00041 extern void printobj(char *mod, OBJREC *obj);
00042 extern int average(struct illum_args *il, COLORV *da, int n);
00043 extern void flatout(struct illum_args *il, COLORV *da, int n, int m,
00044        FVECT u, FVECT v, FVECT w);
00045 extern void illumout(struct illum_args *il, OBJREC *ob);
00046 extern void roundout(struct illum_args *il, COLORV *da, int n, int m);
00047 
00048 extern void newdist(int siz);
00049 extern int process_ray(RAY *r, int rv);
00050 extern void raysamp(int ndx, FVECT org, FVECT dir);
00051 extern void rayclean(void);
00052 
00053 extern void flatdir(FVECT  dv, double  alt, double  azi);
00054 extern int flatindex(FVECT dv, int nalt, int nazi);
00055 
00056 extern int my_default(OBJREC *, struct illum_args *, char *);
00057 extern int my_face(OBJREC *, struct illum_args *, char *);
00058 extern int my_sphere(OBJREC *, struct illum_args *, char *);
00059 extern int my_ring(OBJREC *, struct illum_args *, char *);
00060 
00061 extern COLORV *      distarr;             /* distribution array */
00062 extern int    distsiz;
00063 extern COLORV *      direct_discount;     /* amount to take off direct */
00064 
00065 extern char   *progname;
00066 
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070 
00071 #endif /* _RAD_MKILLUM_H_ */
00072