| 21 |
|
|
| 22 |
|
extern char *progname; /* global argv[0] */ |
| 23 |
|
|
| 24 |
– |
extern char *shm_boundary; /* boundary of shared memory */ |
| 25 |
– |
|
| 24 |
|
/* persistent processes define */ |
| 25 |
|
#ifdef F_SETLKW |
| 26 |
|
#define PERSIST 1 /* normal persist */ |
| 57 |
|
char *tralist[MAXMODLIST]; /* list of modifers to trace (or no) */ |
| 58 |
|
int traincl = -1; /* include == 1, exclude == 0 */ |
| 59 |
|
|
| 60 |
< |
double (*sens_curve)(SCOLOR scol) = NULL; /* spectral conversion for 1-channel */ |
| 60 |
> |
double (*sens_curve)(const SCOLOR scol) = NULL; /* spectral conversion for 1-channel */ |
| 61 |
|
double out_scalefactor = 1; /* output calibration scale factor */ |
| 62 |
|
RGBPRIMP out_prims = stdprims; /* output color primitives (NULL if spectral) */ |
| 63 |
|
static RGBPRIMS our_prims; /* private output color primitives */ |
| 75 |
|
"HessianAmbientCache\nAmbientAveraging\n" \ |
| 76 |
|
"AmbientValueSharing\nAdaptiveShadowTesting\n" \ |
| 77 |
|
"InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \ |
| 78 |
< |
"Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" |
| 78 |
> |
"Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \ |
| 79 |
> |
"OutputCS=RGB,XYZ,Y,S,M,prims,spec\n" |
| 80 |
|
#else |
| 81 |
|
#define RTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \ |
| 82 |
|
"ParticipatingMedia=Mist\n" \ |
| 83 |
|
"HessianAmbientCache\nAmbientAveraging\n" \ |
| 84 |
|
"AmbientValueSharing\nAdaptiveShadowTesting\n" \ |
| 85 |
|
"InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \ |
| 86 |
< |
"Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" |
| 86 |
> |
"Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \ |
| 87 |
> |
"OutputCS=RGB,XYZ,Y,S,M,prims,spec\n" |
| 88 |
|
#endif |
| 89 |
|
|
| 90 |
|
|
| 294 |
|
sens_curve = NULL; |
| 295 |
|
} break; |
| 296 |
|
case 'Y': /* photopic response */ |
| 297 |
+ |
if (argv[i][3]) |
| 298 |
+ |
goto badopt; |
| 299 |
|
sens_curve = scolor_photopic; |
| 300 |
|
out_scalefactor = WHTEFFICACY; |
| 301 |
|
break; |
| 302 |
|
case 'S': /* scotopic response */ |
| 303 |
+ |
if (argv[i][3]) |
| 304 |
+ |
goto badopt; |
| 305 |
|
sens_curve = scolor_scotopic; |
| 306 |
|
out_scalefactor = WHTSCOTOPIC; |
| 307 |
|
break; |
| 308 |
|
case 'M': /* melanopic response */ |
| 309 |
+ |
if (argv[i][3]) |
| 310 |
+ |
goto badopt; |
| 311 |
|
sens_curve = scolor_melanopic; |
| 312 |
|
out_scalefactor = WHTMELANOPIC; |
| 313 |
|
break; |
| 348 |
|
rval = setspectrsamp(CNDX, WLPART); |
| 349 |
|
if (rval < 0) |
| 350 |
|
error(USER, "unsupported spectral sampling"); |
| 351 |
< |
if (out_prims != NULL) { |
| 351 |
> |
if (sens_curve != NULL) |
| 352 |
> |
out_prims = NULL; |
| 353 |
> |
else if (out_prims != NULL) { |
| 354 |
|
if (!rval) |
| 355 |
|
error(WARNING, "spectral range incompatible with color output"); |
| 356 |
|
} else if (NCSAMP == 3) |
| 453 |
|
dup2(duped1, fileno(stdout)); |
| 454 |
|
close(duped1); |
| 455 |
|
if (persist == PARALLEL) { /* multiprocessing */ |
| 456 |
< |
preload_objs(); /* preload scene */ |
| 449 |
< |
shm_boundary = (char *)malloc(16); |
| 450 |
< |
strcpy(shm_boundary, "SHM_BOUNDARY"); |
| 456 |
> |
cow_memshare(); /* preloads scene */ |
| 457 |
|
while ((rval=fork()) == 0) { /* keep on forkin' */ |
| 458 |
|
pflock(1); |
| 459 |
|
pfhold(); |
| 510 |
|
) |
| 511 |
|
{ |
| 512 |
|
int lasterrno = errno; |
| 513 |
+ |
if (erract[WARNING].pf == NULL) |
| 514 |
+ |
return; /* called by calcomp or someone */ |
| 515 |
|
eputs(s); |
| 516 |
|
errno = lasterrno; |
| 517 |
|
} |
| 632 |
|
out_prims[GRN][0], out_prims[GRN][1], |
| 633 |
|
out_prims[BLU][0], out_prims[BLU][1], |
| 634 |
|
out_prims[WHT][0], out_prims[WHT][1]); |
| 635 |
< |
if (NCSAMP > 3) |
| 635 |
> |
if ((sens_curve == NULL) & (NCSAMP > 3)) |
| 636 |
|
printf(out_prims != NULL ? "-co-\t\t\t\t# output tristimulus colors\n" : |
| 637 |
|
"-co+\t\t\t\t# output spectral values\n"); |
| 638 |
|
print_rdefaults(); |