File indexing completed on 2024-05-12 16:34:29

0001 /* This file is part of the KDE project
0002  * Copyright (c) 2010 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2.1 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef CONVOLVEMATRIXEFFECTCONFIGWIDGET_H
0021 #define CONVOLVEMATRIXEFFECTCONFIGWIDGET_H
0022 
0023 #include "KoFilterEffectConfigWidgetBase.h"
0024 
0025 class QDoubleSpinBox;
0026 class KoFilterEffect;
0027 class ConvolveMatrixEffect;
0028 class KComboBox;
0029 class QSpinBox;
0030 class QCheckBox;
0031 class MatrixDataModel;
0032 
0033 class ConvolveMatrixEffectConfigWidget : public KoFilterEffectConfigWidgetBase
0034 {
0035     Q_OBJECT
0036 public:
0037     explicit ConvolveMatrixEffectConfigWidget(QWidget *parent = 0);
0038 
0039     /// reimplemented from KoFilterEffectConfigWidgetBase
0040     bool editFilterEffect(KoFilterEffect * filterEffect) override;
0041 
0042 private Q_SLOTS:
0043     void orderChanged(int value);
0044     void targetChanged(int value);
0045     void divisorChanged(double divisor);
0046     void biasChanged(double bias);
0047     void edgeModeChanged(int mode);
0048     void preserveAlphaChanged(bool checked);
0049     void editKernel();
0050     void kernelChanged();
0051 private:
0052     ConvolveMatrixEffect * m_effect;
0053     KComboBox * m_edgeMode;
0054     QSpinBox *m_orderX;
0055     QSpinBox *m_orderY;
0056     QSpinBox *m_targetX;
0057     QSpinBox *m_targetY;
0058     QDoubleSpinBox *m_divisor;
0059     QDoubleSpinBox *m_bias;
0060     QCheckBox *m_preserveAlpha;
0061     MatrixDataModel * m_matrixModel;
0062 };
0063 
0064 #endif // CONVOLVEMATRIXEFFECTCONFIGWIDGET_H