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" \ |
65 |
+ |
"Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
66 |
+ |
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ |
67 |
+ |
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
68 |
+ |
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
69 |
+ |
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
70 |
+ |
"OutputCS=RGB,XYZ,Y,S,M,prims\n" |
71 |
+ |
#else |
72 |
+ |
#define RPICT_FEATURES "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
73 |
+ |
"ParticipatingMedia=Mist\n" \ |
74 |
+ |
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ |
75 |
+ |
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
76 |
+ |
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
77 |
+ |
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
78 |
+ |
"OutputCS=RGB,XYZ,Y,S,M,prims\n" |
79 |
+ |
#endif |
80 |
|
|
81 |
|
|
82 |
|
int |
106 |
|
tstart = time((time_t *)NULL); |
107 |
|
/* global program name */ |
108 |
|
progname = argv[0] = fixargv0(argv[0]); |
109 |
+ |
/* feature check only? */ |
110 |
+ |
strcat(RFeatureList, RPICT_FEATURES); |
111 |
+ |
if (argc > 1 && !strcmp(argv[1], "-features")) |
112 |
+ |
return feature_status(argc-2, argv+2); |
113 |
|
/* option city */ |
114 |
|
for (i = 1; i < argc; i++) { |
115 |
|
/* expand arguments */ |
185 |
|
check(3,"f"); |
186 |
|
dblur = atof(argv[++i]); |
187 |
|
break; |
188 |
+ |
case 'R': /* standard RGB output */ |
189 |
+ |
if (strcmp(argv[i]+2, "RGB")) |
190 |
+ |
goto badopt; |
191 |
+ |
out_prims = stdprims; |
192 |
+ |
break; |
193 |
+ |
case 'X': /* XYZ output */ |
194 |
+ |
if (strcmp(argv[i]+2, "XYZ")) |
195 |
+ |
goto badopt; |
196 |
+ |
out_prims = xyzprims; |
197 |
+ |
break; |
198 |
+ |
case 'c': { /* chromaticities */ |
199 |
+ |
int j; |
200 |
+ |
check(3,"ffffffff"); |
201 |
+ |
rval = 0; |
202 |
+ |
for (j = 0; j < 8; j++) { |
203 |
+ |
our_prims[0][j] = atof(argv[++i]); |
204 |
+ |
rval |= fabs(our_prims[0][j]-stdprims[0][j]) > .001; |
205 |
+ |
} |
206 |
+ |
if (rval) { |
207 |
+ |
if (!colorprimsOK(our_prims)) |
208 |
+ |
error(USER, "illegal primary chromaticities"); |
209 |
+ |
out_prims = our_prims; |
210 |
+ |
} else |
211 |
+ |
out_prims = stdprims; |
212 |
+ |
} break; |
213 |
|
default: |
214 |
|
goto badopt; |
215 |
|
} |
272 |
|
goto badopt; |
273 |
|
} |
274 |
|
} |
275 |
+ |
/* set/check spectral sampling */ |
276 |
+ |
if (setspectrsamp(CNDX, WLPART) <= 0) |
277 |
+ |
error(USER, "unsupported spectral sampling"); |
278 |
+ |
|
279 |
|
err = setview(&ourview); /* set viewing parameters */ |
280 |
|
if (err != NULL) |
281 |
|
error(USER, err); |
431 |
|
|
432 |
|
void |
433 |
|
wputs( /* warning output function */ |
434 |
< |
char *s |
434 |
> |
const char *s |
435 |
|
) |
436 |
|
{ |
437 |
|
int lasterrno = errno; |
442 |
|
|
443 |
|
void |
444 |
|
eputs( /* put string to stderr */ |
445 |
< |
register char *s |
445 |
> |
const char *s |
446 |
|
) |
447 |
|
{ |
448 |
|
static int midline = 0; |
519 |
|
printf("-vl %f\t\t\t# view lift\n", ourview.voff); |
520 |
|
printf("-x %-9d\t\t\t# x resolution\n", hresolu); |
521 |
|
printf("-y %-9d\t\t\t# y resolution\n", vresolu); |
522 |
+ |
if (out_prims == stdprims) |
523 |
+ |
printf("-pRGB\t\t\t\t# standard RGB color output\n"); |
524 |
+ |
else if (out_prims == xyzprims) |
525 |
+ |
printf("-pXYZ\t\t\t\t# CIE XYZ color output\n"); |
526 |
+ |
else if (out_prims != NULL) |
527 |
+ |
printf("-pc %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\t# output color primaries and white point\n", |
528 |
+ |
out_prims[RED][0], out_prims[RED][1], |
529 |
+ |
out_prims[GRN][0], out_prims[GRN][1], |
530 |
+ |
out_prims[BLU][0], out_prims[BLU][1], |
531 |
+ |
out_prims[WHT][0], out_prims[WHT][1]); |
532 |
|
printf("-pa %f\t\t\t# pixel aspect ratio\n", pixaspect); |
533 |
|
printf("-pj %f\t\t\t# pixel jitter\n", dstrpix); |
534 |
|
printf("-pm %f\t\t\t# pixel motion\n", mblur); |