summaryrefslogtreecommitdiffstats
path: root/kdeui/krootpixmap.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-25 21:13:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-25 21:13:21 +0000
commit2944cdf050c47b9a048b7f0d19741fac23aa77c3 (patch)
treea60a52ad7403edadb2839096c9530b1fc777ba47 /kdeui/krootpixmap.cpp
parenteab043fd0dea1332165e5f57f4d7fd8ed0422398 (diff)
downloadtdelibs-2944cdf050c47b9a048b7f0d19741fac23aa77c3.tar.gz
tdelibs-2944cdf050c47b9a048b7f0d19741fac23aa77c3.zip
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
Diffstat (limited to 'kdeui/krootpixmap.cpp')
-rw-r--r--kdeui/krootpixmap.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/kdeui/krootpixmap.cpp b/kdeui/krootpixmap.cpp
index d583a243d..8dbdf6149 100644
--- a/kdeui/krootpixmap.cpp
+++ b/kdeui/krootpixmap.cpp
@@ -59,6 +59,8 @@ void KRootPixmap::init()
{
d = new KRootPixmapData;
m_Fade = 0;
+ m_BlurRadius = 0;
+ m_BlurSigma = 0;
m_pPixmap = new KSharedPixmap; //ordinary KPixmap on win32
m_pTimer = new TQTimer( this );
m_bInit = false;
@@ -137,6 +139,11 @@ void KRootPixmap::setFadeEffect(double fade, const TQColor &color)
if ( m_bActive && m_bInit ) tqrepaint(true);
}
+void KRootPixmap::setBlurEffect(double radius, double sigma)
+{
+ m_BlurRadius = radius;
+ m_BlurSigma = sigma;
+}
bool KRootPixmap::eventFilter(TQObject *, TQEvent *event)
{
@@ -312,6 +319,14 @@ void KRootPixmap::updateBackground( KSharedPixmap *spm )
pm = io.convertToPixmap(img);
}
+ if ((m_BlurRadius > 1e-6) || (m_BlurSigma > 1e-6))
+ {
+ KPixmapIO io;
+ TQImage img = io.convertToImage(pm);
+ img = KImageEffect::blur(img, m_BlurRadius, m_BlurSigma);
+ pm = io.convertToPixmap(img);
+ }
+
if ( !m_bCustomPaint )
m_pWidget->setBackgroundPixmap( pm );
else {