Changeset View
Changeset View
Standalone View
Standalone View
plugins/filters/guassianhighpass/wdg_guassianhighpass.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * This file is part of Krita | ||||
3 | * | ||||
4 | * Copyright (c) 2019 Miguel Lopez <reptillia39@live.com> | ||||
5 | * | ||||
6 | * This program is free software; you can redistribute it and/or modify | ||||
7 | * it under the terms of the GNU General Public License as published by | ||||
8 | * the Free Software Foundation; either version 2 of the License, or | ||||
9 | * (at your option) any later version. | ||||
10 | * | ||||
11 | * This program is distributed in the hope that it will be useful, | ||||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
14 | * GNU General Public License for more details. | ||||
15 | * | ||||
16 | * You should have received a copy of the GNU General Public License | ||||
17 | * along with this program; if not, write to the Free Software | ||||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #include "wdg_guassianhighpass.h" | ||||
22 | #include <QLayout> | ||||
23 | #include <QToolButton> | ||||
24 | | ||||
25 | #include <filter/kis_filter.h> | ||||
26 | #include <filter/kis_filter_configuration.h> | ||||
27 | #include <kis_processing_information.h> | ||||
28 | | ||||
29 | #include "ui_wdgguassianhighpass.h" | ||||
30 | | ||||
31 | KisWdgGuassianHighPass::KisWdgGuassianHighPass(QWidget * parent) : KisConfigWidget(parent) | ||||
32 | { | ||||
33 | m_widget = new Ui_WdgGuassianHighPass(); | ||||
34 | m_widget->setupUi(this); | ||||
35 | | ||||
36 | connect(widget()->doubleblurAmount, SIGNAL(valueChanged(double)), SIGNAL(sigConfigurationItemChanged())); | ||||
37 | } | ||||
38 | | ||||
39 | KisWdgGuassianHighPass::~KisWdgGuassianHighPass() | ||||
40 | { | ||||
41 | delete m_widget; | ||||
42 | } | ||||
43 | | ||||
44 | void KisWdgGuassianHighPass::setConfiguration(const KisPropertiesConfigurationSP config) | ||||
45 | { | ||||
46 | QVariant value; | ||||
47 | widget()->doubleblurAmount->setValue((config->getProperty("blurAmount", value)) ? value.toDouble() : 1.0); | ||||
48 | } | ||||
49 | | ||||
50 | KisPropertiesConfigurationSP KisWdgGuassianHighPass::configuration() const | ||||
51 | { | ||||
52 | KisFilterConfigurationSP config = new KisFilterConfiguration("guassianhighpass", 1); | ||||
53 | config->setProperty("blurAmount", widget()->doubleblurAmount->value()); | ||||
54 | return config; | ||||
55 | } | ||||
56 | | ||||
57 | |