From 2944cdf050c47b9a048b7f0d19741fac23aa77c3 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 25 Aug 2011 21:13:21 +0000 Subject: Fix KImageEffect blur convolution Add blur ability to krootpixmap git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1249535 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdefx/kimageeffect.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'kdefx') diff --git a/kdefx/kimageeffect.cpp b/kdefx/kimageeffect.cpp index 8fac1f5cb..d2955403a 100644 --- a/kdefx/kimageeffect.cpp +++ b/kdefx/kimageeffect.cpp @@ -4316,6 +4316,7 @@ TQImage KImageEffect::blur(TQImage &src, double radius, double sigma) dest.create(src.width(), src.height(), 32); + // Horizontal convolution scanline = (unsigned int *)malloc(sizeof(unsigned int)*src.height()); temp = (unsigned int *)malloc(sizeof(unsigned int)*src.height()); for(y=0; y < src.height(); ++y){ @@ -4324,14 +4325,17 @@ TQImage KImageEffect::blur(TQImage &src, double radius, double sigma) blurScanLine(kernel, width, p, q, src.width()); } - unsigned int **srcTable = (unsigned int **)src.jumpTable(); + TQImage partial = dest; + + // Vertical convolution + unsigned int **srcTable = (unsigned int **)partial.jumpTable(); unsigned int **destTable = (unsigned int **)dest.jumpTable(); - for(x=0; x < src.width(); ++x){ - for(y=0; y < src.height(); ++y){ + for(x=0; x < partial.width(); ++x){ + for(y=0; y < partial.height(); ++y){ scanline[y] = srcTable[y][x]; } - blurScanLine(kernel, width, scanline, temp, src.height()); - for(y=0; y < src.height(); ++y){ + blurScanLine(kernel, width, scanline, temp, partial.height()); + for(y=0; y < partial.height(); ++y){ destTable[y][x] = temp[y]; } } -- cgit v1.2.1