| 14 |
|
#include "calcomp.h" |
| 15 |
|
#include "view.h" |
| 16 |
|
|
| 17 |
< |
#define MAXINP 512 /* maximum number of input files */ |
| 17 |
> |
#define MAXINP 1024 /* maximum number of input files */ |
| 18 |
|
#define WINSIZ 64 /* scanline window size */ |
| 19 |
|
#define MIDSCN ((WINSIZ-1)/2+1) |
| 20 |
|
|
| 234 |
|
eputs("Usage: "); |
| 235 |
|
eputs(argv[0]); |
| 236 |
|
eputs( |
| 237 |
< |
" [-w][-h][-x xr][-y yr][-e expr][-f file] [ [-o][-s f][-c r g b] pic ..]\n"); |
| 237 |
> |
" [-w][-h][-x xr][-y yr][-e expr][-f file] [ [-o][-s f][-c r g b] hdr ..]\n"); |
| 238 |
|
quit(1); |
| 239 |
|
return 1; /* pro forma return */ |
| 240 |
|
} |
| 398 |
|
advance(); |
| 399 |
|
varset(vypos, '=', (double)ypos); |
| 400 |
|
for (xpos = 0; xpos < xres; xpos++) { |
| 401 |
< |
xscan = (long)xpos*xmax/xres; |
| 401 |
> |
xscan = (xpos+.5)*xmax/xres; |
| 402 |
|
varset(vxpos, '=', (double)xpos); |
| 403 |
|
eclock++; |
| 404 |
|
if (brtdef != NULL) { |
| 437 |
|
register COLOR *st; |
| 438 |
|
register int i, j; |
| 439 |
|
|
| 440 |
< |
for (ytarget = (long)ypos*ymax/yres; yscan > ytarget; yscan--) |
| 440 |
> |
for (ytarget = (ypos+.5)*ymax/yres; yscan > ytarget; yscan--) |
| 441 |
|
for (i = 0; i < nfiles; i++) { |
| 442 |
|
st = input[i].scan[WINSIZ-1]; |
| 443 |
|
for (j = WINSIZ-1; j > 0; j--) /* rotate window */ |
| 458 |
|
|
| 459 |
|
static double |
| 460 |
|
l_expos( /* return picture exposure */ |
| 461 |
< |
register char *nam |
| 461 |
> |
char *nam |
| 462 |
|
) |
| 463 |
|
{ |
| 464 |
< |
register int fn, n; |
| 464 |
> |
int fn, n; |
| 465 |
> |
double d; |
| 466 |
|
|
| 467 |
< |
fn = argument(1) - .5; |
| 468 |
< |
if (fn < 0 || fn >= nfiles) |
| 469 |
< |
return(1.0); |
| 467 |
> |
d = argument(1); |
| 468 |
> |
if (d <= -0.5 || d >= nfiles+0.5) { |
| 469 |
> |
errno = EDOM; |
| 470 |
> |
return(0.0); |
| 471 |
> |
} |
| 472 |
> |
if (d < 0.5) |
| 473 |
> |
return((double)nfiles); |
| 474 |
> |
fn = d - 0.5; |
| 475 |
|
if (nam == vbrtexp) |
| 476 |
|
return((*ourbright)(input[fn].expos)); |
| 477 |
|
n = 3; |
| 487 |
|
static double |
| 488 |
|
l_pixaspect(char *nm) /* return pixel aspect ratio */ |
| 489 |
|
{ |
| 490 |
< |
register int fn; |
| 490 |
> |
int fn; |
| 491 |
> |
double d; |
| 492 |
|
|
| 493 |
< |
fn = argument(1) - .5; |
| 494 |
< |
if (fn < 0 || fn >= nfiles) |
| 495 |
< |
return(1.0); |
| 493 |
> |
d = argument(1); |
| 494 |
> |
if (d <= -0.5 || d >= nfiles+0.5) { |
| 495 |
> |
errno = EDOM; |
| 496 |
> |
return(0.0); |
| 497 |
> |
} |
| 498 |
> |
if (d < 0.5) |
| 499 |
> |
return((double)nfiles); |
| 500 |
> |
fn = d - 0.5; |
| 501 |
|
return(input[fn].pa); |
| 502 |
|
} |
| 503 |
|
|
| 511 |
|
register int n, xoff, yoff; |
| 512 |
|
double d; |
| 513 |
|
|
| 514 |
< |
fn = argument(1) - .5; |
| 515 |
< |
if (fn < 0 || fn >= nfiles) { |
| 514 |
> |
d = argument(1); |
| 515 |
> |
if (d <= -0.5 || d >= nfiles+0.5) { |
| 516 |
|
errno = EDOM; |
| 517 |
|
return(0.0); |
| 518 |
|
} |
| 519 |
+ |
if (d < 0.5) |
| 520 |
+ |
return((double)nfiles); |
| 521 |
+ |
fn = d - 0.5; |
| 522 |
|
xoff = yoff = 0; |
| 523 |
|
n = nargum(); |
| 524 |
|
if (n >= 2) { |
| 570 |
|
static FVECT lorg[MAXINP], ldir[MAXINP]; |
| 571 |
|
static double ldist[MAXINP]; |
| 572 |
|
RREAL loc[2]; |
| 573 |
+ |
double d; |
| 574 |
|
int fn; |
| 575 |
|
register int i; |
| 576 |
|
|
| 577 |
< |
fn = argument(1) - .5; |
| 578 |
< |
if (fn < 0 || fn >= nfiles) { |
| 577 |
> |
d = argument(1); |
| 578 |
> |
if (d <= -0.5 || d >= nfiles+0.5) { |
| 579 |
|
errno = EDOM; |
| 580 |
|
return(0.0); |
| 581 |
|
} |
| 582 |
+ |
if (d < 0.5) |
| 583 |
+ |
return((double)nfiles); |
| 584 |
+ |
fn = d - 0.5; |
| 585 |
|
if (ltick[fn] != eclock) { /* need to compute? */ |
| 586 |
|
lorg[fn][0] = lorg[fn][1] = lorg[fn][2] = 0.0; |
| 587 |
|
ldir[fn][0] = ldir[fn][1] = ldir[fn][2] = 0.0; |
| 618 |
|
register int i; |
| 619 |
|
|
| 620 |
|
d = argument(1); |
| 621 |
< |
if (d < .5 || d >= nfiles+.5) { |
| 621 |
> |
if (d <= -0.5 || d >= nfiles+0.5) { |
| 622 |
|
errno = EDOM; |
| 623 |
|
return(0.0); |
| 624 |
|
} |
| 625 |
< |
fn = d - .5; |
| 625 |
> |
if (d < 0.5) |
| 626 |
> |
return((double)nfiles); |
| 627 |
> |
fn = d - 0.5; |
| 628 |
|
if (ltick[fn] != eclock) { /* need to compute? */ |
| 629 |
|
psize[fn] = 0.0; |
| 630 |
|
if (input[fn].vw.type == 0) |