762 |
|
continue; |
763 |
|
nc = getclosest(neigh, NPINTERP, x, y); |
764 |
|
setcolor(cbuffer[n], 0., 0., 0.); |
765 |
+ |
if (nc <= 0) { /* no acceptable neighbors */ |
766 |
+ |
if (y < vres-1) |
767 |
+ |
nc = fndx(x, y+1); |
768 |
+ |
else if (x < hres-1) |
769 |
+ |
nc = fndx(x+1, y); |
770 |
+ |
else |
771 |
+ |
continue; |
772 |
+ |
copycolor(cbuffer[n], cbuffer[nc]); |
773 |
+ |
continue; |
774 |
+ |
} |
775 |
|
wsum = 0.; |
776 |
|
while (nc-- > 0) { |
777 |
|
copycolor(cval, cbuffer[neigh[nc]]); |
781 |
|
addcolor(cbuffer[n], cval); |
782 |
|
wsum += w; |
783 |
|
} |
784 |
< |
if (wsum > FTINY) { |
785 |
< |
w = 1.0/wsum; |
776 |
< |
scalecolor(cbuffer[n], w); |
777 |
< |
} |
784 |
> |
w = 1.0/wsum; |
785 |
> |
scalecolor(cbuffer[n], w); |
786 |
|
} |
787 |
|
/* motion blur if requested */ |
788 |
|
if (mblur > .02) { |