It has been a while since I worked on some interesting library. But the day has come 🙂 and here it is. Let me introduce you LanczosBitmapDataResizer class. Lanczos resampling is an interpolation method used to compute new values for sampled data. In resampling (resizing) images it is considered to be one of the best algorithms at all. Lanczos is a convolution filters. That means a filter that for each output value moves the convolution functions point of origin to be centered on the output and then multiplies all the values in the input with the value of the convolution function (kernel) at that location and adds them together.
The most common lanczos filter size is 3. It means that each output pixel is defined by its +- 3 pixel box. The kernel function than looks something like this:
While there is a lot of iterations and computing within my algorithm, I ivite you all to help me optimize the code.