--- ray/src/rt/rcontrib.h 2016/03/21 19:06:08 2.14 +++ ray/src/rt/rcontrib.h 2023/11/15 18:02:53 2.19 @@ -1,4 +1,4 @@ -/* RCSid $Id: rcontrib.h,v 2.14 2016/03/21 19:06:08 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,18 +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 */ /* @@ -86,17 +94,12 @@ extern LUTAB ofiletab; /* output stream table */ #endif #endif -#ifndef MAXMODLIST -#define MAXMODLIST 10000 /* 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, @@ -119,6 +122,8 @@ extern int in_rchild(void); 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 */