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.7 by greg, Fri Oct 24 16:31:18 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   RMATRIX *cmtx = NULL;                   /* coefficient matrix */
36  
# Line 80 | Line 84 | iheadline(char *s, void *p)
84                  iswapped = (i != nativebigendian());
85                  return(1);
86          }
87 +        if (!strncmp(s, VIEWSTR, VIEWSTRL)) {
88 +                strcpy(viewspec, s);
89 +                return(1);
90 +        }
91 +        if (isaspect(s)) {
92 +                strcpy(pixasp, s);
93 +                return(1);
94 +        }
95          return(0);
96   }
97  
# Line 245 | Line 257 | open_output(char *ospec, int fno)
257                  fputnow(fp);
258          if (fno >= 0)
259                  fprintf(fp, "FRAME=%d\n", fno);
260 +        if (viewspec[0])
261 +                fputs(viewspec, fp);
262 +        if (pixasp[0])
263 +                fputs(pixasp, fp);
264          switch (out_type) {
265          case DTfloat:
266          case DTdouble:
# Line 380 | Line 396 | writerr:
396          return(0);
397   }
398  
399 + #if defined(_WIN32) || defined(_WIN64)
400 + #define multi_process   solo_process
401 + #else
402 +
403   /* allocate a scrambled index array of the specified length */
404   int *
405   scramble(int n)
# Line 407 | Line 427 | scramble(int n)
427   int
428   multi_process(void)
429   {
410 #if defined(_WIN32) || defined(_WIN64)
411        fputs("Bad call to multi_process()\n", stderr);
412        return(0);
413 #else
430          int     coff = nprocs;
431          int     odd = 0;
432          char    fbuf[512];
# Line 539 | Line 555 | multi_process(void)
555   writerr:
556          fprintf(stderr, "%s: write error\n", fbuf);
557          return(0);
542 #endif
558   }
559 +
560 + #endif          /* ! Windows */
561  
562   int
563   main(int argc, char *argv[])

Diff Legend

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