52 |
|
|
53 |
|
extern double dblur; /* depth-of-field blur parameter */ |
54 |
|
|
55 |
+ |
RGBPRIMP out_prims = stdprims; /* output color primitives */ |
56 |
+ |
static RGBPRIMS our_prims; /* private output color primitives */ |
57 |
+ |
|
58 |
|
static void onsig(int signo); |
59 |
|
static void sigdie(int signo, char *msg); |
60 |
|
static void printdefaults(void); |
61 |
|
/* rpict additional features */ |
62 |
|
#ifdef PERSIST |
63 |
|
#define RPICT_FEATURES "Persist\nParallelPersist\n" \ |
64 |
< |
"ParticipatingMedia=Mist\n" \ |
64 |
> |
"Hyperspectral\nParticipatingMedia=Mist\n" \ |
65 |
|
"Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
66 |
|
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ |
67 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
69 |
|
"AdaptiveShadowTesting\nOutputs=v,l\n" |
70 |
|
#else |
71 |
|
#define RPICT_FEATURES "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
72 |
< |
"ParticipatingMedia=Mist\n" \ |
72 |
> |
"Hyperspectral\nParticipatingMedia=Mist\n" \ |
73 |
|
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ |
74 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
75 |
|
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
183 |
|
check(3,"f"); |
184 |
|
dblur = atof(argv[++i]); |
185 |
|
break; |
186 |
+ |
case 'R': /* standard RGB output */ |
187 |
+ |
if (strcmp(argv[i]+2, "RGB")) |
188 |
+ |
goto badopt; |
189 |
+ |
out_prims = stdprims; |
190 |
+ |
break; |
191 |
+ |
case 'X': /* XYZ output */ |
192 |
+ |
if (strcmp(argv[i]+2, "XYZ")) |
193 |
+ |
goto badopt; |
194 |
+ |
out_prims = xyzprims; |
195 |
+ |
break; |
196 |
+ |
case 'c': { /* chromaticities */ |
197 |
+ |
int j; |
198 |
+ |
check(3,"ffffffff"); |
199 |
+ |
rval = 0; |
200 |
+ |
for (j = 0; j < 8; j++) { |
201 |
+ |
our_prims[0][j] = atof(argv[++i]); |
202 |
+ |
rval |= fabs(our_prims[0][j]-stdprims[0][j]) > .001; |
203 |
+ |
} |
204 |
+ |
if (rval) { |
205 |
+ |
if (!colorprimsOK(our_prims)) |
206 |
+ |
error(USER, "illegal primary chromaticities"); |
207 |
+ |
out_prims = our_prims; |
208 |
+ |
} else |
209 |
+ |
out_prims = stdprims; |
210 |
+ |
} break; |
211 |
|
default: |
212 |
|
goto badopt; |
213 |
|
} |
244 |
|
check(2,"i"); |
245 |
|
ralrm = atoi(argv[++i]); |
246 |
|
break; |
247 |
+ |
#if MAXCSAMP>3 |
248 |
+ |
case 'c': /* spectral sampling */ |
249 |
+ |
switch (argv[i][2]) { |
250 |
+ |
case 's': /* spectral bin count */ |
251 |
+ |
check(3,"i"); |
252 |
+ |
NCSAMP = atoi(argv[++i]); |
253 |
+ |
break; |
254 |
+ |
case 'w': /* wavelength extrema */ |
255 |
+ |
check(3,"ff"); |
256 |
+ |
WLPART[0] = atof(argv[++i]); |
257 |
+ |
WLPART[3] = atof(argv[++i]); |
258 |
+ |
break; |
259 |
+ |
#if 0 |
260 |
+ |
case 'o': /* output spectral results */ |
261 |
+ |
rval = (out_prims == NULL); |
262 |
+ |
check_bool(3,rval); |
263 |
+ |
if (rval) out_prims = NULL; |
264 |
+ |
else if (out_prims == NULL) out_prims = stdprims; |
265 |
+ |
break; |
266 |
+ |
#endif |
267 |
+ |
default: |
268 |
+ |
goto badopt; |
269 |
+ |
} |
270 |
+ |
break; |
271 |
+ |
#endif |
272 |
|
#ifdef PERSIST |
273 |
|
case 'P': /* persist file */ |
274 |
|
if (argv[i][2] == 'P') { |
538 |
|
printf("-vl %f\t\t\t# view lift\n", ourview.voff); |
539 |
|
printf("-x %-9d\t\t\t# x resolution\n", hresolu); |
540 |
|
printf("-y %-9d\t\t\t# y resolution\n", vresolu); |
541 |
+ |
if (NCSAMP > 3) { |
542 |
+ |
printf("-cs %-2d\t\t\t\t# number of spectral bins\n", NCSAMP); |
543 |
+ |
printf("-cw %3.0f %3.0f\t\t\t# wavelength limits (nm)\n", |
544 |
+ |
WLPART[3], WLPART[0]); |
545 |
+ |
/* printf(out_prims != NULL ? "-co-\t\t\t\t# output tristimulus colors\n" : |
546 |
+ |
"-co+\t\t\t\t# output spectral values\n"); |
547 |
+ |
*/ } |
548 |
+ |
if (out_prims == stdprims) |
549 |
+ |
printf("-pRGB\t\t\t\t# standard RGB color output\n"); |
550 |
+ |
else if (out_prims == xyzprims) |
551 |
+ |
printf("-pXYZ\t\t\t\t# CIE XYZ color output\n"); |
552 |
+ |
else if (out_prims != NULL) |
553 |
+ |
printf("-pc %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\t# output color primaries and white point\n", |
554 |
+ |
out_prims[RED][0], out_prims[RED][1], |
555 |
+ |
out_prims[GRN][0], out_prims[GRN][1], |
556 |
+ |
out_prims[BLU][0], out_prims[BLU][1], |
557 |
+ |
out_prims[WHT][0], out_prims[WHT][1]); |
558 |
|
printf("-pa %f\t\t\t# pixel aspect ratio\n", pixaspect); |
559 |
|
printf("-pj %f\t\t\t# pixel jitter\n", dstrpix); |
560 |
|
printf("-pm %f\t\t\t# pixel motion\n", mblur); |