diff options
Diffstat (limited to 'kdefx/kimageeffect.cpp')
-rw-r--r-- | kdefx/kimageeffect.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
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]; } } |