14 |
|
#include <string.h> |
15 |
|
#include <stdlib.h> |
16 |
|
#include "rtmath.h" |
17 |
+ |
#include "rtio.h" |
18 |
|
#include "bsdfrep.h" |
19 |
|
|
20 |
|
char *progname; |
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); |
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) { |
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 |
|
} |