| 19 |
|
|
| 20 |
|
#define rdirscan(y) (raydir+(y)*fvxr) |
| 21 |
|
|
| 22 |
+ |
static void compraydir(void); |
| 23 |
+ |
#if ADJ_VEIL |
| 24 |
+ |
static void smoothveil(void); |
| 25 |
+ |
#endif |
| 26 |
|
|
| 27 |
< |
compraydir() /* compute ray directions */ |
| 27 |
> |
|
| 28 |
> |
static void |
| 29 |
> |
compraydir(void) /* compute ray directions */ |
| 30 |
|
{ |
| 31 |
|
FVECT rorg, rdir; |
| 32 |
|
double h, v; |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
|
| 78 |
< |
compveil() /* compute veiling image */ |
| 78 |
> |
extern void |
| 79 |
> |
compveil(void) /* compute veiling image */ |
| 80 |
|
{ |
| 81 |
|
double t2, t2sum; |
| 82 |
|
COLOR ctmp, vsum; |
| 137 |
|
* and added to the foveal image, and the mapping has been |
| 138 |
|
* determined. |
| 139 |
|
*/ |
| 140 |
< |
adjveil() /* adjust veil image */ |
| 140 |
> |
extern void |
| 141 |
> |
adjveil(void) /* adjust veil image */ |
| 142 |
|
{ |
| 143 |
|
float *crfptr = crfimg; |
| 144 |
|
COLOR *fovptr = fovimg; |
| 184 |
|
} |
| 185 |
|
|
| 186 |
|
|
| 187 |
< |
smoothveil() /* smooth veil image */ |
| 187 |
> |
static void |
| 188 |
> |
smoothveil(void) /* smooth veil image */ |
| 189 |
|
{ |
| 190 |
|
COLOR *nveilimg; |
| 191 |
|
COLOR *ovptr, *nvptr; |
| 254 |
|
} |
| 255 |
|
#endif |
| 256 |
|
|
| 257 |
< |
addveil(sl, y) /* add veil to scanline */ |
| 258 |
< |
COLOR *sl; |
| 259 |
< |
int y; |
| 257 |
> |
extern void |
| 258 |
> |
addveil( /* add veil to scanline */ |
| 259 |
> |
COLOR *sl, |
| 260 |
> |
int y |
| 261 |
> |
) |
| 262 |
|
{ |
| 263 |
|
int vx, vy; |
| 264 |
|
double dx, dy; |
| 298 |
|
|
| 299 |
|
SCANBAR *rootbar; /* root scan bar (lowest resolution) */ |
| 300 |
|
|
| 301 |
< |
float *inpacuD; /* input acuity data (cycles/degree) */ |
| 301 |
> |
float *inpacuD = NULL; /* input acuity data (cycles/degree) */ |
| 302 |
|
|
| 303 |
|
#define tsampr(x,y) inpacuD[(y)*fvxr+(x)] |
| 304 |
|
|
| 305 |
+ |
static COLOR * getascan(SCANBAR *sb, int y); |
| 306 |
+ |
static void acusample(COLOR col, int x, int y, double sr); |
| 307 |
+ |
static void ascanval(COLOR col, int x, int y, SCANBAR *sb); |
| 308 |
+ |
static SCANBAR *sballoc(int se, int ns, int sl); |
| 309 |
|
|
| 310 |
< |
double |
| 311 |
< |
hacuity(La) /* return visual acuity in cycles/degree */ |
| 312 |
< |
double La; |
| 310 |
> |
extern double |
| 311 |
> |
hacuity( /* return visual acuity in cycles/degree */ |
| 312 |
> |
double La |
| 313 |
> |
) |
| 314 |
|
{ |
| 315 |
|
/* functional fit */ |
| 316 |
|
return(17.25*atan(1.4*log10(La) + 0.35) + 25.72); |
| 317 |
|
} |
| 318 |
|
|
| 319 |
|
|
| 320 |
< |
COLOR * |
| 321 |
< |
getascan(sb, y) /* find/read scanline y for scanbar sb */ |
| 322 |
< |
register SCANBAR *sb; |
| 323 |
< |
int y; |
| 320 |
> |
static COLOR * |
| 321 |
> |
getascan( /* find/read scanline y for scanbar sb */ |
| 322 |
> |
register SCANBAR *sb, |
| 323 |
> |
int y |
| 324 |
> |
) |
| 325 |
|
{ |
| 326 |
|
register COLOR *sl0, *sl1, *mysl; |
| 327 |
|
register int i; |
| 354 |
|
} |
| 355 |
|
|
| 356 |
|
|
| 357 |
< |
acuscan(scln, y) /* get acuity-sampled scanline */ |
| 358 |
< |
COLOR *scln; |
| 359 |
< |
int y; |
| 357 |
> |
extern void |
| 358 |
> |
acuscan( /* get acuity-sampled scanline */ |
| 359 |
> |
COLOR *scln, |
| 360 |
> |
int y |
| 361 |
> |
) |
| 362 |
|
{ |
| 363 |
|
double sr; |
| 364 |
|
double dx, dy; |
| 365 |
|
int ix, iy; |
| 366 |
|
register int x; |
| 367 |
+ |
|
| 368 |
+ |
if (inpacuD == NULL) |
| 369 |
+ |
return; |
| 370 |
|
/* compute foveal y position */ |
| 371 |
|
iy = dy = (y+.5)/numscans(&inpres)*fvyr - .5; |
| 372 |
|
while (iy >= fvyr-1) iy--; |
| 385 |
|
} |
| 386 |
|
|
| 387 |
|
|
| 388 |
< |
acusample(col, x, y, sr) /* interpolate sample at (x,y) using rate sr */ |
| 389 |
< |
COLOR col; |
| 390 |
< |
int x, y; |
| 391 |
< |
double sr; |
| 388 |
> |
static void |
| 389 |
> |
acusample( /* interpolate sample at (x,y) using rate sr */ |
| 390 |
> |
COLOR col, |
| 391 |
> |
int x, |
| 392 |
> |
int y, |
| 393 |
> |
double sr |
| 394 |
> |
) |
| 395 |
|
{ |
| 396 |
|
COLOR c1; |
| 397 |
|
double d; |
| 410 |
|
} |
| 411 |
|
|
| 412 |
|
|
| 413 |
< |
ascanval(col, x, y, sb) /* interpolate scanbar at orig. coords (x,y) */ |
| 414 |
< |
COLOR col; |
| 415 |
< |
int x, y; |
| 416 |
< |
SCANBAR *sb; |
| 413 |
> |
static void |
| 414 |
> |
ascanval( /* interpolate scanbar at orig. coords (x,y) */ |
| 415 |
> |
COLOR col, |
| 416 |
> |
int x, |
| 417 |
> |
int y, |
| 418 |
> |
SCANBAR *sb |
| 419 |
> |
) |
| 420 |
|
{ |
| 421 |
|
COLOR *sl0, *sl1, c1, c1y; |
| 422 |
|
double dx, dy; |
| 461 |
|
} |
| 462 |
|
|
| 463 |
|
|
| 464 |
< |
SCANBAR * |
| 465 |
< |
sballoc(se, ns, sl) /* allocate scanbar */ |
| 466 |
< |
int se; /* sampling rate exponent */ |
| 467 |
< |
int ns; /* number of scanlines */ |
| 468 |
< |
int sl; /* original scanline length */ |
| 464 |
> |
static SCANBAR * |
| 465 |
> |
sballoc( /* allocate scanbar */ |
| 466 |
> |
int se, /* sampling rate exponent */ |
| 467 |
> |
int ns, /* number of scanlines */ |
| 468 |
> |
int sl /* original scanline length */ |
| 469 |
> |
) |
| 470 |
|
{ |
| 471 |
|
SCANBAR *sbarr; |
| 472 |
|
register SCANBAR *sb; |
| 491 |
|
} |
| 492 |
|
|
| 493 |
|
|
| 494 |
< |
initacuity() /* initialize variable acuity sampling */ |
| 494 |
> |
extern int |
| 495 |
> |
initacuity(void) /* initialize variable acuity sampling */ |
| 496 |
|
{ |
| 497 |
|
FVECT diffx, diffy, cp; |
| 498 |
|
double omega, maxsr; |
| 499 |
|
register int x, y, i; |
| 500 |
+ |
|
| 501 |
+ |
if (fvxr < 3 || fvyr < 3) |
| 502 |
+ |
return(0); /* too small to work with */ |
| 503 |
|
|
| 504 |
|
compraydir(); /* compute ray directions */ |
| 505 |
|
|
| 536 |
|
} |
| 537 |
|
/* initialize with next power of two */ |
| 538 |
|
rootbar = sballoc((int)(log(maxsr)/log(2.))+1, 2, scanlen(&inpres)); |
| 539 |
+ |
return(1); |
| 540 |
|
} |