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

Comparing ray/src/cv/bsdfquery.c (file contents):
Revision 2.6 by greg, Sat Jan 30 17:34:17 2016 UTC vs.
Revision 2.7 by greg, Thu Aug 18 00:52:48 2016 UTC

# Line 14 | Line 14 | static const char RCSid[] = "$Id$";
14   #include <string.h>
15   #include <stdlib.h>
16   #include "rtmath.h"
17 + #include "rtio.h"
18   #include "bsdfrep.h"
19  
20   char    *progname;
# Line 32 | Line 33 | readIOdir(FVECT idir, FVECT odir, FILE *fp, int fmt)
33                          return(0);
34                  break;
35          case 'd':
36 <                if (fread(dvec, sizeof(double), 6, fp) != 6)
36 >                if (getbinary(dvec, sizeof(double), 6, fp) != 6)
37                          return(0);
38                  VCOPY(idir, dvec);
39                  VCOPY(odir, dvec+3);
40                  break;
41          case 'f':
42 <                if (fread(fvec, sizeof(float), 6, fp) != 6)
42 >                if (getbinary(fvec, sizeof(float), 6, fp) != 6)
43                          return(0);
44                  VCOPY(idir, fvec);
45                  VCOPY(odir, fvec+3);
# Line 154 | Line 155 | main(int argc, char *argv[])
155                                  cieXYZ[1] = sval.cieY;
156                                  cieXYZ[2] = (1. - sval.spec.cx - sval.spec.cy) /
157                                                  sval.spec.cy * sval.cieY;
158 <                                fwrite(cieXYZ, sizeof(double), 3, stdout);
158 >                                putbinary(cieXYZ, sizeof(double), 3, stdout);
159                          } else
160 <                                fwrite(&sval.cieY, sizeof(double), 1, stdout);
160 >                                putbinary(&sval.cieY, sizeof(double), 1, stdout);
161                          break;
162                  case 'f':
163                          if (repXYZ) {
# Line 165 | Line 166 | main(int argc, char *argv[])
166                                  cieXYZ[1] = sval.cieY;
167                                  cieXYZ[2] = (1. - sval.spec.cx - sval.spec.cy) /
168                                                  sval.spec.cy * sval.cieY;
169 <                                fwrite(cieXYZ, sizeof(float), 3, stdout);
169 >                                putbinary(cieXYZ, sizeof(float), 3, stdout);
170                          } else {
171                                  float   cieY = sval.cieY;
172 <                                fwrite(&cieY, sizeof(float), 1, stdout);
172 >                                putbinary(&cieY, sizeof(float), 1, stdout);
173                          }
174                          break;
175                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines