--- ray/src/rt/rcontrib.h 2012/06/22 21:58:45 2.8 +++ ray/src/rt/rcontrib.h 2023/11/15 18:02:53 2.19 @@ -1,4 +1,4 @@ -/* RCSid $Id: rcontrib.h,v 2.8 2012/06/22 21:58:45 greg Exp $ */ +/* RCSid $Id: rcontrib.h,v 2.19 2023/11/15 18:02:53 greg Exp $ */ /* * Header file for rcontrib modules @@ -42,8 +42,10 @@ extern long waitflush; /* how long until next flush * extern RNUMBER lastray; /* last ray number sent */ extern RNUMBER lastdone; /* last ray processed */ -typedef double DCOLOR[3]; /* double-precision color */ +extern int report_intvl; /* reporting interval (seconds) */ +typedef double DCOLORV; /* double-precision color type */ + /* * The MODCONT structure is used to accumulate ray contributions * for a particular modifier, which may be subdivided into bins @@ -51,17 +53,24 @@ typedef double DCOLOR[3]; /* double-precision color * * be replaced with the modifier name. If outspec contains a %d in it, * this will be used to create one output file per bin, otherwise all bins * will be written to the same file, in order. If the global outfmt - * is 'c', then a 4-byte RGBE pixel will be output for each bin value - * and the file will conform to a RADIANCE image if xres & yres are set. + * is 'c', then a common-exponent pixel will be output for each bin value + * and the file will conform to a RADIANCE picture if NCSAMP==3 and + * xres and yres are set. */ typedef struct { const char *outspec; /* output file specification */ const char *modname; /* modifier name */ + const char *params; /* parameter list */ EPNODE *binv; /* bin value expression */ + int bin0; /* starting bin offset */ int nbins; /* number of contribution bins */ - DCOLOR cbin[1]; /* contribution bins (extends struct) */ + DCOLORV cbin[1]; /* contribution bins (extends struct) */ } MODCONT; /* modifier contribution */ +#define DCOLORSIZ (sizeof(DCOLORV)*NCSAMP) +#define mcsize(nb) (sizeof(MODCONT)-sizeof(DCOLORV)+(nb)*DCOLORSIZ) +#define mcbin(mp,bi) ((mp)->cbin + (bi)*NCSAMP) + extern LUTAB modconttab; /* modifier contribution table */ /* @@ -78,24 +87,19 @@ typedef struct { extern LUTAB ofiletab; /* output stream table */ #ifndef MAXPROCESS -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) #define MAXPROCESS 1 #else #define MAXPROCESS 128 #endif #endif -#ifndef MAXMODLIST -#define MAXMODLIST 2048 /* maximum modifiers we'll track */ -#endif - -extern const char *modname[MAXMODLIST]; /* ordered modifier name list */ +extern char **modname; /* ordered modifier name list */ extern int nmods; /* number of modifiers */ +extern int modasiz; /* allocated modifier array size */ extern char RCCONTEXT[]; /* special evaluation context */ -extern char *formstr(int f); /* return format identifier */ - extern void process_rcontrib(void); /* trace ray contributions */ extern STREAMOUT * getostream(const char *ospec, const char *mname, @@ -105,9 +109,9 @@ extern void mod_output(MODCONT *mp); extern void end_record(void); extern MODCONT *addmodifier(char *modn, char *outf, - char *binv, int bincnt); + char *prms, char *binv, int bincnt); extern void addmodfile(char *fname, char *outf, - char *binv, int bincnt); + char *prms, char *binv, int bincnt); extern void reload_output(void); extern void recover_output(void); @@ -119,6 +123,10 @@ extern void end_children(int immed); extern void put_zero_record(int ndx); +extern int morays(void); /* reached end of input? */ + extern void parental_loop(void); /* controlling process */ + +extern void feeder_loop(void); /* feeder process */ extern void rcontrib(void); /* main calculation loop */