ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/rt/rxtmain.cpp
(Generate patch)

Comparing ray/src/rt/rxtmain.cpp (file contents):
Revision 2.6 by greg, Sat Aug 3 21:33:15 2024 UTC vs.
Revision 2.16 by greg, Fri Dec 5 17:51:34 2025 UTC

# Line 2 | Line 2
2   static const char       RCSid[] = "$Id$";
3   #endif
4   /*
5 < *  rxtmain.c - main for per-ray calculation program
5 > *  rxtmain.cpp - main for per-ray calculation program
6   */
7  
8   #include "copyright.h"
# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12   #include  "rtprocess.h" /* getpid() */
13   #include  "platform.h"
14   #include  "RtraceSimulManager.h"
15 + #include  "func.h"
16  
16 extern char     *progname;              /* global argv[0] */
17
17   static const char  *sigerr[NSIG];       /* signal error messages */
18   char  *errfile = NULL;                  /* error output file */
19  
# Line 43 | Line 42 | extern void  tranotify(OBJECT obj);
42   char  *tralist[MAXMODLIST];             /* list of modifers to trace (or no) */
43   int  traincl = -1;                      /* include == 1, exclude == 0 */
44  
45 < double  (*sens_curve)(SCOLOR scol) = NULL;      /* spectral conversion for 1-channel */
45 > double  (*sens_curve)(const SCOLOR scol) = NULL;        /* spectral conversion for 1-channel */
46   double  out_scalefactor = 1;            /* output calibration scale factor */
47   RGBPRIMP  out_prims = stdprims;         /* output color primitives (NULL if spectral) */
48   static RGBPRIMS  our_prims;             /* private output color primitives */
# Line 52 | Line 51 | static void onsig(int  signo);
51   static void sigdie(int  signo, const char  *msg);
52   static void printdefaults(void);
53  
54 < #define RXTRACE_FEATURES        "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \
54 > #define RXTRACE_FEATURES        "IrradianceCalc\nMultiprocessing\nDistanceLimiting\n" \
55                                  "HessianAmbientCache\nAmbientAveraging\n" \
56                                  "AmbientValueSharing\nAdaptiveShadowTesting\n" \
57 +                                "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
58                                  "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \
59                                  "OutputCS=RGB,XYZ,Y,S,M,prims,spec\n"
60  
# Line 80 | Line 80 | main(int  argc, char  *argv[])
80          strcat(RFeatureList, RXTRACE_FEATURES);
81          if (argc > 1 && !strcmp(argv[1], "-features"))
82                  return feature_status(argc-2, argv+2);
83 +                                        /* initialize calcomp routines */
84 +        initfunc();
85                                          /* add trace notify function */
86          for (i = 0; addobjnotify[i] != NULL; i++)
87                  ;
# Line 142 | Line 144 | main(int  argc, char  *argv[])
144                          break;
145                  case 'I':                               /* immed. irradiance */
146                          rval = myRTmanager.rtFlags & RTimmIrrad;
147 <                        check_bool(3,rval);
147 >                        check_bool(2,rval);
148                          if (rval) myRTmanager.rtFlags |= RTimmIrrad;
149                          else myRTmanager.rtFlags &= ~RTimmIrrad;
150                          break;
# Line 263 | Line 265 | main(int  argc, char  *argv[])
265                          case 'Y':                       /* photopic response */
266                                  if (argv[i][3])
267                                          goto badopt;
266                                sens_curve = scolor_photopic;
268                                  out_scalefactor = WHTEFFICACY;
269 +                                sens_curve = scolor_photopic;
270                                  break;
271                          case 'S':                       /* scotopic response */
272                                  if (argv[i][3])
273                                          goto badopt;
272                                sens_curve = scolor_scotopic;
274                                  out_scalefactor = WHTSCOTOPIC;
275 +                                sens_curve = scolor_scotopic;
276                                  break;
277                          case 'M':                       /* melanopic response */
278                                  if (argv[i][3])
279                                          goto badopt;
278                                sens_curve = scolor_melanopic;
280                                  out_scalefactor = WHTMELANOPIC;
281 +                                sens_curve = scolor_melanopic;
282                                  break;
283 +                        case 'A':                       /* radiometric average */
284 +                                if (argv[i][3])
285 +                                        goto badopt;
286 +                                out_scalefactor = 1;
287 +                                sens_curve = scolor_mean;
288 +                                break;
289                          default:
290                                  goto badopt;
291                          }
# Line 303 | Line 311 | main(int  argc, char  *argv[])
311          rval = setspectrsamp(CNDX, WLPART);
312          if (rval < 0)
313                  error(USER, "unsupported spectral sampling");
314 <        if (out_prims != NULL) {
314 >        if (sens_curve != NULL)
315 >                out_prims = NULL;
316 >        else if (out_prims != NULL) {
317                  if (!rval)
318                          error(WARNING, "spectral range incompatible with color output");
319          } else if (NCSAMP == 3)
# Line 352 | Line 362 | main(int  argc, char  *argv[])
362                  SET_FILE_BINARY(stdout);
363          if (doheader) {                 /* print header? */
364                  newheader("RADIANCE", stdout);
365 <                fputs(myRTmanager.GetHeader(), stdout);
365 >                fputs(myRTmanager.GetHeadStr(), stdout);
366                  printargs(i, argv, stdout);
367                  printf("SOFTWARE= %s\n", VersionID);
368                  fputnow(stdout);
369                  if (rval > 0)           /* saved from setrtoutput() call */
370 <                        printf("NCOMP=%d\n", rval);
370 >                        fputncomp(rval, stdout);
371 >                if (NCSAMP > 3)
372 >                        fputwlsplit(WLPART, stdout);
373 >                if ((out_prims != stdprims) & (out_prims != NULL))
374 >                        fputprims(out_prims, stdout);
375                  if ((outform == 'f') | (outform == 'd'))
376                          fputendian(stdout);
377                  fputformat(formstr(outform), stdout);
# Line 387 | Line 401 | wputs(                         /* warning output function */
401  
402   void
403   eputs(                          /* put string to stderr */
404 <        char  *s
404 >        const char  *s
405   )
406   {
407          static int  midline = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)