8 |
|
*/ |
9 |
|
|
10 |
|
#include <ctype.h> |
11 |
+ |
#include "platform.h" |
12 |
|
#include "standard.h" |
13 |
|
#include "cmatrix.h" |
14 |
|
#include "platform.h" |
183 |
|
goto userr; |
184 |
|
|
185 |
|
if (argc-a > 2) { /* VTDs expression */ |
186 |
< |
CMATRIX *smtx, *Dmat, *Tmat, *imtx; |
186 |
> |
CMATRIX *smtx, *Dmat, *Tmat, *imtx; |
187 |
> |
const char *ccp; |
188 |
|
/* get sky vector/matrix */ |
189 |
|
smtx = cm_load(argv[a+3], 0, nsteps, skyfmt); |
190 |
|
nsteps = smtx->ncols; |
191 |
|
/* load BSDF */ |
192 |
< |
Tmat = cm_loadBTDF(argv[a+1]); |
192 |
> |
if (argv[a+1][0] != '!' && |
193 |
> |
(ccp = strrchr(argv[a+1], '.')) != NULL && |
194 |
> |
!strcasecmp(ccp+1, "XML")) |
195 |
> |
Tmat = cm_loadBTDF(argv[a+1]); |
196 |
> |
else |
197 |
> |
Tmat = cm_load(argv[a+1], 0, 0, DTfromHeader); |
198 |
|
/* load Daylight matrix */ |
199 |
< |
Dmat = cm_load(argv[a+2], Tmat==NULL ? 0 : Tmat->ncols, |
199 |
> |
Dmat = cm_load(argv[a+2], Tmat->ncols, |
200 |
|
smtx->nrows, DTfromHeader); |
201 |
|
/* multiply vector through */ |
202 |
|
imtx = cm_multiply(Dmat, smtx); |
326 |
|
userr: |
327 |
|
fprintf(stderr, "Usage: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] DCspec [skyf]\n", |
328 |
|
progname); |
329 |
< |
fprintf(stderr, " or: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] Vspec Tbsdf.xml Dmat.dat [skyf]\n", |
329 |
> |
fprintf(stderr, " or: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] Vspec Tbsdf Dmat.dat [skyf]\n", |
330 |
|
progname); |
331 |
|
return(1); |
332 |
|
} |