vcl/source/bitmap/BitmapScaleSuperFilter.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+)
New commits: commit 050c51d55b77a5f8a66d1da6a74d741d81510b21 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Fri Dec 3 13:48:12 2021 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Sat Dec 4 16:49:23 2021 +0100 resurrect description of the "super" scaling algorithm Commit 53d51dbee6d4037c4cfc3fa743de8dac76da48c6 described it only in the commit message, but that's hard to find if I want to know _now_ what the thing does. Change-Id: I012ead2aa9d81ce1287da3a32e43a038cd9ba18d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126316 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx index bc7f3a8361f4..59ed78c8d6f3 100644 --- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx +++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx @@ -29,6 +29,17 @@ #include <svdata.hxx> #include <sal/log.hxx> +/* +A scaling algorithm that uses bilinear if not downscaling too much, +and averaging otherwise (bilinear would produce poor results for big downscaling). + +By default the combination of two filters is used: bilinear and averaging algorithm. +Bilinear filtering is used for bitmap enlarging and shrinking till factor 0.6. Below +this bilinear gives bad results because of limited sampling. For such cases averaging +is used which is a simple algorithm for shrinking. In averaging the algorithm +calculates the average of samples which result is the new pixel. +*/ + namespace { constexpr int MAP_PRECISION = 7;