519 |
|
} |
520 |
|
/* |
521 |
|
* If we have no background for this pixel, |
522 |
– |
* or if the background is too distant, |
522 |
|
* use the given fill function. |
523 |
|
*/ |
524 |
< |
if ((xback < 0 && yback[x] < 0) |
525 |
< |
|| (samp > 0 |
527 |
< |
&& ABS(x-xback) >= samp |
528 |
< |
&& ABS(y-yback[y]) >= samp)) { |
529 |
< |
(*fill)(x,y); |
530 |
< |
if (fill != backfill) { /* reuse */ |
531 |
< |
yback[x] = -2; |
532 |
< |
xback = -2; |
533 |
< |
} |
534 |
< |
continue; |
535 |
< |
} |
524 |
> |
if (xback < 0 && yback[x] < 0) |
525 |
> |
goto fillit; |
526 |
|
/* |
527 |
|
* Compare, and use the background that is |
528 |
|
* farther, unless one of them is next to us. |
529 |
+ |
* If the background is too distant, call |
530 |
+ |
* the fill function. |
531 |
|
*/ |
532 |
|
if ( yback[x] < 0 |
533 |
|
|| (xback >= 0 && ABS(x-xback) <= 1) |
534 |
|
|| ( ABS(y-yback[x]) > 1 |
535 |
|
&& zscan(yback[x])[x] |
536 |
|
< zscan(y)[xback] ) ) { |
537 |
+ |
if (samp > 0 && ABS(x-xback) >= samp) |
538 |
+ |
goto fillit; |
539 |
|
copycolr(pscan(y)[x],pscan(y)[xback]); |
540 |
|
zscan(y)[x] = zscan(y)[xback]; |
541 |
|
} else { |
542 |
+ |
if (samp > 0 && ABS(y-yback[x]) > samp) |
543 |
+ |
goto fillit; |
544 |
|
copycolr(pscan(y)[x],pscan(yback[x])[x]); |
545 |
|
zscan(y)[x] = zscan(yback[x])[x]; |
546 |
+ |
} |
547 |
+ |
continue; |
548 |
+ |
fillit: |
549 |
+ |
(*fill)(x,y); |
550 |
+ |
if (fill == rcalfill) { /* use it */ |
551 |
+ |
clearqueue(); |
552 |
+ |
xback = x; |
553 |
+ |
yback[x] = y; |
554 |
|
} |
555 |
|
} else { /* full pixel */ |
556 |
|
yback[x] = -2; |