--- ray/src/gen/mkillum.h 1991/07/23 16:13:27 1.2 +++ ray/src/gen/mkillum.h 2010/09/03 23:53:50 2.18 @@ -1,38 +1,75 @@ -/* Copyright (c) 1991 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid: $Id: mkillum.h,v 2.18 2010/09/03 23:53:50 greg Exp $ */ /* * Common definitions for mkillum */ +#ifndef _RAD_MKILLUM_H_ +#define _RAD_MKILLUM_H_ -#include "standard.h" - -#include "object.h" - +#include "ray.h" #include "otypes.h" +#include "bsdf.h" +#include "random.h" +#ifdef __cplusplus +extern "C" { +#endif /* illum flags */ -#define IL_FLAT 0x1 /* flat surface */ -#define IL_LIGHT 0x2 /* light rather than illum */ -#define IL_COLDST 0x4 /* colored distribution */ -#define IL_COLAVG 0x8 /* compute average color */ -#define IL_DATCLB 0x10 /* OK to clobber data file */ +#define IL_LIGHT 0x1 /* light rather than illum */ +#define IL_COLDST 0x2 /* use color distribution */ +#define IL_COLAVG 0x4 /* use average color */ +#define IL_DATCLB 0x8 /* OK to clobber data file */ struct illum_args { int flags; /* flags from list above */ + UpDir udir; /* up direction */ + double thick; /* object thickness */ char matname[MAXSTR]; /* illum material name */ char datafile[MAXSTR]; /* distribution data file name */ int dfnum; /* data file number */ char altmat[MAXSTR]; /* alternate material name */ + int sampdens; /* point sample density */ int nsamps; /* # of samples in each direction */ - int nalt, nazi; /* # of altitude and azimuth angles */ - FVECT orient; /* coordinate system orientation */ + struct BSDF_data + *sd; /* scattering data (if set) */ + float minbrt; /* minimum average brightness */ + COLOR col; /* computed average color */ }; /* illum options */ -struct rtproc { - int pd[3]; /* rtrace pipe descriptors */ - float *buf; /* rtrace i/o buffer */ - int bsiz; /* maximum rays for rtrace buffer */ - int nrays; /* current length of rtrace buffer */ -}; /* rtrace process */ +extern void redistribute(struct BSDF_data *b, int nalt, int nazi, + FVECT u, FVECT v, FVECT w, MAT4 xm); + +extern void printobj(char *mod, OBJREC *obj); +extern int average(struct illum_args *il, COLORV *da, int n); +extern void flatout(struct illum_args *il, COLORV *da, int n, int m, + FVECT u, FVECT v, FVECT w); +extern void illumout(struct illum_args *il, OBJREC *ob); +extern void roundout(struct illum_args *il, COLORV *da, int n, int m); + +extern void newdist(int siz); +extern int process_ray(RAY *r, int rv); +extern void raysamp(int ndx, FVECT org, FVECT dir); +extern void rayclean(void); + +extern void flatdir(FVECT dv, double alt, double azi); +extern int flatindex(FVECT dv, int nalt, int nazi); + +extern int printgeom(struct BSDF_data *sd, char *xfrot, + FVECT ctr, double s1, double s2); + +extern int my_default(OBJREC *, struct illum_args *, char *); +extern int my_face(OBJREC *, struct illum_args *, char *); +extern int my_sphere(OBJREC *, struct illum_args *, char *); +extern int my_ring(OBJREC *, struct illum_args *, char *); + +extern COLORV * distarr; /* distribution array */ +extern int distsiz; +extern COLORV * direct_discount; /* amount to take off direct */ + +extern char *progname; + +#ifdef __cplusplus +} +#endif + +#endif /* _RAD_MKILLUM_H_ */ +