ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/util/pvsum.c
(Generate patch)

Comparing ray/src/util/pvsum.c (file contents):
Revision 2.6 by greg, Sat Jun 28 17:30:50 2025 UTC vs.
Revision 2.8 by greg, Fri Oct 24 22:41:10 2025 UTC

# Line 10 | Line 10 | static const char RCSid[] = "$Id$";
10   #include "rtio.h"
11   #include "resolu.h"
12   #include "platform.h"
13 #include "paths.h"
13   #include "random.h"
14   #include "rmatrix.h"
15   #if !defined(_WIN32) && !defined(_WIN64)
# Line 18 | Line 17 | static const char RCSid[] = "$Id$";
17   #include <sys/wait.h>
18   #endif
19  
20 + #define  VIEWSTR        "VIEW="         /* borrowed from common/view.h */
21 + #define  VIEWSTRL       5
22 +
23   int     nprocs = 1;                     /* # of calculation processes (Unix) */
24   int     in_type = DTfromHeader;         /* input data type */
25   int     out_type = DTfromHeader;        /* output data type */
# Line 27 | Line 29 | char   *out_spec = NULL;               /* output file specification *
29   int     iswapped = 0;                   /* input data is byte-swapped? */
30   int     ncomp = 3;                      /* # input components */
31   int     xres=0, yres=0;                 /* input image dimensions */
32 + char    viewspec[128] = "";             /* VIEW= line from first header */
33 + char    pixasp[48] = "";                /* PIXASPECT= line from header */
34  
35 + int     gargc;                          /* global argc */
36 + char    **gargv;                        /* global argv */
37 +
38   RMATRIX *cmtx = NULL;                   /* coefficient matrix */
39  
40   /* does the given spec contain integer format? */
# Line 80 | Line 87 | iheadline(char *s, void *p)
87                  iswapped = (i != nativebigendian());
88                  return(1);
89          }
90 +        if (!strncmp(s, VIEWSTR, VIEWSTRL)) {
91 +                strcpy(viewspec, s);
92 +                return(1);
93 +        }
94 +        if (isaspect(s)) {
95 +                strcpy(pixasp, s);
96 +                return(1);
97 +        }
98          return(0);
99   }
100  
# Line 243 | Line 258 | open_output(char *ospec, int fno)
258                  fputs(cmtx->info, fp);
259          else
260                  fputnow(fp);
261 +        printargs(gargc, gargv, fp);    /* this command */
262          if (fno >= 0)
263                  fprintf(fp, "FRAME=%d\n", fno);
264 +        if (viewspec[0])
265 +                fputs(viewspec, fp);
266 +        if (pixasp[0])
267 +                fputs(pixasp, fp);
268          switch (out_type) {
269          case DTfloat:
270          case DTdouble:
# Line 380 | Line 400 | writerr:
400          return(0);
401   }
402  
403 + #if defined(_WIN32) || defined(_WIN64)
404 + #define multi_process   solo_process
405 + #else
406 +
407   /* allocate a scrambled index array of the specified length */
408   int *
409   scramble(int n)
# Line 407 | Line 431 | scramble(int n)
431   int
432   multi_process(void)
433   {
410 #if defined(_WIN32) || defined(_WIN64)
411        fputs("Bad call to multi_process()\n", stderr);
412        return(0);
413 #else
434          int     coff = nprocs;
435          int     odd = 0;
436          char    fbuf[512];
# Line 539 | Line 559 | multi_process(void)
559   writerr:
560          fprintf(stderr, "%s: write error\n", fbuf);
561          return(0);
542 #endif
562   }
563  
564 + #endif          /* ! Windows */
565 +
566   int
567   main(int argc, char *argv[])
568   {
569          int     a;
570 +
571 +        gargc = argc;                   /* for header output */
572 +        gargv = argv;
573  
574          for (a = 1; a < argc-1 && argv[a][0] == '-'; a++)
575                  switch (argv[a][1]) {

Diff Legend

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