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

List:       kde-commits
Subject:    [krita] plugins/filters: Remove old edge detection and brightness/cntrast filter.
From:       Wolthera_van_Hövell_tot_Westerflier <null () kde ! org>
Date:       2017-12-31 12:19:13
Message-ID: E1eVca9-0002u3-OU () code ! kde ! org
[Download RAW message or body]

Git commit e28531577c28ead0d63fe4b44e4ea53e078b6eba by Wolthera van Hövell tot \
Westerflier. Committed on 31/12/2017 at 12:17.
Pushed by woltherav into branch 'master'.

Remove old edge detection and brightness/cntrast filter.

The brightness/contrast filter is now converted to a color adjustment filter,
and the edge detection filters are replaced with the new unified edge detection
filter. Revert this commit if the conversion code somehow doesn't work.

M  +0    -1    plugins/filters/CMakeLists.txt
M  +0    -2    plugins/filters/colorsfilters/CMakeLists.txt
M  +0    -1    plugins/filters/colorsfilters/colorsfilters.cpp
D  +0    -302  plugins/filters/colorsfilters/kis_brightness_contrast_filter.cpp
D  +0    -116  plugins/filters/colorsfilters/kis_brightness_contrast_filter.h
D  +0    -291  plugins/filters/colorsfilters/wdg_brightness_contrast.ui
M  +0    -64   plugins/filters/convolutionfilters/convolutionfilters.cpp
M  +0    -41   plugins/filters/convolutionfilters/convolutionfilters.h
D  +0    -4    plugins/filters/sobelfilter/CMakeLists.txt
D  +0    -175  plugins/filters/sobelfilter/kis_sobel_filter.cpp
D  +0    -48   plugins/filters/sobelfilter/kis_sobel_filter.h
D  +0    -41   plugins/filters/sobelfilter/kis_sobel_filter_plugin.cpp
D  +0    -34   plugins/filters/sobelfilter/kis_sobel_filter_plugin.h
D  +0    -9    plugins/filters/sobelfilter/kritasobelfilter.json

https://commits.kde.org/krita/e28531577c28ead0d63fe4b44e4ea53e078b6eba

diff --git a/plugins/filters/CMakeLists.txt b/plugins/filters/CMakeLists.txt
index 8f16508e751..b8fbbf50ef0 100644
--- a/plugins/filters/CMakeLists.txt
+++ b/plugins/filters/CMakeLists.txt
@@ -14,7 +14,6 @@ add_subdirectory( raindropsfilter )
 add_subdirectory( randompickfilter )
 add_subdirectory( roundcorners )
 add_subdirectory( smalltilesfilter )
-add_subdirectory( sobelfilter )
 add_subdirectory( unsharp )
 add_subdirectory( wavefilter )
 add_subdirectory( levelfilter )
diff --git a/plugins/filters/colorsfilters/CMakeLists.txt \
b/plugins/filters/colorsfilters/CMakeLists.txt index 64c32d952d1..90784342c73 100644
--- a/plugins/filters/colorsfilters/CMakeLists.txt
+++ b/plugins/filters/colorsfilters/CMakeLists.txt
@@ -3,7 +3,6 @@ set(kritacolorsfilters_SOURCES
     kis_hsv_adjustment_filter.cpp
     virtual_channel_info.cpp
     kis_perchannel_filter.cpp
-    kis_brightness_contrast_filter.cpp
     kis_color_balance_filter.cpp
     kis_desaturate_filter.cpp
     )
@@ -11,7 +10,6 @@ set(kritacolorsfilters_SOURCES
 ki18n_wrap_ui(kritacolorsfilters_SOURCES
     wdg_perchannel.ui
     wdg_color_balance.ui
-    wdg_brightness_contrast.ui
     wdg_hsv_adjustment.ui
     wdg_desaturate.ui
 )
diff --git a/plugins/filters/colorsfilters/colorsfilters.cpp \
b/plugins/filters/colorsfilters/colorsfilters.cpp index 937dc2a09c4..441fb0a787e \
                100644
--- a/plugins/filters/colorsfilters/colorsfilters.cpp
+++ b/plugins/filters/colorsfilters/colorsfilters.cpp
@@ -68,7 +68,6 @@ ColorsFilters::ColorsFilters(QObject *parent, const QVariantList &)
         : QObject(parent)
 {
     KisFilterRegistry * manager = KisFilterRegistry::instance();
-    manager->add(new KisBrightnessContrastFilter());
     manager->add(new KisAutoContrast());
     manager->add(new KisPerChannelFilter());
     manager->add(new KisDesaturateFilter());
diff --git a/plugins/filters/colorsfilters/kis_brightness_contrast_filter.cpp \
b/plugins/filters/colorsfilters/kis_brightness_contrast_filter.cpp deleted file mode \
100644 index c8f9da8d15b..00000000000
--- a/plugins/filters/colorsfilters/kis_brightness_contrast_filter.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * This file is part of Krita
- *
- * Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
-  * Copyright (c) 2005 C. Boemann <cbo@boemann.dk>
-*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_brightness_contrast_filter.h"
-
-#include <math.h>
-
-#include <klocalizedstring.h>
-
-#include <QLayout>
-#include <QPixmap>
-#include <QPainter>
-#include <QLabel>
-#include <QDomDocument>
-#include <QString>
-#include <QStringList>
-#include <QPushButton>
-#include <QHBoxLayout>
-#include <QColor>
-
-#include "KoBasicHistogramProducers.h"
-#include "KoColorSpace.h"
-#include "KoColorTransformation.h"
-#include "KoCompositeOp.h"
-
-#include <KoToolManager.h>
-
-#include "kis_config_widget.h"
-
-#include "kis_bookmarked_configuration_manager.h"
-#include "kis_paint_device.h"
-#include "widgets/kis_curve_widget.h"
-#include "kis_histogram.h"
-#include "kis_painter.h"
-#include <KisViewManager.h>
-#include <KoColor.h>
-#include <kis_canvas_resource_provider.h>
-
-KisBrightnessContrastFilterConfiguration::KisBrightnessContrastFilterConfiguration()
-        : KisColorTransformationConfiguration("brightnesscontrast", 1)
-{
-}
-
-KisBrightnessContrastFilterConfiguration::~KisBrightnessContrastFilterConfiguration()
                
-{
-}
-
-void KisBrightnessContrastFilterConfiguration::fromLegacyXML(const QDomElement& \
                root)
-{
-    fromXML(root);
-}
-
-void KisBrightnessContrastFilterConfiguration::updateTransfer()
-{
-    m_transfer = m_curve.uint16Transfer();
-}
-
-void KisBrightnessContrastFilterConfiguration::setCurve(const KisCubicCurve &curve)
-{
-    m_curve = curve;
-    updateTransfer();
-}
-
-const QVector<quint16>& KisBrightnessContrastFilterConfiguration::transfer() const
-{
-    return m_transfer;
-}
-
-const KisCubicCurve& KisBrightnessContrastFilterConfiguration::curve() const
-{
-    return m_curve;
-}
-
-void KisBrightnessContrastFilterConfiguration::fromXML(const QDomElement& root)
-{
-    KisCubicCurve curve;
-    int version;
-    version  = root.attribute("version").toInt();
-
-    QDomElement e = root.firstChild().toElement();
-    QString attributeName;
-
-    while (!e.isNull()) {
-        if ((attributeName = e.attribute("name")) != "nTransfers") {
-            QRegExp rx("curve(\\d+)");
-            if (rx.indexIn(attributeName, 0) != -1) {
-                quint16 index = rx.cap(1).toUShort();
-
-                if (index == 0 && !e.text().isEmpty()) {
-                    /**
-                     * We are going to use first curve only
-                     */
-                    curve.fromString(e.text());
-                }
-            }
-        }
-        e = e.nextSiblingElement();
-    }
-
-    setVersion(version);
-    setCurve(curve);
-}
-
-/**
- * Inherited from KisPropertiesConfiguration
- */
-//void KisPerChannelFilterConfiguration::fromXML(const QString& s)
-
-void KisBrightnessContrastFilterConfiguration::toXML(QDomDocument& doc, QDomElement& \
                root) const
-{
-    /**
-     * <params version=1>
-     *       <param name="nTransfers">1</param>
-     *       <param name="curve0">0,0;0.5,0.5;1,1;</param>
-     * </params>
-     */
-
-    /* This is a constant for Brightness/Contranst filter */
-    const qint32 numTransfers = 1;
-
-
-    root.setAttribute("version", version());
-
-    QDomElement t = doc.createElement("param");
-    QDomText text = doc.createTextNode(QString::number(numTransfers));
-    t.setAttribute("name", "nTransfers");
-    t.appendChild(text);
-    root.appendChild(t);
-
-    t = doc.createElement("param");
-    t.setAttribute("name", "curve0");
-
-    text = doc.createTextNode(m_curve.toString());
-    t.appendChild(text);
-    root.appendChild(t);
-}
-
-/**
- * Inherited from KisPropertiesConfiguration
- */
-//QString KisPerChannelFilterConfiguration::toXML()
-
-
-KisBrightnessContrastFilter::KisBrightnessContrastFilter()
-        : KisColorTransformationFilter(id(), categoryAdjust(), \
                i18n("&Brightness/Contrast curve..."))
-{
-    setSupportsPainting(false);
-    setColorSpaceIndependence(TO_LAB16);
-}
-
-KisConfigWidget * KisBrightnessContrastFilter::createConfigurationWidget(QWidget \
                *parent, const KisPaintDeviceSP dev) const
-{
-    return new KisBrightnessContrastConfigWidget(parent, dev);
-}
-
-KisFilterConfigurationSP KisBrightnessContrastFilter::factoryConfiguration()
-const
-{
-    return new KisBrightnessContrastFilterConfiguration();
-}
-
-KoColorTransformation* KisBrightnessContrastFilter::createTransformation(const \
                KoColorSpace* cs, const KisFilterConfigurationSP config) const
-{
-    const KisBrightnessContrastFilterConfiguration* configBC = dynamic_cast<const \
                KisBrightnessContrastFilterConfiguration*>(config.data());
-    if (!configBC) return 0;
-
-    KoColorTransformation * adjustment = \
                cs->createBrightnessContrastAdjustment(configBC->transfer().constData());
                
-    return adjustment;
-}
-
-KisBrightnessContrastConfigWidget::KisBrightnessContrastConfigWidget(QWidget * \
                parent, KisPaintDeviceSP dev, Qt::WindowFlags f)
-        : KisConfigWidget(parent, f)
-{
-    int i;
-    int height;
-    m_page = new WdgBrightnessContrast(this);
-    QHBoxLayout * l = new QHBoxLayout(this);
-    Q_CHECK_PTR(l);
-
-    //Hide these buttons and labels as they are not implemented in 1.5
-    m_page->pb_more_contrast->hide();
-    m_page->pb_less_contrast->hide();
-    m_page->pb_more_brightness->hide();
-    m_page->pb_less_brightness->hide();
-    m_page->textLabelBrightness->hide();
-    m_page->textLabelContrast->hide();
-
-    l->addWidget(m_page, 1, Qt::AlignTop);
-    l->setContentsMargins(0,0,0,0);
-
-    height = 256;
-    connect(m_page->curveWidget, SIGNAL(modified()), \
                SIGNAL(sigConfigurationItemChanged()));
-
-    // Create the horizontal gradient label
-    QPixmap hgradientpix(256, 1);
-    QPainter hgp(&hgradientpix);
-    hgp.setPen(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
-    for (i = 0; i < 256; ++i) {
-        hgp.setPen(QColor(i, i, i));
-        hgp.drawPoint(i, 0);
-    }
-    m_page->hgradient->setPixmap(hgradientpix);
-
-    // Create the vertical gradient label
-    QPixmap vgradientpix(1, 256);
-    QPainter vgp(&vgradientpix);
-    vgp.setPen(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
-    for (i = 0; i < 256; ++i) {
-        vgp.setPen(QColor(i, i, i));
-        vgp.drawPoint(0, 255 - i);
-    }
-    m_page->vgradient->setPixmap(vgradientpix);
-
-    KoHistogramProducer *producer = new KoGenericLabHistogramProducer();
-    KisHistogram histogram(dev, dev->exactBounds(), producer, LINEAR);
-
-    QPalette appPalette = QApplication::palette();
-    QPixmap pix(256, height);
-    pix.fill(QColor(appPalette.color(QPalette::Base)));
-
-    QPainter p(&pix);
-    p.setPen(QPen(Qt::gray, 1, Qt::SolidLine));
-
-    double highest = (double)histogram.calculations().getHighest();
-    qint32 bins = histogram.producer()->numberOfBins();
-
-    if (histogram.getHistogramType() == LINEAR) {
-        double factor = (double)height / highest;
-        for (i = 0; i < bins; ++i) {
-            p.drawLine(i, height, i, height - int(histogram.getValue(i) * factor));
-        }
-    } else {
-        double factor = (double)height / (double)log(highest);
-        for (i = 0; i < bins; ++i) {
-            p.drawLine(i, height, i, height - int(log((double)histogram.getValue(i)) \
                * factor));
-        }
-    }
-
-    m_page->curveWidget->setPixmap(pix);
-    m_page->curveWidget->setBasePixmap(pix);
-}
-
-KisBrightnessContrastConfigWidget::~KisBrightnessContrastConfigWidget()
-{
-    KoToolManager::instance()->switchBackRequested();
-    delete m_page;
-}
-
-KisPropertiesConfigurationSP KisBrightnessContrastConfigWidget::configuration() \
                const
-{
-    KisBrightnessContrastFilterConfiguration * cfg = new \
                KisBrightnessContrastFilterConfiguration();
-    cfg->setCurve(m_page->curveWidget->curve());
-    return cfg;
-}
-
-void KisBrightnessContrastConfigWidget::slotDrawLine(const KoColor &color)
-{
-    QColor colorNew = color.toQColor();
-    int i = (colorNew.red() + colorNew.green() + colorNew.blue())/3 ;
-    QPixmap pix = m_page->curveWidget->getBasePixmap();
-    QPainter p(&pix);
-    p.setPen(QPen(Qt::black, 1, Qt::SolidLine));
-    p.drawLine(i,0,i,255);
-    QString label = "x:";
-    label.insert(2,QString(QString::number(i)));
-    p.drawText(i,250,label);
-    m_page->curveWidget->setPixmap(pix);
-}
-
-void KisBrightnessContrastConfigWidget::setView(KisViewManager *view)
-{
-    connect(view->resourceProvider(), SIGNAL(sigFGColorChanged(const KoColor&)), \
                this, SLOT(slotDrawLine(const KoColor&)));
-    KoToolManager::instance()->switchToolTemporaryRequested("KritaSelected/KisToolColorPicker");
                
-}
-
-void KisBrightnessContrastConfigWidget::setConfiguration(const \
                KisPropertiesConfigurationSP  config)
-{
-    const KisBrightnessContrastFilterConfiguration * cfg = dynamic_cast<const \
                KisBrightnessContrastFilterConfiguration *>(config.data());
-    Q_ASSERT(cfg);
-    m_page->curveWidget->setCurve(cfg->curve());
-}
-
-
-
diff --git a/plugins/filters/colorsfilters/kis_brightness_contrast_filter.h \
b/plugins/filters/colorsfilters/kis_brightness_contrast_filter.h deleted file mode \
100644 index 955d9cfc7ce..00000000000
--- a/plugins/filters/colorsfilters/kis_brightness_contrast_filter.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of Krita
- *
- * Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_BRIGHTNESS_CONTRAST_FILTER_H_
-#define _KIS_BRIGHTNESS_CONTRAST_FILTER_H_
-
-#include <QList>
-
-#include "filter/kis_color_transformation_filter.h"
-#include "kis_config_widget.h"
-#include "ui_wdg_brightness_contrast.h"
-#include <filter/kis_color_transformation_configuration.h>
-#include <kis_selection.h>
-#include <kis_paint_device.h>
-#include <kis_processing_information.h>
-#include <KoColor.h>
-
-class QWidget;
-class KoColorTransformation;
-
-class WdgBrightnessContrast : public QWidget, public Ui::WdgBrightnessContrast
-{
-    Q_OBJECT
-
-public:
-    WdgBrightnessContrast(QWidget *parent) : QWidget(parent) {
-        setupUi(this);
-    }
-};
-
-class KisBrightnessContrastFilterConfiguration : public \
                KisColorTransformationConfiguration
-{
-
-public:
-    using KisFilterConfiguration::fromXML;
-    using KisFilterConfiguration::toXML;
-    using KisFilterConfiguration::fromLegacyXML;
-
-    void fromLegacyXML(const QDomElement& root) override;
-
-    void fromXML(const QDomElement& e) override;
-    void toXML(QDomDocument& doc, QDomElement& root) const override;
-
-    KisBrightnessContrastFilterConfiguration();
-    ~KisBrightnessContrastFilterConfiguration() override;
-
-    void setCurve(const KisCubicCurve &curve) override;
-
-    const QVector<quint16>& transfer() const;
-    const KisCubicCurve& curve() const override;
-
-private:
-    void updateTransfer();
-
-private:
-    KisCubicCurve m_curve;
-    QVector<quint16> m_transfer;
-};
-
-/**
- * This class affect Intensity Y of the image
- */
-class KisBrightnessContrastFilter : public KisColorTransformationFilter
-{
-
-public:
-
-    KisBrightnessContrastFilter();
-
-public:
-
-    KoColorTransformation* createTransformation(const KoColorSpace* cs, const \
                KisFilterConfigurationSP config) const override;
-
-    static inline KoID id() {
-        return KoID("brightnesscontrast", i18n("Brightness / Contrast"));
-    }
-    KisFilterConfigurationSP factoryConfiguration() const override;
-
-    KisConfigWidget * createConfigurationWidget(QWidget* parent, const \
                KisPaintDeviceSP dev) const override;
-};
-
-
-class KisBrightnessContrastConfigWidget : public KisConfigWidget
-{
-    Q_OBJECT
-public:
-    KisBrightnessContrastConfigWidget(QWidget * parent, KisPaintDeviceSP dev, \
                Qt::WindowFlags f = 0);
-    ~KisBrightnessContrastConfigWidget() override;
-
-    KisPropertiesConfigurationSP configuration() const override;
-    void setConfiguration(const KisPropertiesConfigurationSP config) override;
-    WdgBrightnessContrast * m_page;
-    void setView(KisViewManager *view) override;
-
-public Q_SLOTS:
-    void slotDrawLine(const KoColor &color);
-};
-
-#endif
diff --git a/plugins/filters/colorsfilters/wdg_brightness_contrast.ui \
b/plugins/filters/colorsfilters/wdg_brightness_contrast.ui deleted file mode 100644
index ef1d33d384d..00000000000
--- a/plugins/filters/colorsfilters/wdg_brightness_contrast.ui
+++ /dev/null
@@ -1,291 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>WdgBrightnessContrast</class>
- <widget class="QWidget" name="WdgBrightnessContrast">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>318</width>
-    <height>379</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="windowTitle">
-   <string>BrightnessCon</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="horizontalSpacing">
-    <number>0</number>
-   </property>
-   <property name="verticalSpacing">
-    <number>6</number>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="2" column="1" colspan="2">
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::MinimumExpanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>9</width>
-       <height>9</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="3">
-    <spacer name="horizontalSpacer_2">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="0">
-    <spacer name="horizontalSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="1" colspan="2">
-    <layout class="QGridLayout">
-     <property name="sizeConstraint">
-      <enum>QLayout::SetDefaultConstraint</enum>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <property name="spacing">
-      <number>0</number>
-     </property>
-     <item row="1" column="1">
-      <widget class="QLabel" name="hgradient">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="minimumSize">
-        <size>
-         <width>256</width>
-         <height>20</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>256</width>
-         <height>20</height>
-        </size>
-       </property>
-       <property name="frameShape">
-        <enum>QFrame::Panel</enum>
-       </property>
-       <property name="frameShadow">
-        <enum>QFrame::Sunken</enum>
-       </property>
-       <property name="scaledContents">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QFrame" name="frame3">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="minimumSize">
-        <size>
-         <width>256</width>
-         <height>256</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>256</width>
-         <height>256</height>
-        </size>
-       </property>
-       <property name="frameShape">
-        <enum>QFrame::Panel</enum>
-       </property>
-       <property name="frameShadow">
-        <enum>QFrame::Sunken</enum>
-       </property>
-       <layout class="QVBoxLayout">
-        <property name="spacing">
-         <number>0</number>
-        </property>
-        <property name="margin">
-         <number>0</number>
-        </property>
-        <item>
-         <widget class="KisCurveWidget" name="curveWidget">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="minimumSize">
-           <size>
-            <width>256</width>
-            <height>256</height>
-           </size>
-          </property>
-          <property name="maximumSize">
-           <size>
-            <width>256</width>
-            <height>256</height>
-           </size>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item row="0" column="0">
-      <widget class="QLabel" name="vgradient">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="minimumSize">
-        <size>
-         <width>20</width>
-         <height>256</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>20</width>
-         <height>256</height>
-        </size>
-       </property>
-       <property name="frameShape">
-        <enum>QFrame::Panel</enum>
-       </property>
-       <property name="frameShadow">
-        <enum>QFrame::Sunken</enum>
-       </property>
-       <property name="scaledContents">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="1" column="1" colspan="2">
-    <layout class="QGridLayout">
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item row="1" column="0">
-      <widget class="QPushButton" name="pb_less_contrast">
-       <property name="text">
-        <string>-</string>
-       </property>
-       <property name="shortcut">
-        <string/>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLabel" name="textLabelBrightness">
-       <property name="text">
-        <string>Brightness</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignCenter</set>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="2">
-      <widget class="QPushButton" name="pb_more_contrast">
-       <property name="text">
-        <string>+</string>
-       </property>
-       <property name="shortcut">
-        <string/>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="QLabel" name="textLabelContrast">
-       <property name="text">
-        <string>Contrast</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignCenter</set>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="2">
-      <widget class="QPushButton" name="pb_more_brightness">
-       <property name="text">
-        <string>+</string>
-       </property>
-       <property name="shortcut">
-        <string/>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="0">
-      <widget class="QPushButton" name="pb_less_brightness">
-       <property name="text">
-        <string>-</string>
-       </property>
-       <property name="shortcut">
-        <string/>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KisCurveWidget</class>
-   <extends></extends>
-   <header>widgets/kis_curve_widget.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/plugins/filters/convolutionfilters/convolutionfilters.cpp \
b/plugins/filters/convolutionfilters/convolutionfilters.cpp index \
                d2f4d94eecc..2121cf7454e 100644
--- a/plugins/filters/convolutionfilters/convolutionfilters.cpp
+++ b/plugins/filters/convolutionfilters/convolutionfilters.cpp
@@ -49,11 +49,6 @@ KritaConvolutionFilters::KritaConvolutionFilters(QObject *parent, \
const QVariant  manager->add(new KisEmbossHorizontalVerticalFilter());
     manager->add(new KisEmbossVerticalFilter());
     manager->add(new KisEmbossHorizontalFilter());
-    manager->add(new KisTopEdgeDetectionFilter());
-    manager->add(new KisRightEdgeDetectionFilter());
-    manager->add(new KisBottomEdgeDetectionFilter());
-    manager->add(new KisLeftEdgeDetectionFilter());
-
 }
 
 KritaConvolutionFilters::~KritaConvolutionFilters()
@@ -178,63 +173,4 @@ KisEmbossDiagonalFilter::KisEmbossDiagonalFilter()
     setIgnoreAlpha(true);
 }
 
-
-KisTopEdgeDetectionFilter::KisTopEdgeDetectionFilter()
-        : KisConvolutionFilter(id(), categoryEdgeDetection(), i18n("Top Edge \
                Detection"))
-{
-    setSupportsPainting(false);
-    setShowConfigurationWidget(false);
-
-    Eigen::Matrix<qreal, Eigen::Dynamic, Eigen::Dynamic> kernelMatrix(3, 3);
-    kernelMatrix <<  1,  1,  1,
-                     0,  0,  0,
-                    -1, -1, -1;
-
-    m_matrix = KisConvolutionKernel::fromMatrix(kernelMatrix, 0.5, 1);
-    setIgnoreAlpha(true);
-}
-
-KisRightEdgeDetectionFilter::KisRightEdgeDetectionFilter()
-        : KisConvolutionFilter(id(), categoryEdgeDetection(), i18n("Right Edge \
                Detection"))
-{
-    setSupportsPainting(false);
-    setShowConfigurationWidget(false);
-
-    Eigen::Matrix<qreal, Eigen::Dynamic, Eigen::Dynamic> kernelMatrix(3, 3);
-    kernelMatrix << -1, 0, 1,
-                    -1, 0, 1,
-                    -1, 0, 1;
-
-    m_matrix = KisConvolutionKernel::fromMatrix(kernelMatrix, 0.5, 1);
-    setIgnoreAlpha(true);
-}
-
-KisBottomEdgeDetectionFilter::KisBottomEdgeDetectionFilter() : \
                KisConvolutionFilter(id(), categoryEdgeDetection(), i18n("Bottom Edge \
                Detection"))
-{
-    setSupportsPainting(false);
-    setShowConfigurationWidget(false);
-
-    Eigen::Matrix<qreal, Eigen::Dynamic, Eigen::Dynamic> kernelMatrix(3, 3);
-    kernelMatrix << -1, -1, -1,
-                     0,  0,  0,
-                     1,  1,  1;
-
-    m_matrix = KisConvolutionKernel::fromMatrix(kernelMatrix, 0.5, 1);
-    setIgnoreAlpha(true);
-}
-
-KisLeftEdgeDetectionFilter::KisLeftEdgeDetectionFilter() : \
                KisConvolutionFilter(id(), categoryEdgeDetection(), i18n("Left Edge \
                Detection"))
-{
-    setSupportsPainting(false);
-    setShowConfigurationWidget(false);
-
-    Eigen::Matrix<qreal, Eigen::Dynamic, Eigen::Dynamic> kernelMatrix(3, 3);
-    kernelMatrix << 1, 0, -1,
-                    1, 0, -1,
-                    1, 0, -1;
-
-    m_matrix = KisConvolutionKernel::fromMatrix(kernelMatrix, 0.5, 1);
-    setIgnoreAlpha(true);
-}
-
 #include "convolutionfilters.moc"
diff --git a/plugins/filters/convolutionfilters/convolutionfilters.h \
b/plugins/filters/convolutionfilters/convolutionfilters.h index \
                6e12664e3df..5eff11be63f 100644
--- a/plugins/filters/convolutionfilters/convolutionfilters.h
+++ b/plugins/filters/convolutionfilters/convolutionfilters.h
@@ -106,47 +106,6 @@ public:
     }
 };
 
-class KisTopEdgeDetectionFilter : public KisConvolutionFilter
-{
-public:
-    KisTopEdgeDetectionFilter();
-public:
-    static inline KoID id() {
-        return KoID("top edge detections", i18n("Top Edge Detection"));
-    }
-};
-
-class KisRightEdgeDetectionFilter : public KisConvolutionFilter
-{
-public:
-    KisRightEdgeDetectionFilter();
-public:
-    static inline KoID id() {
-        return KoID("right edge detections", i18n("Right Edge Detection"));
-    }
-};
-
-class KisBottomEdgeDetectionFilter : public KisConvolutionFilter
-{
-public:
-    KisBottomEdgeDetectionFilter();
-public:
-    static inline KoID id() {
-        return KoID("bottom edge detections", i18n("Bottom Edge Detection"));
-    }
-};
-
-class KisLeftEdgeDetectionFilter : public KisConvolutionFilter
-{
-public:
-    KisLeftEdgeDetectionFilter();
-public:
-    static inline KoID id() {
-        return KoID("left edge detections", i18n("Left Edge Detection"));
-    }
-};
-
-
 class KritaConvolutionFilters : public QObject
 {
     Q_OBJECT
diff --git a/plugins/filters/sobelfilter/CMakeLists.txt \
b/plugins/filters/sobelfilter/CMakeLists.txt deleted file mode 100644
index 8df05e8f563..00000000000
--- a/plugins/filters/sobelfilter/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(kritasobelfilter_SOURCES kis_sobel_filter_plugin.cpp kis_sobel_filter.cpp )
-add_library(kritasobelfilter MODULE ${kritasobelfilter_SOURCES})
-target_link_libraries(kritasobelfilter kritaui)
-install(TARGETS kritasobelfilter  DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
diff --git a/plugins/filters/sobelfilter/kis_sobel_filter.cpp \
b/plugins/filters/sobelfilter/kis_sobel_filter.cpp deleted file mode 100644
index b572fc7f8b8..00000000000
--- a/plugins/filters/sobelfilter/kis_sobel_filter.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * This file is part of Krita
- *
- * Copyright (c) 2005 Michael Thaler <michael.thaler@physik.tu-muenchen.de>
- *
- * ported from Gimp, Copyright (C) 1997 Eiichi Takamori <taka@ma1.seikyou.ne.jp>
- * original pixelize.c for GIMP 0.54 by Tracy Scott
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_sobel_filter.h"
-
-#include <stdlib.h>
-#include <vector>
-
-#include <QPoint>
-#include <QSpinBox>
-#include <KoUpdater.h>
-#include <klocalizedstring.h>
-#include <kis_debug.h>
-#include <kpluginfactory.h>
-
-#include <KisDocument.h>
-#include <kis_image.h>
-#include <kis_layer.h>
-#include <filter/kis_filter_registry.h>
-#include <kis_global.h>
-#include <kis_selection.h>
-#include <kis_types.h>
-#include <kis_paint_device.h>
-#include <filter/kis_filter_configuration.h>
-#include <kis_processing_information.h>
-#include <widgets/kis_multi_bool_filter_widget.h>
-#include <kis_iterator_ng.h>
-
-KisSobelFilter::KisSobelFilter() : KisFilter(id(), categoryEdgeDetection(), \
                i18n("&Sobel..."))
-{
-    setSupportsPainting(false);
-    setSupportsThreading(false); // TODO Sobel doesn't support threading on image \
                with height > 512
-    setSupportsAdjustmentLayers(false);
-}
-
-
-void KisSobelFilter::prepareRow(KisPaintDeviceSP src, quint8* data, quint32 x, \
                quint32 y, quint32 w) const
-{
-    quint32 pixelSize = src->pixelSize();
-
-    src->readBytes(data, x, y, w, 1);
-
-    for (quint32 b = 0; b < pixelSize; b++) {
-        int offset = pixelSize - b;
-        data[-offset] = data[b];
-        data[w * pixelSize + b] = data[(w - 1) * pixelSize + b];
-    }
-}
-
-#define RMS(a, b) (sqrt ((qreal)(a) * (a) + (b) * (b)))
-#define ROUND(x) ((int) ((x) + 0.5))
-
-void KisSobelFilter::processImpl(KisPaintDeviceSP device,
-                                 const QRect& applyRect,
-                                 const KisFilterConfigurationSP configuration,
-                                 KoUpdater* progressUpdater
-                                 ) const
-{
-    QPoint srcTopLeft = applyRect.topLeft();
-    Q_ASSERT(!device.isNull());
-
-    //read the filter configuration values from the KisFilterConfiguration object
-    bool doHorizontal = configuration->getBool("doHorizontally", true);
-    bool doVertical = configuration->getBool("doVertically", true);
-    bool keepSign = configuration->getBool("keepSign", true);
-    bool makeOpaque = configuration->getBool("makeOpaque", true);
-
-    const quint32 width = applyRect.width();
-    const quint32 height = applyRect.height();
-    const quint32 pixelSize = device->pixelSize();
-
-    /*  allocate row buffers  */
-    quint8* prevRow = new quint8[(width + 2) * pixelSize];
-    quint8* curRow = new quint8[(width + 2) * pixelSize];
-    quint8* nextRow = new quint8[(width + 2) * pixelSize];
-    quint8* dest = new quint8[width  * pixelSize];
-
-    quint8* pr = prevRow + pixelSize;
-    quint8* cr = curRow + pixelSize;
-    quint8* nr = nextRow + pixelSize;
-
-    prepareRow(device, pr, srcTopLeft.x(), srcTopLeft.y() - 1, width);
-    prepareRow(device, cr, srcTopLeft.x(), srcTopLeft.y(), width);
-
-    quint32 counter = 0;
-    quint8* d;
-    quint8* tmp;
-    qint32 gradient, horGradient, verGradient;
-
-    // loop through the rows, applying the sobel convolution
-
-    KisHLineIteratorSP dstIt = device->createHLineIteratorNG(srcTopLeft.x(), \
                srcTopLeft.y(), width);
-
-    for (quint32 row = 0; row < height; row++) {
-
-        // prepare the next row
-        prepareRow(device, nr, srcTopLeft.x(), srcTopLeft.y() + row + 1, width);
-        d = dest;
-        memset(d, 0, width * pixelSize);
-
-        for (quint32 col = 0; col < width * pixelSize; col++) {
-            int positive = col + pixelSize;
-            int negative = col - pixelSize;
-            horGradient = (doHorizontal ?
-                           ((pr[negative] +  2 * pr[col] + pr[positive]) -
-                            (nr[negative] + 2 * nr[col] + nr[positive]))
-                           : 0);
-
-            verGradient = (doVertical ?
-                           ((pr[negative] + 2 * cr[negative] + nr[negative]) -
-                            (pr[positive] + 2 * cr[positive] + nr[positive]))
-                           : 0);
-            gradient = (qint32)((doVertical && doHorizontal) ?
-                                (ROUND(RMS(horGradient, verGradient)) / 5.66)   // \
                always >0
-                                : (keepSign ? (127 + (ROUND((horGradient + \
                verGradient) / 8.0)))
-                                   : (ROUND(qAbs(horGradient + verGradient) / \
                4.0))));
-
-            *d++ = gradient;
-            if (gradient > 10) counter ++;
-        }
-
-        //  shuffle the row pointers
-        tmp = pr;
-        pr = cr;
-        cr = nr;
-        nr = tmp;
-
-        //store the dest
-        device->writeBytes(dest, srcTopLeft.x(), srcTopLeft.y() + row, width, 1);
-
-        if (makeOpaque) {
-            do {
-                device->colorSpace()->setOpacity(dstIt->rawData(), \
                OPACITY_OPAQUE_U8, 1);
-            } while(dstIt->nextPixel());
-            dstIt->nextRow();
-        }
-        if (progressUpdater) progressUpdater->setProgress(row / height);
-    }
-
-    delete[] prevRow;
-    delete[] curRow;
-    delete[] nextRow;
-    delete[] dest;
-}
-
-
-KisConfigWidget * KisSobelFilter::createConfigurationWidget(QWidget* parent, const \
                KisPaintDeviceSP) const
-{
-    vKisBoolWidgetParam param;
-    param.push_back(KisBoolWidgetParam(true, i18n("Sobel horizontally"), \
                "doHorizontally"));
-    param.push_back(KisBoolWidgetParam(true, i18n("Sobel vertically"), \
                "doVertically"));
-    param.push_back(KisBoolWidgetParam(true, i18n("Keep sign of result"), \
                "keepSign"));
-    param.push_back(KisBoolWidgetParam(false, i18n("Make image opaque"), \
                "makeOpaque"));
-    return new KisMultiBoolFilterWidget(id().id(), parent, id().id(), param);
-}
diff --git a/plugins/filters/sobelfilter/kis_sobel_filter.h \
b/plugins/filters/sobelfilter/kis_sobel_filter.h deleted file mode 100644
index 048c518e4a2..00000000000
--- a/plugins/filters/sobelfilter/kis_sobel_filter.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of the KDE project
- *
- * Copyright (c) Michael Thaler <michael.thaler@physik.tu-muenchen.de>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_SOBEL_FILTER_H_
-#define _KIS_SOBEL_FILTER_H_
-
-#include "filter/kis_filter.h"
-#include "kis_config_widget.h"
-
-class KisSobelFilter : public KisFilter
-{
-public:
-    KisSobelFilter();
-public:
-        void processImpl(KisPaintDeviceSP device,
-                     const QRect& applyRect,
-                     const KisFilterConfigurationSP config,
-                     KoUpdater* progressUpdater
-                     ) const override;
-
-    static inline KoID id() {
-        return KoID("sobel", i18n("Sobel"));
-    }
-
-public:
-    KisConfigWidget * createConfigurationWidget(QWidget* parent, const \
                KisPaintDeviceSP dev) const override;
-private:
-    void prepareRow(const KisPaintDeviceSP src, quint8* data, quint32 x, quint32 y, \
                quint32 w) const;
-};
-
-#endif
diff --git a/plugins/filters/sobelfilter/kis_sobel_filter_plugin.cpp \
b/plugins/filters/sobelfilter/kis_sobel_filter_plugin.cpp deleted file mode 100644
index 0d453e5f040..00000000000
--- a/plugins/filters/sobelfilter/kis_sobel_filter_plugin.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of the KDE project
- *
- * Copyright (c) 2005 Michael Thaler <michael.thaler@physik.tu-muenchen.de>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_sobel_filter_plugin.h"
-
-#include <kpluginfactory.h>
-
-#include "kis_sobel_filter.h"
-#include "filter/kis_filter_registry.h"
-#include "kis_global.h"
-
-K_PLUGIN_FACTORY_WITH_JSON(KisSobelFilterPluginFactory, "kritasobelfilter.json", \
                registerPlugin<KisSobelFilterPlugin>();)
-
-KisSobelFilterPlugin::KisSobelFilterPlugin(QObject *parent, const QVariantList &)
-        : QObject(parent)
-{
-    KisFilterRegistry::instance()->add(new KisSobelFilter());
-}
-
-KisSobelFilterPlugin::~KisSobelFilterPlugin()
-{
-}
-
-#include "kis_sobel_filter_plugin.moc"
diff --git a/plugins/filters/sobelfilter/kis_sobel_filter_plugin.h \
b/plugins/filters/sobelfilter/kis_sobel_filter_plugin.h deleted file mode 100644
index 530316c9ecf..00000000000
--- a/plugins/filters/sobelfilter/kis_sobel_filter_plugin.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of Krita
- *
- * Copyright (c) Michael Thaler <michael.thaler@physik.tu-muenchen.de>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. \
                */
-
-#ifndef _KIS_SOBEL_FILTER_PLUGIN_H_
-#define _KIS_SOBEL_FILTER_PLUGIN_H_
-
-#include <QObject>
-#include <QVariant>
-
-class KisSobelFilterPlugin : public QObject
-{
-    Q_OBJECT
-public:
-    KisSobelFilterPlugin(QObject *parent, const QVariantList &);
-    ~KisSobelFilterPlugin() override;
-};
-
-#endif
diff --git a/plugins/filters/sobelfilter/kritasobelfilter.json \
b/plugins/filters/sobelfilter/kritasobelfilter.json deleted file mode 100644
index 325cc6cff3c..00000000000
--- a/plugins/filters/sobelfilter/kritasobelfilter.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-    "Id": "Sobel Filter",
-    "Type": "Service",
-    "X-KDE-Library": "kritasobelfilter",
-    "X-KDE-ServiceTypes": [
-        "Krita/Filter"
-    ],
-    "X-Krita-Version": "28"
-}


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

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