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.50 by greg, Sat Mar 1 04:50:13 2025 UTC vs.
Revision 2.52 by greg, Sat Mar 22 01:27:22 2025 UTC

# Line 77 | Line 77 | sum_images(const char *fspec, const CMATRIX *cv, FILE
77                  }
78                                                          /* flat file check */
79                  if ((data_start = ftell(fp)) > 0 && fseek(fp, 0L, SEEK_END) == 0) {
80 <                        flat_file = (ftell(fp) == data_start + sizeof(COLR)*xr*yr);
80 >                        flat_file = (ftell(fp) >= data_start + sizeof(COLR)*xr*yr);
81                          if (fseek(fp, data_start, SEEK_SET) < 0) {
82                                  sprintf(errmsg, "cannot seek on picture '%s'", fname);
83                                  error(SYSTEM, errmsg);
# Line 247 | Line 247 | main(int argc, char *argv[])
247                  nsteps = smtx->ncols;
248                                                  /* load BSDF */
249                  if (argv[a+1][0] != '!' &&
250 <                                (ccp = strrchr(argv[a+1], '.')) != NULL &&
250 >                                (ccp = strrchr(argv[a+1], '.')) > argv[a+1] &&
251                                  !strcasecmp(ccp+1, "XML"))
252                          Tmat = cm_loadBTDF(argv[a+1]);
253                  else
# Line 267 | Line 267 | main(int argc, char *argv[])
267          }
268                                                  /* prepare output stream */
269          if ((ofspec != NULL) & (nsteps == 1) && hasNumberFormat(ofspec)) {
270 <                sprintf(fnbuf, ofspec, 1);
270 >                sprintf(fnbuf, ofspec, 0);
271                  ofspec = fnbuf;
272          }
273          if (ofspec != NULL && !hasNumberFormat(ofspec)) {
# Line 278 | Line 278 | main(int argc, char *argv[])
278                  }
279                  ofspec = NULL;                  /* only need to open once */
280          }
281 <        if (hasNumberFormat(argv[a])) {         /* generating image(s) */
281 >        if (hasNumberFormat(argv[a])) {         /* loading image vector(s) */
282                  if (outfmt != DTrgbe) {
283                          error(WARNING, "changing output type to -oc");
284                          outfmt = DTrgbe;
# Line 320 | Line 320 | main(int argc, char *argv[])
320                          }
321                  else if (!sum_images(argv[a], cmtx, ofp))
322                          return(1);
323 <        } else {                                /* generating vector/matrix */
323 >        } else {                                /* loading view matrix */
324                  CMATRIX *Vmat = cm_load(argv[a], 0, cmtx->nrows, DTfromHeader);
325                  CMATRIX *rmtx = cm_multiply(Vmat, cmtx);
326                  cm_free(Vmat);
# Line 348 | Line 348 | main(int argc, char *argv[])
348                                          if ((outfmt != DTrgbe) & (outfmt != DTxyze)) {
349                                                  fprintf(ofp, "NROWS=%d\n", rvec->nrows);
350                                                  fprintf(ofp, "NCOLS=%d\n", rvec->ncols);
351 <                                                fputs("NCOMP=3\n", ofp);
351 >                                                fputncomp(3, ofp);
352                                          }
353                                          if ((outfmt == DTfloat) | (outfmt == DTdouble))
354                                                  fputendian(ofp);
# Line 380 | Line 380 | main(int argc, char *argv[])
380                                  if ((outfmt != DTrgbe) & (outfmt != DTxyze)) {
381                                          fprintf(ofp, "NROWS=%d\n", rmtx->nrows);
382                                          fprintf(ofp, "NCOLS=%d\n", rmtx->ncols);
383 <                                        fputs("NCOMP=3\n", ofp);
383 >                                        fputncomp(3, ofp);
384                                  }
385                                  if ((outfmt == DTfloat) | (outfmt == DTdouble))
386                                          fputendian(ofp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines