summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-12-03 13:48:12 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-12-04 16:49:23 +0100
commit050c51d55b77a5f8a66d1da6a74d741d81510b21 (patch)
tree58f3ebf02326ae64dfa4c7f7ce88afa24dc7de4d /vcl/source
parentfb37997ece889d9a90bb5de600fcb763d339734c (diff)
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.lunak@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/bitmap/BitmapScaleSuperFilter.cxx11
1 files changed, 11 insertions, 0 deletions
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;