ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rpmain.c
(Generate patch)

Comparing ray/src/rt/rpmain.c (file contents):
Revision 2.19 by greg, Thu Mar 21 16:52:40 2019 UTC vs.
Revision 2.31 by greg, Thu Jan 18 00:28:54 2024 UTC

# Line 52 | Line 52 | extern double  mblur;                  /* motion blur parameter */
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 + #else
71 + #define RPICT_FEATURES  "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \
72 +                "ParticipatingMedia=Mist\n" \
73 +                "HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \
74 +                "PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \
75 +                "SmallSourceDrawing\nViewSequence\nProgressReporting\n" \
76 +                "AdaptiveShadowTesting\nOutputs=v,l\n"
77 + #endif
78  
79  
80   int
# Line 84 | Line 104 | main(int  argc, char  *argv[])
104          tstart = time((time_t *)NULL);
105                                          /* global program name */
106          progname = argv[0] = fixargv0(argv[0]);
107 +                                        /* feature check only? */
108 +        strcat(RFeatureList, RPICT_FEATURES);
109 +        if (argc > 1 && !strcmp(argv[1], "-features"))
110 +                return feature_status(argc-2, argv+2);
111                                          /* option city */
112          for (i = 1; i < argc; i++) {
113                                                  /* expand arguments */
# Line 159 | Line 183 | main(int  argc, char  *argv[])
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                          }
# Line 221 | Line 270 | main(int  argc, char  *argv[])
270                          goto badopt;
271                  }
272          }
273 +                                        /* set/check spectral sampling */
274 +        if (setspectrsamp(CNDX, WLPART) <= 0)
275 +                error(USER, "unsupported spectral sampling");
276 +
277          err = setview(&ourview);        /* set viewing parameters */
278          if (err != NULL)
279                  error(USER, err);
# Line 303 | Line 356 | main(int  argc, char  *argv[])
356  
357          setambient();                   /* initialize ambient calculation */
358          
359 +        fflush(stdout);                 /* in case we're duplicating header */
360 +
361   #ifdef  PERSIST
362          if (persist) {
308                fflush(stdout);
363                  if (outfile == NULL) {          /* reconnect stdout */
364                          dup2(duped1, fileno(stdout));
365                          close(duped1);
# Line 375 | Line 429 | badopt:
429  
430   void
431   wputs(                          /* warning output function */
432 <        char    *s
432 >        const char      *s
433   )
434   {
435          int  lasterrno = errno;
# Line 386 | Line 440 | wputs(                         /* warning output function */
440  
441   void
442   eputs(                          /* put string to stderr */
443 <        register char  *s
443 >        const char  *s
444   )
445   {
446          static int  midline = 0;
# Line 463 | Line 517 | printdefaults(void)                    /* print default values to stdou
517          printf("-vl %f\t\t\t# view lift\n", ourview.voff);
518          printf("-x  %-9d\t\t\t# x resolution\n", hresolu);
519          printf("-y  %-9d\t\t\t# y resolution\n", vresolu);
520 +        if (out_prims == stdprims)
521 +                printf("-pRGB\t\t\t\t# standard RGB color output\n");
522 +        else if (out_prims == xyzprims)
523 +                printf("-pXYZ\t\t\t\t# CIE XYZ color output\n");
524 +        else if (out_prims != NULL)
525 +                printf("-pc %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\t# output color primaries and white point\n",
526 +                                out_prims[RED][0], out_prims[RED][1],
527 +                                out_prims[GRN][0], out_prims[GRN][1],
528 +                                out_prims[BLU][0], out_prims[BLU][1],
529 +                                out_prims[WHT][0], out_prims[WHT][1]);
530          printf("-pa %f\t\t\t# pixel aspect ratio\n", pixaspect);
531          printf("-pj %f\t\t\t# pixel jitter\n", dstrpix);
532          printf("-pm %f\t\t\t# pixel motion\n", mblur);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines