| 7 |
|
|
| 8 |
|
#include <stdlib.h> |
| 9 |
|
#include "rtio.h" |
| 10 |
– |
#include "paths.h" |
| 10 |
|
#include "rtmath.h" |
| 11 |
|
#include "bsdfrep.h" |
| 12 |
|
|
| 43 |
|
#define set_minlog() overall_min = (overall_min < 1e-5) ? 1e-5 : overall_min; \ |
| 44 |
|
min_log10 = log10(overall_min) - .1 |
| 45 |
|
|
| 47 |
– |
char *progname; |
| 48 |
– |
|
| 46 |
|
/* Get Fibonacci sphere vector (0 to NINCIDENT-1) */ |
| 47 |
|
static RREAL * |
| 48 |
|
get_ivector(FVECT iv, int i) |
| 141 |
|
SDValue sval; |
| 142 |
|
double bsdf; |
| 143 |
|
ovec_from_pos(ovec, i*GRIDSTEP, j*GRIDSTEP); |
| 144 |
< |
if (SDreportError(SDevalBSDF(&sval, ovec, |
| 145 |
< |
ivec, sd), stderr)) |
| 144 |
> |
if (SDreportError(SDevalBSDF(&sval, ivec, |
| 145 |
> |
ovec, sd), stderr)) |
| 146 |
|
return(0); |
| 147 |
|
if (sval.cieY > overall_max) |
| 148 |
|
overall_max = sval.cieY; |
| 635 |
|
if ((fp = popen(cmdbuf, "r")) == NULL || |
| 636 |
|
fscanf(fp, "%f %f %f %f %f %f", |
| 637 |
|
&xmin, &xmax, &ymin, &ymax, &zmin, &zmax) != 6 |
| 638 |
< |
|| pclose(fp) < 0) { |
| 638 |
> |
|| pclose(fp) != 0) { |
| 639 |
|
fprintf(stderr, "%s: error reading from command: %s\n", |
| 640 |
|
progname, cmdbuf); |
| 641 |
|
return; |
| 706 |
|
double myLim[2]; |
| 707 |
|
SDData myBSDF; |
| 708 |
|
int a, n; |
| 709 |
+ |
/* set global progname */ |
| 710 |
+ |
fixargv0(argv[0]); |
| 711 |
|
/* check arguments */ |
| 713 |
– |
progname = argv[0]; |
| 712 |
|
a = 1; |
| 713 |
|
myLim[0] = -1; myLim[1] = -2; /* specified BSDF range? */ |
| 714 |
|
if (argc > a+3 && argv[a][0] == '-' && argv[a][1] == 'r') { |