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

List:       kde-commits
Subject:    koffice/krita
From:       Lukáš Tvrdý <lukast.dev () gmail ! com>
Date:       2010-02-03 8:09:49
Message-ID: 1265184589.230093.17360.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1084448 by lukast:

Do not use interpolation for mask generation as it is slow then directly compute \
non-integer values. This speed up the painting with auto brush 4 times

Interpolation was completly removed as it is not needed anymore.

 M  +0 -20     image/kis_base_mask_generator.cpp  
 M  +0 -2      image/kis_base_mask_generator.h  
 M  +1 -1      image/kis_convolution_kernel.cc  
 M  +1 -1      plugins/paintops/libbrush/kis_auto_brush.cpp  


--- trunk/koffice/krita/image/kis_base_mask_generator.cpp #1084447:1084448
@@ -100,26 +100,6 @@
     }
 }
 
-quint8 KisMaskGenerator::interpolatedValueAt(double x, double y)
-{
-    double x_i = floor(x);
-    double x_f = x - x_i;
-    if (x_f < 0.0) {
-        x_f *= -1.0;
-    }
-    double x_f_r = 1.0 - x_f;
-    double y_i = floor(y);
-    double y_f = fabs(y - y_i);
-    if (y_f < 0.0) {
-        y_f *= -1.0;
-    }
-    double y_f_r = 1.0 - y_f;
-    return (x_f_r * y_f_r * valueAt(x_i , y_i) +
-            x_f   * y_f_r * valueAt(x_i + 1, y_i) +
-            x_f_r * y_f   * valueAt(x_i,  y_i + 1) +
-            x_f   * y_f   * valueAt(x_i + 1,  y_i + 1));
-}
-
 double KisMaskGenerator::width() const
 {
     return d->m_radius;
--- trunk/koffice/krita/image/kis_base_mask_generator.h #1084447:1084448
@@ -59,8 +59,6 @@
      */
     virtual quint8 valueAt(qreal x, qreal y) const = 0;
 
-    quint8 interpolatedValueAt(qreal x, qreal y);
-
     virtual void toXML(QDomDocument& , QDomElement&) const;
 
     /**
--- trunk/koffice/krita/image/kis_convolution_kernel.cc #1084447:1084448
@@ -129,7 +129,7 @@
             double x = cosa * x_ - sina * y_;
             double y = sina * x_ + cosa * y_;
 //             dbgImage << ppVar(x) << ppVar(y) << ppVar(x_) << ppVar(y_) << ppVar( \
                kmg->interpolatedValueAt( x,y) );
-            uint value = 255 - kmg->interpolatedValueAt(x, y);
+            uint value = 255 - kmg->valueAt(x, y);
             data(r, c) = value;
             factor += value;
         }
--- trunk/koffice/krita/plugins/paintops/libbrush/kis_auto_brush.cpp #1084447:1084448
@@ -135,7 +135,7 @@
                     coloringInformation->nextColumn();
                 }
             }
-            cs->setAlpha(dabPointer, OPACITY_OPAQUE - \
d->shape->interpolatedValueAt(maskX, maskY), 1); +            \
cs->setAlpha(dabPointer, OPACITY_OPAQUE - d->shape->valueAt(maskX, maskY), 1);  \
dabPointer += pixelSize;  }
         if (!color && coloringInformation) {


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

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