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.8 by greg, Mon Feb 6 23:21:32 2017 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 134 | Line 135 | main(int argc, char *argv[])
135                          if (SDreportError(eval_rbfcol(&sval, rbf, odir), stderr))
136                                  return(1);
137                  }
137                if (repXYZ)                     /* ensure we have CIE (x,y) */
138                        c_ccvt(&sval.spec, C_CSXY);
138  
139                  switch (outfmt) {               /* write to stdout */
140                  case 'a':
# Line 154 | Line 153 | main(int argc, char *argv[])
153                                  cieXYZ[1] = sval.cieY;
154                                  cieXYZ[2] = (1. - sval.spec.cx - sval.spec.cy) /
155                                                  sval.spec.cy * sval.cieY;
156 <                                fwrite(cieXYZ, sizeof(double), 3, stdout);
156 >                                putbinary(cieXYZ, sizeof(double), 3, stdout);
157                          } else
158 <                                fwrite(&sval.cieY, sizeof(double), 1, stdout);
158 >                                putbinary(&sval.cieY, sizeof(double), 1, stdout);
159                          break;
160                  case 'f':
161                          if (repXYZ) {
# Line 165 | Line 164 | main(int argc, char *argv[])
164                                  cieXYZ[1] = sval.cieY;
165                                  cieXYZ[2] = (1. - sval.spec.cx - sval.spec.cy) /
166                                                  sval.spec.cy * sval.cieY;
167 <                                fwrite(cieXYZ, sizeof(float), 3, stdout);
167 >                                putbinary(cieXYZ, sizeof(float), 3, stdout);
168                          } else {
169                                  float   cieY = sval.cieY;
170 <                                fwrite(&cieY, sizeof(float), 1, stdout);
170 >                                putbinary(&cieY, sizeof(float), 1, stdout);
171                          }
172                          break;
173                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines