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.12 by greg, Thu Jul 1 21:54:56 2010 UTC vs.
Revision 2.14 by greg, Sun Apr 3 03:06:19 2011 UTC

# Line 334 | Line 334 | cm_bsdf(const struct BSDF_data *bsdf)
334  
335   /* Sum together a set of images and write result to stdout */
336   static int
337 < sum_images(const char *fspec, const CMATRIX *cv, FILE *fp)
337 > sum_images(const char *fspec, const CMATRIX *cv, FILE *fout)
338   {
339          int     myDT = DTfromHeader;
340          CMATRIX *pmat;
# Line 350 | Line 350 | sum_images(const char *fspec, const CMATRIX *cv, FILE
350                  FILE            *fp;
351                  int             dt, xr, yr;
352                  COLORV          *psp;
353 +                                                        /* check for zero */
354 +                if ((scv[RED] == .0) & (scv[GRN] == .0) & (scv[BLU] == .0))
355 +                        continue;
356                                                          /* open next picture */
357                  sprintf(fname, fspec, i);
358                  if ((fp = fopen(fname, "r")) == NULL) {
# Line 372 | Line 375 | sum_images(const char *fspec, const CMATRIX *cv, FILE
375                          pmat = cm_alloc(myYR, myXR);
376                          memset(pmat->cmem, 0, sizeof(COLOR)*myXR*myYR);
377                                                          /* finish header */
378 <                        fputformat(myDT==DTrgbe ? COLRFMT : CIEFMT, fp);
379 <                        fputc('\n', fp);
380 <                        fprtresolu(myXR, myYR, fp);
381 <                        fflush(fp);
378 >                        fputformat(myDT==DTrgbe ? COLRFMT : CIEFMT, fout);
379 >                        fputc('\n', fout);
380 >                        fprtresolu(myXR, myYR, fout);
381 >                        fflush(fout);
382                  } else if ((dt != myDT) | (xr != myXR) | (yr != myYR)) {
383                          sprintf(errmsg, "picture '%s' format/size mismatch",
384                                          fname);
# Line 400 | Line 403 | sum_images(const char *fspec, const CMATRIX *cv, FILE
403          free(scanline);
404                                                          /* write scanlines */
405          for (y = 0; y < myYR; y++)
406 <                if (fwritescan((COLOR *)cm_lval(pmat, y, 0), myXR, fp) < 0)
406 >                if (fwritescan((COLOR *)cm_lval(pmat, y, 0), myXR, fout) < 0)
407                          return(0);
408          cm_free(pmat);                                  /* all done */
409 <        return(fflush(fp) == 0);
409 >        return(fflush(fout) == 0);
410   }
411  
412   /* check to see if a string contains a %d or %o specification */
# Line 435 | Line 438 | main(int argc, char *argv[])
438                  return(1);
439          }
440  
441 <        if (argc > 3) {                         /* need to compute DC matrix? */
441 >        if (argc > 3) {                         /* VTDs expression */
442                  CMATRIX *svec, *Dmat, *Tmat, *ivec;
443                  struct BSDF_data        *btdf;
444                                                  /* get sky vector */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines