| 20 |
|
{ |
| 21 |
|
printf("Usage: %s [bsdf_directory]\n", prog); |
| 22 |
|
printf("Input commands:\n"); |
| 23 |
< |
printf(" l bsdf.xml\t\t\t Load (make active) given BSDF input file\n"); |
| 24 |
< |
printf(" q theta_i phi_i theta_o phi_o\t Query BSDF for given path\n"); |
| 23 |
> |
printf(" L bsdf.xml\t\t\t Load (make active) given BSDF input file\n"); |
| 24 |
> |
printf(" q theta_i phi_i theta_o phi_o\t Query BSDF for given path (CIE-XYZ)\n"); |
| 25 |
|
printf(" s N theta phi\t\t\t Generate N ray directions at given incidence\n"); |
| 26 |
|
printf(" h theta phi\t\t\t Report hemispherical total at given incidence\n"); |
| 27 |
|
printf(" r theta phi\t\t\t Report hemispherical reflection at given incidence\n"); |
| 92 |
|
break; |
| 93 |
|
vec_from_deg(vin, atof(sskip2(cp,1)), atof(sskip2(cp,2))); |
| 94 |
|
vec_from_deg(vout, atof(sskip2(cp,3)), atof(sskip2(cp,4))); |
| 95 |
< |
if (!SDreportError(SDevalBSDF(&val, vout, vin, bsdf), stderr)) |
| 96 |
< |
printf("%.3e\n", val.cieY); |
| 95 |
> |
if (!SDreportError(SDevalBSDF(&val, vout, vin, bsdf), stderr)) { |
| 96 |
> |
c_ccvt(&val.spec, C_CSXY); |
| 97 |
> |
printf("%.3e %.3e %.3e\n", |
| 98 |
> |
val.spec.cx/val.spec.cy*val.cieY, |
| 99 |
> |
val.cieY, |
| 100 |
> |
(1.-val.spec.cx-val.spec.cy)/ |
| 101 |
> |
val.spec.cy*val.cieY); |
| 102 |
> |
} |
| 103 |
|
continue; |
| 104 |
|
case 'S': /* sample BSDF */ |
| 105 |
|
if (bsdf == NULL) |
| 150 |
|
Usage(argv[0]); |
| 151 |
|
continue; |
| 152 |
|
noBSDFerr: |
| 153 |
< |
fprintf(stderr, "%s: need to use 'l' command to load BSDF\n", argv[0]); |
| 153 |
> |
fprintf(stderr, "%s: need to use 'L' command to load BSDF\n", argv[0]); |
| 154 |
|
} |
| 155 |
|
return 0; |
| 156 |
|
} |