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

Comparing ray/src/util/rmatrix.c (file contents):
Revision 2.63 by greg, Tue Nov 28 00:46:23 2023 UTC vs.
Revision 2.64 by greg, Tue Nov 28 16:19:31 2023 UTC

# Line 587 | Line 587 | rmx_write(const RMATRIX *rm, int dtype, FILE *fp)
587   #ifdef getc_unlocked
588          flockfile(fp);
589   #endif
590 <                                                /* complete header */
591 <        if (rm->info)
590 >        if (rm->info)                           /* complete header */
591                  fputs(rm->info, fp);
592          if (dtype == DTfromHeader)
593                  dtype = rm->dtype;
# Line 604 | Line 603 | rmx_write(const RMATRIX *rm, int dtype, FILE *fp)
603          else if (rm->cexp[GRN] != 1.f)
604                  fputexpos(rm->cexp[GRN], fp);
605          if ((dtype != DTrgbe) & (dtype != DTxyze)) {
606 <                if (dtype == DTspec) {
608 <                        if (rm->ncomp < 3)
609 <                                return(0);      /* bad # components */
610 <                        fputwlsplit(rm->wlpart, fp);
611 <                } else {
606 >                if (dtype != DTspec) {
607                          fprintf(fp, "NROWS=%d\n", rm->nrows);
608                          fprintf(fp, "NCOLS=%d\n", rm->ncols);
609 <                }
609 >                } else if (rm->ncomp < 3)
610 >                        return(0);              /* bad # components */
611                  fputncomp(rm->ncomp, fp);
612 +                if (dtype == DTspec || (rm->ncomp > 3 &&
613 +                                memcmp(rm->wlpart, WLPART, sizeof(WLPART))))
614 +                        fputwlsplit(rm->wlpart, fp);
615          } else if ((rm->ncomp != 3) & (rm->ncomp != 1))
616                  return(0);                      /* wrong # components */
617          if ((dtype == DTfloat) | (dtype == DTdouble))
618                  fputendian(fp);                 /* important to record */
619          fputformat(cm_fmt_id[dtype], fp);
620 <        fputc('\n', fp);
620 >        fputc('\n', fp);                        /* end of header */
621          switch (dtype) {                        /* write data */
622          case DTascii:
623                  ok = rmx_write_ascii(rm, fp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines