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

Comparing ray/src/util/dctimestep.c (file contents):
Revision 2.52 by greg, Sat Mar 22 01:27:22 2025 UTC vs.
Revision 2.53 by greg, Thu Mar 27 16:34:23 2025 UTC

# Line 20 | Line 20 | char   *progname;                      /* global argv[0] */
20   static int
21   sum_images(const char *fspec, const CMATRIX *cv, FILE *fout)
22   {
23 +        static int      runcnt = 0;
24          int     myDT = DTfromHeader;
25          COLR    *scanline = NULL;
26          CMATRIX *pmat = NULL;
# Line 28 | Line 29 | sum_images(const char *fspec, const CMATRIX *cv, FILE
29  
30          if (cv->ncols != 1)
31                  error(INTERNAL, "expected vector in sum_images()");
32 <        for (i = 0; i < cv->nrows; i++) {
33 <                const COLORV    *scv = cv_lval(cv,i);
32 >        for (i = cv->nrows; i-- > 0; ) {
33 >                const int       r = runcnt&1 ? i : cv->nrows-1 - i;
34 >                const COLORV    *scv = cv_lval(cv,r);
35                  int             flat_file = 0;
36                  char            fname[1024];
37                  FILE            *fp;
# Line 39 | Line 41 | sum_images(const char *fspec, const CMATRIX *cv, FILE
41                  char            *err;
42                                                          /* check for zero */
43                  if ((scv[RED] == 0) & (scv[GRN] == 0) & (scv[BLU] == 0) &&
44 <                                (myDT != DTfromHeader) | (i < cv->nrows-1))
44 >                                (myDT != DTfromHeader) | (i > 0))
45                          continue;
46                                                          /* open next picture */
47 <                sprintf(fname, fspec, i);
47 >                sprintf(fname, fspec, r);
48                  if ((fp = fopen(fname, "rb")) == NULL) {
49                          sprintf(errmsg, "cannot open picture '%s'", fname);
50                          error(SYSTEM, errmsg);
# Line 107 | Line 109 | sum_images(const char *fspec, const CMATRIX *cv, FILE
109          free(scanline);
110          i = cm_write(pmat, myDT, fout);                 /* write picture */
111          cm_free(pmat);                                  /* free data */
112 +        ++runcnt;                                       /* for zig-zagging */
113          return(i);
114   }
115  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines