[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegraphics/kolourpaint/imagelib/effects
From:       Clarence Dang <dang () kde ! org>
Date:       2007-08-12 3:29:00
Message-ID: 1186889340.586145.5085.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 699142 by dang:

* Port "Emboss" effect from crashing-and-will-be-killed KImageEffect to Blitz

* Remove unneeded #include


 M  +11 -24    kpEffectEmboss.cpp  


--- trunk/KDE/kdegraphics/kolourpaint/imagelib/effects/kpEffectEmboss.cpp #699141:699142
@@ -31,19 +31,11 @@
 
 #include <kpEffectEmboss.h>
 
-#include <qbitmap.h>
-#include <qcheckbox.h>
-#include <qgridlayout.h>
+#include <blitz.h>
+
 #include <qimage.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qpushbutton.h>
 
 #include <kdebug.h>
-#include <kimageeffect.h>
-#include <klocale.h>
-#include <knuminput.h>
 
 #include <kpPixmapFX.h>
 
@@ -77,7 +69,7 @@
 
     for (int i = 0; i < repeat; i++)
     {
-        qimage = KImageEffect::emboss (qimage, radius, sigma);
+        qimage = Blitz::emboss (qimage, radius, sigma);
     }
 
 
@@ -96,25 +88,20 @@
     Q_ASSERT (strength >= MinStrength && strength <= MaxStrength);
 
 
-    // (KImageEffect::emboss() ignores mask)
-    QPixmap usePixmap = kpPixmapFX::pixmapWithDefinedTransparentPixels (
-        image,
-        Qt::white/*arbitrarily chosen*/);
+    QImage qimage = kpPixmapFX::convertToImage (image);
 
-
-    QImage qimage = kpPixmapFX::convertToImage (usePixmap);
-
     qimage = ::EmbossQImage (qimage, strength);
 
-    QPixmap retPixmap = kpPixmapFX::convertToPixmap (qimage);
+    kpImage retImage = kpPixmapFX::convertToPixmap (qimage);
 
 
-    // KImageEffect::emboss() nukes mask - restore it
-    if (!usePixmap.mask ().isNull())
-        retPixmap.setMask (usePixmap.mask ());
+#if DEBUG_KP_EFFECT_EMBOSS
+    kDebug () << "\thave masks: input=" << image.hasAlpha ()
+              << " output=" << retImage.hasAlpha ()
+              << endl;
+#endif
 
-
-    return retPixmap;
+    return retImage;
 }
 
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic