185 |
|
fputs("{\n", uvfp[1]); |
186 |
|
} |
187 |
|
} |
188 |
< |
/* need to assign Dx, Dy, Dz? */ |
189 |
< |
if (funame != NULL) |
188 |
> |
if (funame != NULL) /* need to assign Dx, Dy, Dz? */ |
189 |
|
assignD = (fundefined(funame) < 6); |
190 |
|
/* run through directions */ |
191 |
|
for (ix = 0; ix < sqres/2; ix++) { |
270 |
|
free(rbf); |
271 |
|
prog_show((ix+1.)*(2./sqres)); |
272 |
|
} |
273 |
+ |
prog_done(); |
274 |
|
if (pctcull >= 0) { /* finish output */ |
275 |
|
if (pclose(ofp)) { |
276 |
|
fprintf(stderr, "%s: error running rttree_reduce on Y\n", |
306 |
|
} |
307 |
|
} |
308 |
|
} |
309 |
– |
prog_done(); |
309 |
|
} |
310 |
|
|
311 |
|
/* Interpolate and output anisotropic BSDF data */ |
321 |
|
float bsdf, uv[2]; |
322 |
|
|
323 |
|
if (pctcull >= 0) { |
324 |
+ |
const char *avgopt = (input_orient>0 ^ output_orient>0) |
325 |
+ |
? "" : " -a"; |
326 |
|
sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d > %s", |
327 |
< |
(input_orient>0 ^ output_orient>0) ? "" : " -a", |
328 |
< |
pctcull, samp_order, create_component_file(0)); |
327 |
> |
avgopt, pctcull, samp_order, |
328 |
> |
create_component_file(0)); |
329 |
|
ofp = popen(cmd, "w"); |
330 |
|
if (ofp == NULL) { |
331 |
|
fprintf(stderr, "%s: cannot create pipe to rttree_reduce\n", |
339 |
|
if (rbf_colorimetry == RBCtristimulus) { |
340 |
|
double uvcull = 100. - (100.-pctcull)*.25; |
341 |
|
sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d > %s", |
342 |
< |
(input_orient>0 ^ output_orient>0) ? "" : " -a", |
343 |
< |
uvcull, samp_order, create_component_file(1)); |
342 |
> |
avgopt, uvcull, samp_order, |
343 |
> |
create_component_file(1)); |
344 |
|
uvfp[0] = popen(cmd, "w"); |
345 |
|
sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d > %s", |
346 |
< |
(input_orient>0 ^ output_orient>0) ? "" : " -a", |
347 |
< |
uvcull, samp_order, create_component_file(2)); |
346 |
> |
avgopt, uvcull, samp_order, |
347 |
> |
create_component_file(2)); |
348 |
|
uvfp[1] = popen(cmd, "w"); |
349 |
|
if ((uvfp[0] == NULL) | (uvfp[1] == NULL)) { |
350 |
|
fprintf(stderr, "%s: cannot open pipes to uv output\n", |
376 |
|
fputs("{\n", uvfp[1]); |
377 |
|
} |
378 |
|
} |
379 |
< |
/* need to assign Dx, Dy, Dz? */ |
379 |
< |
if (funame != NULL) |
379 |
> |
if (funame != NULL) /* need to assign Dx, Dy, Dz? */ |
380 |
|
assignD = (fundefined(funame) < 6); |
381 |
|
/* run through directions */ |
382 |
|
for (ix = 0; ix < sqres; ix++) |
463 |
|
free(rbf); |
464 |
|
prog_show((ix*sqres+iy+1.)/(sqres*sqres)); |
465 |
|
} |
466 |
+ |
prog_done(); |
467 |
|
if (pctcull >= 0) { /* finish output */ |
468 |
|
if (pclose(ofp)) { |
469 |
|
fprintf(stderr, "%s: error running rttree_reduce on Y\n", |
493 |
|
} |
494 |
|
} |
495 |
|
} |
495 |
– |
prog_done(); |
496 |
|
} |
497 |
|
|
498 |
|
#ifdef _WIN32 |