2 |
|
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
|
/* |
5 |
< |
* rxtmain.c - main for per-ray calculation program |
5 |
> |
* rxtmain.cpp - main for per-ray calculation program |
6 |
|
*/ |
7 |
|
|
8 |
|
#include "copyright.h" |
43 |
|
char *tralist[MAXMODLIST]; /* list of modifers to trace (or no) */ |
44 |
|
int traincl = -1; /* include == 1, exclude == 0 */ |
45 |
|
|
46 |
< |
double (*sens_curve)(SCOLOR scol) = NULL; /* spectral conversion for 1-channel */ |
46 |
> |
double (*sens_curve)(const SCOLOR scol) = NULL; /* spectral conversion for 1-channel */ |
47 |
|
double out_scalefactor = 1; /* output calibration scale factor */ |
48 |
|
RGBPRIMP out_prims = stdprims; /* output color primitives (NULL if spectral) */ |
49 |
|
static RGBPRIMS our_prims; /* private output color primitives */ |
52 |
|
static void sigdie(int signo, const char *msg); |
53 |
|
static void printdefaults(void); |
54 |
|
|
55 |
< |
#define RXTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \ |
55 |
> |
#define RXTRACE_FEATURES "IrradianceCalc\nMultiprocessing\nDistanceLimiting\n" \ |
56 |
|
"HessianAmbientCache\nAmbientAveraging\n" \ |
57 |
|
"AmbientValueSharing\nAdaptiveShadowTesting\n" \ |
58 |
|
"Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \ |
142 |
|
break; |
143 |
|
case 'I': /* immed. irradiance */ |
144 |
|
rval = myRTmanager.rtFlags & RTimmIrrad; |
145 |
< |
check_bool(3,rval); |
145 |
> |
check_bool(2,rval); |
146 |
|
if (rval) myRTmanager.rtFlags |= RTimmIrrad; |
147 |
|
else myRTmanager.rtFlags &= ~RTimmIrrad; |
148 |
|
break; |
299 |
|
goto badopt; |
300 |
|
} |
301 |
|
} |
302 |
+ |
/* set/check spectral sampling */ |
303 |
+ |
rval = setspectrsamp(CNDX, WLPART); |
304 |
+ |
if (rval < 0) |
305 |
+ |
error(USER, "unsupported spectral sampling"); |
306 |
+ |
if (out_prims != NULL) { |
307 |
+ |
if (!rval) |
308 |
+ |
error(WARNING, "spectral range incompatible with color output"); |
309 |
+ |
} else if (NCSAMP == 3) |
310 |
+ |
out_prims = stdprims; /* 3 samples do not a spectrum make */ |
311 |
|
/* set up signal handling */ |
312 |
|
sigdie(SIGINT, "Interrupt"); |
313 |
|
#ifdef SIGHUP |
351 |
|
if (outform != 'a') |
352 |
|
SET_FILE_BINARY(stdout); |
353 |
|
if (doheader) { /* print header? */ |
354 |
< |
static char fmt[] = OCTFMT; |
355 |
< |
FILE * octfp = fopen(argv[i], "rb"); |
347 |
< |
if (checkheader(octfp, fmt, stdout) < 0) |
348 |
< |
error(USER, "bad octree header"); |
349 |
< |
fclose(octfp); |
354 |
> |
newheader("RADIANCE", stdout); |
355 |
> |
fputs(myRTmanager.GetHeadStr(), stdout); |
356 |
|
printargs(i, argv, stdout); |
357 |
|
printf("SOFTWARE= %s\n", VersionID); |
358 |
|
fputnow(stdout); |
361 |
|
if ((outform == 'f') | (outform == 'd')) |
362 |
|
fputendian(stdout); |
363 |
|
fputformat(formstr(outform), stdout); |
364 |
< |
putchar('\n'); |
364 |
> |
fputc('\n', stdout); /* end of header */ |
365 |
|
} |
366 |
|
rtrace(NULL, nproc); /* trace rays */ |
367 |
|
quit(0); /* clean up & exit */ |
387 |
|
|
388 |
|
void |
389 |
|
eputs( /* put string to stderr */ |
390 |
< |
char *s |
390 |
> |
const char *s |
391 |
|
) |
392 |
|
{ |
393 |
|
static int midline = 0; |