| 12 |
|
#include "rtprocess.h" /* getpid() */ |
| 13 |
|
#include "platform.h" |
| 14 |
|
#include "RtraceSimulManager.h" |
| 15 |
+ |
#include "func.h" |
| 16 |
|
|
| 16 |
– |
extern char *progname; /* global argv[0] */ |
| 17 |
– |
|
| 17 |
|
static const char *sigerr[NSIG]; /* signal error messages */ |
| 18 |
|
char *errfile = NULL; /* error output file */ |
| 19 |
|
|
| 54 |
|
#define RXTRACE_FEATURES "IrradianceCalc\nMultiprocessing\nDistanceLimiting\n" \ |
| 55 |
|
"HessianAmbientCache\nAmbientAveraging\n" \ |
| 56 |
|
"AmbientValueSharing\nAdaptiveShadowTesting\n" \ |
| 57 |
+ |
"InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \ |
| 58 |
|
"Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \ |
| 59 |
|
"OutputCS=RGB,XYZ,Y,S,M,prims,spec\n" |
| 60 |
|
|
| 80 |
|
strcat(RFeatureList, RXTRACE_FEATURES); |
| 81 |
|
if (argc > 1 && !strcmp(argv[1], "-features")) |
| 82 |
|
return feature_status(argc-2, argv+2); |
| 83 |
+ |
/* initialize calcomp routines */ |
| 84 |
+ |
initfunc(); |
| 85 |
|
/* add trace notify function */ |
| 86 |
|
for (i = 0; addobjnotify[i] != NULL; i++) |
| 87 |
|
; |
| 265 |
|
case 'Y': /* photopic response */ |
| 266 |
|
if (argv[i][3]) |
| 267 |
|
goto badopt; |
| 266 |
– |
sens_curve = scolor_photopic; |
| 268 |
|
out_scalefactor = WHTEFFICACY; |
| 269 |
+ |
sens_curve = scolor_photopic; |
| 270 |
|
break; |
| 271 |
|
case 'S': /* scotopic response */ |
| 272 |
|
if (argv[i][3]) |
| 273 |
|
goto badopt; |
| 272 |
– |
sens_curve = scolor_scotopic; |
| 274 |
|
out_scalefactor = WHTSCOTOPIC; |
| 275 |
+ |
sens_curve = scolor_scotopic; |
| 276 |
|
break; |
| 277 |
|
case 'M': /* melanopic response */ |
| 278 |
|
if (argv[i][3]) |
| 279 |
|
goto badopt; |
| 278 |
– |
sens_curve = scolor_melanopic; |
| 280 |
|
out_scalefactor = WHTMELANOPIC; |
| 281 |
+ |
sens_curve = scolor_melanopic; |
| 282 |
|
break; |
| 283 |
+ |
case 'A': /* radiometric average */ |
| 284 |
+ |
if (argv[i][3]) |
| 285 |
+ |
goto badopt; |
| 286 |
+ |
out_scalefactor = 1; |
| 287 |
+ |
sens_curve = scolor_mean; |
| 288 |
+ |
break; |
| 289 |
|
default: |
| 290 |
|
goto badopt; |
| 291 |
|
} |
| 311 |
|
rval = setspectrsamp(CNDX, WLPART); |
| 312 |
|
if (rval < 0) |
| 313 |
|
error(USER, "unsupported spectral sampling"); |
| 314 |
< |
if (out_prims != NULL) { |
| 314 |
> |
if (sens_curve != NULL) |
| 315 |
> |
out_prims = NULL; |
| 316 |
> |
else if (out_prims != NULL) { |
| 317 |
|
if (!rval) |
| 318 |
|
error(WARNING, "spectral range incompatible with color output"); |
| 319 |
|
} else if (NCSAMP == 3) |
| 367 |
|
printf("SOFTWARE= %s\n", VersionID); |
| 368 |
|
fputnow(stdout); |
| 369 |
|
if (rval > 0) /* saved from setrtoutput() call */ |
| 370 |
< |
printf("NCOMP=%d\n", rval); |
| 370 |
> |
fputncomp(rval, stdout); |
| 371 |
> |
if (NCSAMP > 3) |
| 372 |
> |
fputwlsplit(WLPART, stdout); |
| 373 |
> |
if ((out_prims != stdprims) & (out_prims != NULL)) |
| 374 |
> |
fputprims(out_prims, stdout); |
| 375 |
|
if ((outform == 'f') | (outform == 'd')) |
| 376 |
|
fputendian(stdout); |
| 377 |
|
fputformat(formstr(outform), stdout); |