ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rtmain.c
Revision: 2.52
Committed: Fri Apr 5 16:43:33 2024 UTC (5 weeks, 5 days ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.51: +2 -2 lines
Log Message:
fix: Added missing eol escape for Windows

File Contents

# User Rev Content
1 greg 2.1 #ifndef lint
2 greg 2.52 static const char RCSid[] = "$Id: rtmain.c,v 2.51 2024/04/05 16:41:17 greg Exp $";
3 greg 2.1 #endif
4     /*
5     * rtmain.c - main for rtrace per-ray calculation program
6     */
7    
8 greg 2.2 #include "copyright.h"
9 greg 2.1
10 schorsch 2.4 #include <signal.h>
11    
12     #include "platform.h"
13 schorsch 2.7 #include "rtprocess.h" /* getpid() */
14 schorsch 2.9 #include "resolu.h"
15 greg 2.1 #include "ray.h"
16     #include "source.h"
17     #include "ambient.h"
18     #include "random.h"
19     #include "paths.h"
20 greg 2.23 #include "pmapray.h"
21 greg 2.1
22 greg 2.18 extern char *progname; /* global argv[0] */
23    
24     extern char *shm_boundary; /* boundary of shared memory */
25    
26 greg 2.1 /* persistent processes define */
27     #ifdef F_SETLKW
28     #define PERSIST 1 /* normal persist */
29     #define PARALLEL 2 /* parallel persist */
30     #define PCHILD 3 /* child of normal persist */
31     #endif
32    
33     char *sigerr[NSIG]; /* signal error messages */
34     char *errfile = NULL; /* error output file */
35    
36 greg 2.18 int nproc = 1; /* number of processes */
37    
38 greg 2.31 extern int setrtoutput(void); /* set output values */
39 greg 2.32
40 greg 2.18 int inform = 'a'; /* input format */
41     int outform = 'a'; /* output format */
42     char *outvals = "v"; /* output specification */
43 greg 2.1
44 greg 2.18 int hresolu = 0; /* horizontal (scan) size */
45     int vresolu = 0; /* vertical resolution */
46 greg 2.1
47 greg 2.33 extern int castonly; /* only doing ray-casting? */
48 greg 2.32
49 greg 2.18 int imm_irrad = 0; /* compute immediate irradiance? */
50     int lim_dist = 0; /* limit distance? */
51    
52     #ifndef MAXMODLIST
53     #define MAXMODLIST 1024 /* maximum modifiers we'll track */
54     #endif
55 greg 2.1
56 greg 2.18 extern void (*addobjnotify[])(); /* object notification calls */
57     extern void tranotify(OBJECT obj);
58    
59     char *tralist[MAXMODLIST]; /* list of modifers to trace (or no) */
60     int traincl = -1; /* include == 1, exclude == 0 */
61 greg 2.1
62 greg 2.47 double (*sens_curve)(SCOLOR scol) = NULL; /* spectral conversion for 1-channel */
63     double out_scalefactor = 1; /* output calibration scale factor */
64     RGBPRIMP out_prims = stdprims; /* output color primitives (NULL if spectral) */
65     static RGBPRIMS our_prims; /* private output color primitives */
66    
67 greg 2.10 static int loadflags = ~IO_FILES; /* what to load from octree */
68    
69 schorsch 2.9 static void onsig(int signo);
70     static void sigdie(int signo, char *msg);
71     static void printdefaults(void);
72 greg 2.1
73 greg 2.38 #ifdef PERSIST
74 greg 2.45 #define RTRACE_FEATURES "Persist\nParallelPersist\nMultiprocessing\n" \
75 greg 2.38 "IrradianceCalc\nImmediateIrradiance\nDistanceLimiting\n" \
76 greg 2.48 "ParticipatingMedia=Mist\n" \
77 greg 2.39 "HessianAmbientCache\nAmbientAveraging\n" \
78 greg 2.40 "AmbientValueSharing\nAdaptiveShadowTesting\n" \
79 greg 2.45 "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
80 greg 2.51 "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \
81     "OutputCS=RGB,XYZ,Y,S,M,prims,spec\n"
82 greg 2.38 #else
83     #define RTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \
84 greg 2.48 "ParticipatingMedia=Mist\n" \
85 greg 2.39 "HessianAmbientCache\nAmbientAveraging\n" \
86 greg 2.40 "AmbientValueSharing\nAdaptiveShadowTesting\n" \
87 greg 2.45 "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
88 greg 2.52 "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \
89 greg 2.51 "OutputCS=RGB,XYZ,Y,S,M,prims,spec\n"
90 greg 2.38 #endif
91    
92 greg 2.1
93     int
94 schorsch 2.9 main(int argc, char *argv[])
95 greg 2.1 {
96     #define check(ol,al) if (argv[i][ol] || \
97     badarg(argc-i-1,argv+i+1,al)) \
98     goto badopt
99 schorsch 2.26 #define check_bool(olen,var) switch (argv[i][olen]) { \
100 greg 2.1 case '\0': var = !var; break; \
101     case 'y': case 'Y': case 't': case 'T': \
102     case '+': case '1': var = 1; break; \
103     case 'n': case 'N': case 'f': case 'F': \
104     case '-': case '0': var = 0; break; \
105     default: goto badopt; }
106 greg 2.25 extern char *octname;
107 greg 2.1 int persist = 0;
108 greg 2.18 char *octnm = NULL;
109 greg 2.22 char **tralp = NULL;
110     int duped1 = -1;
111 greg 2.1 int rval;
112     int i;
113     /* global program name */
114     progname = argv[0] = fixargv0(argv[0]);
115 greg 2.38 /* feature check only? */
116     strcat(RFeatureList, RTRACE_FEATURES);
117 greg 2.43 if (argc > 1 && !strcmp(argv[1], "-features"))
118 greg 2.38 return feature_status(argc-2, argv+2);
119 greg 2.18 /* add trace notify function */
120     for (i = 0; addobjnotify[i] != NULL; i++)
121     ;
122     addobjnotify[i] = tranotify;
123 greg 2.1 /* option city */
124     for (i = 1; i < argc; i++) {
125     /* expand arguments */
126     while ((rval = expandarg(&argc, &argv, i)) > 0)
127     ;
128     if (rval < 0) {
129     sprintf(errmsg, "cannot expand '%s'", argv[i]);
130     error(SYSTEM, errmsg);
131     }
132     if (argv[i] == NULL || argv[i][0] != '-')
133     break; /* break from options */
134     if (!strcmp(argv[i], "-version")) {
135     puts(VersionID);
136     quit(0);
137     }
138     if (!strcmp(argv[i], "-defaults") ||
139     !strcmp(argv[i], "-help")) {
140     printdefaults();
141     quit(0);
142     }
143     rval = getrenderopt(argc-i, argv+i);
144     if (rval >= 0) {
145     i += rval;
146     continue;
147     }
148     switch (argv[i][1]) {
149 greg 2.18 case 'n': /* number of cores */
150     check(2,"i");
151     nproc = atoi(argv[++i]);
152     if (nproc <= 0)
153     error(USER, "bad number of processes");
154     break;
155 greg 2.1 case 'x': /* x resolution */
156     check(2,"i");
157     hresolu = atoi(argv[++i]);
158     break;
159     case 'y': /* y resolution */
160     check(2,"i");
161     vresolu = atoi(argv[++i]);
162     break;
163 greg 2.47 case 'w': /* warnings & spectral */
164 greg 2.1 rval = erract[WARNING].pf != NULL;
165 schorsch 2.26 check_bool(2,rval);
166 greg 2.1 if (rval) erract[WARNING].pf = wputs;
167     else erract[WARNING].pf = NULL;
168     break;
169     case 'e': /* error file */
170     check(2,"s");
171     errfile = argv[++i];
172     break;
173     case 'l': /* limit distance */
174     if (argv[i][2] != 'd')
175     goto badopt;
176 schorsch 2.26 check_bool(3,lim_dist);
177 greg 2.1 break;
178     case 'I': /* immed. irradiance */
179 schorsch 2.26 check_bool(2,imm_irrad);
180 greg 2.1 break;
181     case 'f': /* format i/o */
182     switch (argv[i][2]) {
183     case 'a': /* ascii */
184     case 'f': /* float */
185     case 'd': /* double */
186     inform = argv[i][2];
187     break;
188     default:
189     goto badopt;
190     }
191     switch (argv[i][3]) {
192     case '\0':
193     outform = inform;
194     break;
195     case 'a': /* ascii */
196     case 'f': /* float */
197     case 'd': /* double */
198     case 'c': /* color */
199     check(4,"");
200     outform = argv[i][3];
201     break;
202     default:
203     goto badopt;
204     }
205     break;
206     case 'o': /* output */
207     outvals = argv[i]+2;
208     break;
209     case 'h': /* header output */
210     rval = loadflags & IO_INFO;
211 schorsch 2.26 check_bool(2,rval);
212 greg 2.1 loadflags = rval ? loadflags | IO_INFO :
213     loadflags & ~IO_INFO;
214     break;
215     case 't': /* trace */
216     switch (argv[i][2]) {
217     case 'i': /* include */
218     case 'I':
219     check(3,"s");
220     if (traincl != 1) {
221     traincl = 1;
222     tralp = tralist;
223     }
224     if (argv[i][2] == 'I') { /* file */
225 greg 2.27 rval = wordfile(tralp, MAXMODLIST-(tralp-tralist),
226 greg 2.3 getpath(argv[++i],getrlibpath(),R_OK));
227 greg 2.1 if (rval < 0) {
228     sprintf(errmsg,
229     "cannot open trace include file \"%s\"",
230     argv[i]);
231     error(SYSTEM, errmsg);
232     }
233     tralp += rval;
234     } else {
235     *tralp++ = argv[++i];
236     *tralp = NULL;
237     }
238     break;
239     case 'e': /* exclude */
240     case 'E':
241     check(3,"s");
242     if (traincl != 0) {
243     traincl = 0;
244     tralp = tralist;
245     }
246     if (argv[i][2] == 'E') { /* file */
247 greg 2.27 rval = wordfile(tralp, MAXMODLIST-(tralp-tralist),
248 greg 2.3 getpath(argv[++i],getrlibpath(),R_OK));
249 greg 2.1 if (rval < 0) {
250     sprintf(errmsg,
251     "cannot open trace exclude file \"%s\"",
252     argv[i]);
253     error(SYSTEM, errmsg);
254     }
255     tralp += rval;
256     } else {
257     *tralp++ = argv[++i];
258     *tralp = NULL;
259     }
260     break;
261     default:
262     goto badopt;
263     }
264     break;
265 greg 2.47 case 'p': /* value output */
266     switch (argv[i][2]) {
267     case 'R': /* standard RGB output */
268     if (strcmp(argv[i]+2, "RGB"))
269     goto badopt;
270     out_prims = stdprims;
271     out_scalefactor = 1;
272     sens_curve = NULL;
273     break;
274     case 'X': /* XYZ output */
275     if (strcmp(argv[i]+2, "XYZ"))
276     goto badopt;
277     out_prims = xyzprims;
278     out_scalefactor = WHTEFFICACY;
279     sens_curve = NULL;
280     break;
281     case 'c': {
282     int j;
283     check(3,"ffffffff");
284     rval = 0;
285     for (j = 0; j < 8; j++) {
286     our_prims[0][j] = atof(argv[++i]);
287     rval |= fabs(our_prims[0][j]-stdprims[0][j]) > .001;
288     }
289     if (rval) {
290     if (!colorprimsOK(our_prims))
291     error(USER, "illegal primary chromaticities");
292     out_prims = our_prims;
293     } else
294     out_prims = stdprims;
295     out_scalefactor = 1;
296     sens_curve = NULL;
297     } break;
298     case 'Y': /* photopic response */
299 greg 2.50 if (argv[i][3])
300     goto badopt;
301 greg 2.47 sens_curve = scolor_photopic;
302     out_scalefactor = WHTEFFICACY;
303     break;
304     case 'S': /* scotopic response */
305 greg 2.50 if (argv[i][3])
306     goto badopt;
307 greg 2.47 sens_curve = scolor_scotopic;
308     out_scalefactor = WHTSCOTOPIC;
309     break;
310     case 'M': /* melanopic response */
311 greg 2.50 if (argv[i][3])
312     goto badopt;
313 greg 2.47 sens_curve = scolor_melanopic;
314     out_scalefactor = WHTMELANOPIC;
315     break;
316     default:
317     goto badopt;
318     }
319     break;
320     #if MAXCSAMP>3
321 greg 2.48 case 'c': /* output spectral results */
322     if (argv[i][2] != 'o')
323 greg 2.47 goto badopt;
324 greg 2.49 rval = (out_prims == NULL) & (sens_curve == NULL);
325 greg 2.48 check_bool(3,rval);
326 greg 2.49 if (rval) {
327     out_prims = NULL;
328     sens_curve = NULL;
329     } else if (out_prims == NULL)
330     out_prims = stdprims;
331 greg 2.47 break;
332     #endif
333 greg 2.1 #ifdef PERSIST
334     case 'P': /* persist file */
335     if (argv[i][2] == 'P') {
336     check(3,"s");
337     persist = PARALLEL;
338     } else {
339     check(2,"s");
340     persist = PERSIST;
341     }
342     persistfile(argv[++i]);
343     break;
344     #endif
345     default:
346     goto badopt;
347     }
348     }
349 greg 2.47 /* set/check spectral sampling */
350     rval = setspectrsamp(CNDX, WLPART);
351     if (rval < 0)
352     error(USER, "unsupported spectral sampling");
353     if (out_prims != NULL) {
354     if (!rval)
355     error(WARNING, "spectral range incompatible with color output");
356     } else if (NCSAMP == 3)
357     out_prims = stdprims; /* 3 samples do not a spectrum make */
358 greg 2.34 if (nproc > 1 && persist)
359     error(USER, "multiprocessing incompatible with persist file");
360 greg 2.1 /* initialize object types */
361     initotypes();
362     /* initialize urand */
363 greg 2.14 if (rand_samp) {
364     srandom((long)time(0));
365     initurand(0);
366     } else {
367     srandom(0L);
368     initurand(2048);
369     }
370 greg 2.1 /* set up signal handling */
371     sigdie(SIGINT, "Interrupt");
372 schorsch 2.5 #ifdef SIGHUP
373 greg 2.1 sigdie(SIGHUP, "Hangup");
374 schorsch 2.5 #endif
375 greg 2.1 sigdie(SIGTERM, "Terminate");
376 schorsch 2.5 #ifdef SIGPIPE
377 greg 2.1 sigdie(SIGPIPE, "Broken pipe");
378 schorsch 2.5 #endif
379     #ifdef SIGALRM
380 greg 2.1 sigdie(SIGALRM, "Alarm clock");
381 schorsch 2.5 #endif
382 greg 2.1 #ifdef SIGXCPU
383     sigdie(SIGXCPU, "CPU limit exceeded");
384     sigdie(SIGXFSZ, "File size exceeded");
385     #endif
386     /* open error file */
387     if (errfile != NULL) {
388     if (freopen(errfile, "a", stderr) == NULL)
389     quit(2);
390     fprintf(stderr, "**************\n*** PID %5d: ",
391     getpid());
392     printargs(argc, argv, stderr);
393     putc('\n', stderr);
394     fflush(stderr);
395     }
396     #ifdef NICE
397     nice(NICE); /* lower priority */
398     #endif
399     /* get octree */
400     if (i == argc)
401 greg 2.18 octnm = NULL;
402 greg 2.1 else if (i == argc-1)
403 greg 2.18 octnm = argv[i];
404 greg 2.1 else
405     goto badopt;
406 greg 2.18 if (octnm == NULL)
407 greg 2.1 error(USER, "missing octree argument");
408     /* set up output */
409     #ifdef PERSIST
410     if (persist) {
411     duped1 = dup(fileno(stdout)); /* don't lose our output */
412     openheader();
413     }
414     #endif
415     if (outform != 'a')
416 schorsch 2.4 SET_FILE_BINARY(stdout);
417 greg 2.31 rval = setrtoutput();
418 greg 2.41 octname = savqstr(octnm);
419     readoct(octname, loadflags, &thescene, NULL);
420 greg 2.1 nsceneobjs = nobjects;
421    
422     if (loadflags & IO_INFO) { /* print header */
423     printargs(i, argv, stdout);
424     printf("SOFTWARE= %s\n", VersionID);
425     fputnow(stdout);
426 greg 2.31 if (rval > 0) /* saved from setrtoutput() call */
427 greg 2.47 fputncomp(rval, stdout);
428     if (NCSAMP > 3)
429     fputwlsplit(WLPART, stdout);
430     if ((out_prims != stdprims) & (out_prims != NULL))
431     fputprims(out_prims, stdout);
432 greg 2.30 if ((outform == 'f') | (outform == 'd'))
433     fputendian(stdout);
434 greg 2.1 fputformat(formstr(outform), stdout);
435 greg 2.47 fputc('\n', stdout); /* end of header */
436 greg 2.1 }
437    
438 greg 2.32 if (!castonly) { /* any actual ray traversal to do? */
439    
440     ray_init_pmap(); /* PMAP: set up & load photon maps */
441    
442     marksources(); /* find and mark sources */
443    
444     setambient(); /* initialize ambient calculation */
445 greg 2.33 } else
446     distantsources(); /* else mark only distant sources */
447 greg 2.35
448 greg 2.36 fflush(stdout); /* in case we're duplicating header */
449 greg 2.35
450 greg 2.1 #ifdef PERSIST
451     if (persist) {
452     /* reconnect stdout */
453     dup2(duped1, fileno(stdout));
454     close(duped1);
455     if (persist == PARALLEL) { /* multiprocessing */
456     preload_objs(); /* preload scene */
457     shm_boundary = (char *)malloc(16);
458     strcpy(shm_boundary, "SHM_BOUNDARY");
459     while ((rval=fork()) == 0) { /* keep on forkin' */
460     pflock(1);
461     pfhold();
462 greg 2.15 ambsync(); /* load new values */
463 greg 2.1 }
464     if (rval < 0)
465     error(SYSTEM, "cannot fork child for persist function");
466 greg 2.15 pfdetach(); /* parent will run then exit */
467 greg 2.1 }
468     }
469     runagain:
470     if (persist)
471     dupheader(); /* send header to stdout */
472     #endif
473     /* trace rays */
474 greg 2.19 rtrace(NULL, nproc);
475 greg 2.1 /* flush ambient file */
476     ambsync();
477     #ifdef PERSIST
478     if (persist == PERSIST) { /* first run-through */
479     if ((rval=fork()) == 0) { /* child loops until killed */
480     pflock(1);
481     persist = PCHILD;
482     } else { /* original process exits */
483     if (rval < 0)
484     error(SYSTEM, "cannot fork child for persist function");
485     pfdetach(); /* parent exits */
486     }
487     }
488     if (persist == PCHILD) { /* wait for a signal then go again */
489     pfhold();
490     raynum = nrays = 0; /* reinitialize */
491     goto runagain;
492     }
493     #endif
494 greg 2.23
495     ray_done_pmap(); /* PMAP: free photon maps */
496    
497 greg 2.1 quit(0);
498    
499     badopt:
500     sprintf(errmsg, "command line error at '%s'", argv[i]);
501     error(USER, errmsg);
502 schorsch 2.9 return 1; /* pro forma return */
503 greg 2.1
504     #undef check
505 schorsch 2.26 #undef check_bool
506 greg 2.1 }
507    
508    
509     void
510 schorsch 2.9 wputs( /* warning output function */
511 greg 2.44 const char *s
512 schorsch 2.9 )
513 greg 2.1 {
514     int lasterrno = errno;
515     eputs(s);
516     errno = lasterrno;
517     }
518    
519    
520     void
521 schorsch 2.9 eputs( /* put string to stderr */
522 greg 2.44 const char *s
523 schorsch 2.9 )
524 greg 2.1 {
525     static int midline = 0;
526    
527     if (!*s)
528     return;
529     if (!midline++) {
530     fputs(progname, stderr);
531     fputs(": ", stderr);
532     }
533     fputs(s, stderr);
534     if (s[strlen(s)-1] == '\n') {
535     fflush(stderr);
536     midline = 0;
537     }
538     }
539    
540    
541 schorsch 2.9 static void
542     onsig( /* fatal signal */
543     int signo
544     )
545 greg 2.1 {
546     static int gotsig = 0;
547    
548     if (gotsig++) /* two signals and we're gone! */
549     _exit(signo);
550    
551 schorsch 2.5 #ifdef SIGALRM
552 greg 2.1 alarm(15); /* allow 15 seconds to clean up */
553     signal(SIGALRM, SIG_DFL); /* make certain we do die */
554 schorsch 2.5 #endif
555 greg 2.1 eputs("signal - ");
556     eputs(sigerr[signo]);
557     eputs("\n");
558     quit(3);
559     }
560    
561    
562 schorsch 2.9 static void
563     sigdie( /* set fatal signal */
564     int signo,
565     char *msg
566     )
567 greg 2.1 {
568     if (signal(signo, onsig) == SIG_IGN)
569     signal(signo, SIG_IGN);
570     sigerr[signo] = msg;
571     }
572    
573    
574 schorsch 2.9 static void
575 schorsch 2.8 printdefaults(void) /* print default values to stdout */
576 greg 2.1 {
577 greg 2.38 char *cp;
578 greg 2.1
579 greg 2.49 printf(erract[WARNING].pf != NULL ?
580     "-w+\t\t\t\t# warning messages on\n" :
581     "-w-\t\t\t\t# warning messages off\n");
582 greg 2.1 if (imm_irrad)
583     printf("-I+\t\t\t\t# immediate irradiance on\n");
584 greg 2.18 printf("-n %-2d\t\t\t\t# number of rendering processes\n", nproc);
585 greg 2.21 printf("-x %-9d\t\t\t# %s\n", hresolu,
586     vresolu && hresolu ? "x resolution" : "flush interval");
587 greg 2.16 printf("-y %-9d\t\t\t# y resolution\n", vresolu);
588 greg 2.1 printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" :
589     "-ld-\t\t\t\t# limit distance off\n");
590 greg 2.47 printf(loadflags & IO_INFO ? "-h+\t\t\t\t# output header\n" :
591     "-h-\t\t\t\t# no header\n");
592 greg 2.1 printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n",
593     inform, outform, formstr(inform), formstr(outform));
594 greg 2.10 printf("-o%-9s\t\t\t# output", outvals);
595 greg 2.1 for (cp = outvals; *cp; cp++)
596     switch (*cp) {
597 greg 2.10 case 't': case 'T': printf(" trace"); break;
598 greg 2.1 case 'o': printf(" origin"); break;
599     case 'd': printf(" direction"); break;
600 greg 2.28 case 'r': printf(" reflect_contrib"); break;
601     case 'R': printf(" reflect_length"); break;
602     case 'x': printf(" unreflect_contrib"); break;
603     case 'X': printf(" unreflect_length"); break;
604 greg 2.1 case 'v': printf(" value"); break;
605 greg 2.13 case 'V': printf(" contribution"); break;
606 greg 2.1 case 'l': printf(" length"); break;
607     case 'L': printf(" first_length"); break;
608     case 'p': printf(" point"); break;
609     case 'n': printf(" normal"); break;
610     case 'N': printf(" unperturbed_normal"); break;
611     case 's': printf(" surface"); break;
612     case 'w': printf(" weight"); break;
613 greg 2.13 case 'W': printf(" coefficient"); break;
614 greg 2.1 case 'm': printf(" modifier"); break;
615 greg 2.10 case 'M': printf(" material"); break;
616 greg 2.37 case '~': printf(" tilde"); break;
617 greg 2.1 }
618 greg 2.47 fputc('\n', stdout);
619     if (sens_curve == scolor_photopic)
620     printf("-pY\t\t\t\t# photopic output\n");
621     else if (sens_curve == scolor_scotopic)
622     printf("-pS\t\t\t\t# scotopic output\n");
623     else if (sens_curve == scolor_melanopic)
624     printf("-pM\t\t\t\t# melanopic output\n");
625     else if (out_prims == stdprims)
626     printf("-pRGB\t\t\t\t# standard RGB color output\n");
627     else if (out_prims == xyzprims)
628     printf("-pXYZ\t\t\t\t# CIE XYZ color output\n");
629     else if (out_prims != NULL)
630     printf("-pc %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\t# output color primaries and white point\n",
631     out_prims[RED][0], out_prims[RED][1],
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 greg 2.49 if (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 greg 2.1 print_rdefaults();
639     }