too long time without a Fastest something ! so I decided to share another nice code from 3DzzD
the following function enable to filter 4 pixels using two interpolation factors to perform fast/perpixel "
bilinear/cubic filtering" of an image
the filtering is based on area covered by pixels based on their interpolation factors, and the result is something that look very similar to bicubic filtering :
- make pixels appear rounded when zoomed a lot and antialiased when zoomed out
- you can see such effect in most 3DzzD demo if you get very close of a texture : this enable high quality when texture ar zoomed out (under pixel presicion up to 1/256 with in conjonction with mipmapping enable some kind of 2*2 anisiotropic filtering) and also zoomed in that make pixels blend nice and appear rounded.
NB: for readability it is adapted from the original version wich is a little different
public int interpolate(int c1,int c2,int c3,int c4,int bX, int bY)
EDIT: correction missnamed : bilinear/cubic rather than bicubic...