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" |
12 |
|
#include "rtprocess.h" /* getpid() */ |
13 |
|
#include "platform.h" |
14 |
|
#include "RtraceSimulManager.h" |
15 |
+ |
#include "func.h" |
16 |
|
|
17 |
|
extern char *progname; /* global argv[0] */ |
18 |
|
|
44 |
|
char *tralist[MAXMODLIST]; /* list of modifers to trace (or no) */ |
45 |
|
int traincl = -1; /* include == 1, exclude == 0 */ |
46 |
|
|
47 |
< |
double (*sens_curve)(SCOLOR scol) = NULL; /* spectral conversion for 1-channel */ |
47 |
> |
double (*sens_curve)(const SCOLOR scol) = NULL; /* spectral conversion for 1-channel */ |
48 |
|
double out_scalefactor = 1; /* output calibration scale factor */ |
49 |
|
RGBPRIMP out_prims = stdprims; /* output color primitives (NULL if spectral) */ |
50 |
|
static RGBPRIMS our_prims; /* private output color primitives */ |
53 |
|
static void sigdie(int signo, const char *msg); |
54 |
|
static void printdefaults(void); |
55 |
|
|
56 |
< |
#define RXTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \ |
56 |
> |
#define RXTRACE_FEATURES "IrradianceCalc\nMultiprocessing\nDistanceLimiting\n" \ |
57 |
|
"HessianAmbientCache\nAmbientAveraging\n" \ |
58 |
|
"AmbientValueSharing\nAdaptiveShadowTesting\n" \ |
59 |
|
"Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \ |
81 |
|
strcat(RFeatureList, RXTRACE_FEATURES); |
82 |
|
if (argc > 1 && !strcmp(argv[1], "-features")) |
83 |
|
return feature_status(argc-2, argv+2); |
84 |
+ |
/* initialize calcomp routines */ |
85 |
+ |
initfunc(); |
86 |
|
/* add trace notify function */ |
87 |
|
for (i = 0; addobjnotify[i] != NULL; i++) |
88 |
|
; |
145 |
|
break; |
146 |
|
case 'I': /* immed. irradiance */ |
147 |
|
rval = myRTmanager.rtFlags & RTimmIrrad; |
148 |
< |
check_bool(3,rval); |
148 |
> |
check_bool(2,rval); |
149 |
|
if (rval) myRTmanager.rtFlags |= RTimmIrrad; |
150 |
|
else myRTmanager.rtFlags &= ~RTimmIrrad; |
151 |
|
break; |
306 |
|
rval = setspectrsamp(CNDX, WLPART); |
307 |
|
if (rval < 0) |
308 |
|
error(USER, "unsupported spectral sampling"); |
309 |
< |
if (out_prims != NULL) { |
309 |
> |
if (sens_curve != NULL) |
310 |
> |
out_prims = NULL; |
311 |
> |
else if (out_prims != NULL) { |
312 |
|
if (!rval) |
313 |
|
error(WARNING, "spectral range incompatible with color output"); |
314 |
|
} else if (NCSAMP == 3) |
357 |
|
SET_FILE_BINARY(stdout); |
358 |
|
if (doheader) { /* print header? */ |
359 |
|
newheader("RADIANCE", stdout); |
360 |
< |
const char * ohdr = myRTmanager.GetHeader(); |
356 |
< |
if (ohdr) fputs(ohdr, stdout); |
360 |
> |
fputs(myRTmanager.GetHeadStr(), stdout); |
361 |
|
printargs(i, argv, stdout); |
362 |
|
printf("SOFTWARE= %s\n", VersionID); |
363 |
|
fputnow(stdout); |
364 |
|
if (rval > 0) /* saved from setrtoutput() call */ |
365 |
< |
printf("NCOMP=%d\n", rval); |
365 |
> |
fputncomp(rval, stdout); |
366 |
> |
if (NCSAMP > 3) |
367 |
> |
fputwlsplit(WLPART, stdout); |
368 |
> |
if ((out_prims != stdprims) & (out_prims != NULL)) |
369 |
> |
fputprims(out_prims, stdout); |
370 |
|
if ((outform == 'f') | (outform == 'd')) |
371 |
|
fputendian(stdout); |
372 |
|
fputformat(formstr(outform), stdout); |
396 |
|
|
397 |
|
void |
398 |
|
eputs( /* put string to stderr */ |
399 |
< |
char *s |
399 |
> |
const char *s |
400 |
|
) |
401 |
|
{ |
402 |
|
static int midline = 0; |