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.39 by greg, Sat Feb 23 18:25:12 2019 UTC vs.
Revision 2.43 by greg, Wed Oct 23 17:00:14 2019 UTC

# Line 48 | Line 48 | sum_images(const char *fspec, const CMATRIX *cv, FILE
48                          error(SYSTEM, errmsg);
49                  }
50                  dt = DTfromHeader;
51 <                if ((err = cm_getheader(&dt, NULL, NULL, fp)) != NULL)
51 >                if ((err = cm_getheader(&dt, NULL, NULL, NULL, fp)) != NULL)
52                          error(USER, err);
53                  if ((dt != DTrgbe) & (dt != DTxyze) ||
54                                  !fscnresolu(&xr, &yr, fp)) {
# Line 187 | Line 187 | main(int argc, char *argv[])
187                          case 'a':
188                                  outfmt = DTascii;
189                                  break;
190 +                        case 'c':
191 +                                outfmt = DTrgbe;
192 +                                break;
193                          default:
194                                  goto userr;
195                          }
# Line 247 | Line 250 | main(int argc, char *argv[])
250                          for (i = 0; i < nsteps; i++) {
251                                  CMATRIX *cvec = cm_column(cmtx, i);
252                                  if (ofspec != NULL) {
253 <                                        sprintf(fnbuf, ofspec, i+1);
253 >                                        sprintf(fnbuf, ofspec, i);
254                                          if ((ofp = fopen(fnbuf, "wb")) == NULL) {
255                                                  fprintf(stderr,
256                                          "%s: cannot open '%s' for output\n",
# Line 258 | Line 261 | main(int argc, char *argv[])
261                                          printargs(argc, argv, ofp);
262                                          fputnow(ofp);
263                                  }
264 <                                fprintf(ofp, "FRAME=%d\n", i+1);
264 >                                fprintf(ofp, "FRAME=%d\n", i);
265                                  if (!sum_images(argv[a], cvec, ofp))
266                                          return(1);
267                                  if (ofspec != NULL) {
# Line 282 | Line 285 | main(int argc, char *argv[])
285                          const char      *wtype = (outfmt==DTascii) ? "w" : "wb";
286                          for (i = 0; i < nsteps; i++) {
287                                  CMATRIX *rvec = cm_column(rmtx, i);
288 <                                sprintf(fnbuf, ofspec, i+1);
288 >                                sprintf(fnbuf, ofspec, i);
289                                  if ((ofp = fopen(fnbuf, wtype)) == NULL) {
290                                          fprintf(stderr,
291                                          "%s: cannot open '%s' for output\n",
# Line 296 | Line 299 | main(int argc, char *argv[])
299                                          newheader("RADIANCE", ofp);
300                                          printargs(argc, argv, ofp);
301                                          fputnow(ofp);
302 <                                        fprintf(ofp, "FRAME=%d\n", i+1);
302 >                                        fprintf(ofp, "FRAME=%d\n", i);
303                                          fprintf(ofp, "NROWS=%d\n", rvec->nrows);
304                                          fputs("NCOLS=1\nNCOMP=3\n", ofp);
305 +                                        if ((outfmt == 'f') | (outfmt == 'd'))
306 +                                                fputendian(ofp);
307                                          fputformat((char *)cm_fmt_id[outfmt], ofp);
308                                          fputc('\n', ofp);
309                                  }
# Line 325 | Line 330 | main(int argc, char *argv[])
330                                  fprintf(ofp, "NROWS=%d\n", rmtx->nrows);
331                                  fprintf(ofp, "NCOLS=%d\n", rmtx->ncols);
332                                  fputs("NCOMP=3\n", ofp);
333 +                                if ((outfmt == 'f') | (outfmt == 'd'))
334 +                                        fputendian(ofp);
335                                  fputformat((char *)cm_fmt_id[outfmt], ofp);
336                                  fputc('\n', ofp);
337                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines