| 334 |
|
|
| 335 |
|
/* Sum together a set of images and write result to stdout */ |
| 336 |
|
static int |
| 337 |
< |
sum_images(const char *fspec, const CMATRIX *cv, FILE *fp) |
| 337 |
> |
sum_images(const char *fspec, const CMATRIX *cv, FILE *fout) |
| 338 |
|
{ |
| 339 |
|
int myDT = DTfromHeader; |
| 340 |
|
CMATRIX *pmat; |
| 372 |
|
pmat = cm_alloc(myYR, myXR); |
| 373 |
|
memset(pmat->cmem, 0, sizeof(COLOR)*myXR*myYR); |
| 374 |
|
/* finish header */ |
| 375 |
< |
fputformat(myDT==DTrgbe ? COLRFMT : CIEFMT, fp); |
| 376 |
< |
fputc('\n', fp); |
| 377 |
< |
fprtresolu(myXR, myYR, fp); |
| 378 |
< |
fflush(fp); |
| 375 |
> |
fputformat(myDT==DTrgbe ? COLRFMT : CIEFMT, fout); |
| 376 |
> |
fputc('\n', fout); |
| 377 |
> |
fprtresolu(myXR, myYR, fout); |
| 378 |
> |
fflush(fout); |
| 379 |
|
} else if ((dt != myDT) | (xr != myXR) | (yr != myYR)) { |
| 380 |
|
sprintf(errmsg, "picture '%s' format/size mismatch", |
| 381 |
|
fname); |
| 400 |
|
free(scanline); |
| 401 |
|
/* write scanlines */ |
| 402 |
|
for (y = 0; y < myYR; y++) |
| 403 |
< |
if (fwritescan((COLOR *)cm_lval(pmat, y, 0), myXR, fp) < 0) |
| 403 |
> |
if (fwritescan((COLOR *)cm_lval(pmat, y, 0), myXR, fout) < 0) |
| 404 |
|
return(0); |
| 405 |
|
cm_free(pmat); /* all done */ |
| 406 |
< |
return(fflush(fp) == 0); |
| 406 |
> |
return(fflush(fout) == 0); |
| 407 |
|
} |
| 408 |
|
|
| 409 |
|
/* check to see if a string contains a %d or %o specification */ |
| 435 |
|
return(1); |
| 436 |
|
} |
| 437 |
|
|
| 438 |
< |
if (argc > 3) { /* need to compute DC matrix? */ |
| 438 |
> |
if (argc > 3) { /* VTDs expression */ |
| 439 |
|
CMATRIX *svec, *Dmat, *Tmat, *ivec; |
| 440 |
|
struct BSDF_data *btdf; |
| 441 |
|
/* get sky vector */ |