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

Comparing ray/src/common/normcodec.c (file contents):
Revision 2.2 by greg, Fri Jul 26 17:04:12 2019 UTC vs.
Revision 2.3 by greg, Wed Aug 14 21:00:14 2019 UTC

# Line 20 | Line 20 | set_nc_defaults(NORMCODEC *ncp)
20          ncp->finp = stdin;
21          ncp->inpname = "<stdin>";
22          ncp->format = 'a';
23 +        ncp->swapped = 0;
24          ncp->res.rt = PIXSTANDARD;
25          if (!progname) progname = "norm_codec";
26   }
# Line 30 | Line 31 | static int
31   headline(char *s, void *p)
32   {
33          NORMCODEC       *ncp = (NORMCODEC *)p;
34 +        int             rv;
35  
36          if (formatval(ncp->inpfmt, s))  /* don't pass format */
37                  return 0;
38  
39 +        if ((rv = isbigendian(s)) >= 0) {
40 +                ncp->swapped = (nativebigendian() != rv);
41 +                return 0;
42 +        }
43          if (ncp->hdrflags & HF_HEADOUT)
44                  fputs(s, stdout);       /* copy to standard output */
45          return 1;
# Line 65 | Line 71 | process_nc_header(NORMCODEC *ncp, int ac, char *av[])
71                                  fputformat("ascii", stdout);
72                                  break;
73                          case 'f':
74 +                                fputendian(stdout);
75                                  fputformat("float", stdout);
76                                  break;
77                          case 'd':
78 +                                fputendian(stdout);
79                                  fputformat("double", stdout);
80                                  break;
81                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines