summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorJasper van de Gronde <jasper.vandegronde@gmail.com>2013-03-21 11:24:40 +0000
committerJaspervdg <th.v.d.gronde@hccnet.nl>2013-03-21 11:24:40 +0000
commit787604447932202d97e7e9d4fcd3bec5403417d9 (patch)
tree3a46bded000909fdf4bb48d81127b429f77513c3 /src/display
parentHandle bitmap downsampling ourselves, see bug #804162 in launchpad. (diff)
downloadinkscape-787604447932202d97e7e9d4fcd3bec5403417d9.tar.gz
inkscape-787604447932202d97e7e9d4fcd3bec5403417d9.zip
Clarified choice of downsampling routine.
(bzr r12228)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/drawing-image.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/display/drawing-image.cpp b/src/display/drawing-image.cpp
index 185b62285..2bfd71713 100644
--- a/src/display/drawing-image.cpp
+++ b/src/display/drawing-image.cpp
@@ -160,8 +160,10 @@ unsigned DrawingImage::_renderItem(DrawingContext &ct, Geom::IntRect const &/*ar
if (_new_surface) cairo_surface_destroy(_new_surface);
_rescaledSize = newSize;
- // This essentially considers an image to be composed of rectangular pixels and computes the least-squares approximation of the original.
+ // This essentially considers an image to be composed of rectangular pixels (box kernel) and computes the least-squares approximation of the original.
// When the scale factor is really large or small this essentially results in using a box filter, while for scale factors approaching 1 it is more like a "tent" kernel.
+ // Although the quality of the result is not great, it is typically better than an ordinary box filter, and it is guaranteed to preserve the overall brightness of the image.
+ // The best improvement would probably be to do the same kind of thing based on a tent kernel, but that's quite a bit more complicated, and probably not worth the trouble for a hack like this.
int newwidth = static_cast<int>(floor(orgwidth*scaleExpansionSmall[Geom::X])+1);
int newheight = static_cast<int>(floor(orgheight*scaleExpansionSmall[Geom::Y])+1);
std::vector<int> xBegin(newwidth, -1), yBegin(newheight, -1);