--- ray/src/rt/rcontrib.h 2020/09/09 21:28:19 2.16 +++ ray/src/rt/rcontrib.h 2023/11/15 18:02:53 2.19 @@ -1,4 +1,4 @@ -/* RCSid $Id: rcontrib.h,v 2.16 2020/09/09 21:28:19 greg Exp $ */ +/* RCSid $Id: rcontrib.h,v 2.19 2023/11/15 18:02:53 greg Exp $ */ /* * Header file for rcontrib modules @@ -44,7 +44,7 @@ extern RNUMBER lastdone; /* last ray processed */ extern int report_intvl; /* reporting interval (seconds) */ -typedef double DCOLOR[3]; /* double-precision color */ +typedef double DCOLORV; /* double-precision color type */ /* * The MODCONT structure is used to accumulate ray contributions @@ -53,8 +53,9 @@ 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 */ @@ -63,9 +64,13 @@ typedef struct { 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 */ /* @@ -89,16 +94,11 @@ 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 */