[fpc-pascal] fpImage resample via interpolation
Mattias Gaertner
nc-gaertnma at netcologne.de
Thu Nov 27 23:14:10 CET 2008
As far as I can see, fpImage has for StretchDraw only the
TMitchelInterpolation.
The current implementation has a few drawbacks:
- it creates a temporary image for resizing horizontally. If you have
to resize big scanned images or gis data this makes trouble.
- it computes all factors each time for every pixel
- it seems to only support shrinking by up to a factor of two.
I have written an interpolation that does not require a temporary image
(only a small buffer for a few lines), pre computes the factors and
supports any shrink factor. It is about 250 loc just like the
TMitchelInterpolation, needs less memory and is about twice as
fast.
I will contribute it to fpImage.
At the moment it uses a linear distribution for enlarging. I'm not yet
sure if I should use the Mitchel distribution or a Gauss distribution.
Maybe someone can give me some advice.
Mattias
More information about the fpc-pascal
mailing list