Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_wdg_unsharp.cpp
Go to the documentation of this file.
1/*
2 * This file is part of Krita
3 *
4 * SPDX-FileCopyrightText: 2006 Cyrille Berger <cberger@cberger.net>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#include "kis_wdg_unsharp.h"
10#include <QLayout>
11
12#include <filter/kis_filter.h>
16
17#include "ui_wdgunsharp.h"
18
20{
21 m_widget = new Ui_WdgUnsharp();
22 m_widget->setupUi(this);
23
24 widget()->doubleHalfSize->setRange(0.0, 99.99, 2);
25 widget()->doubleHalfSize->setSingleStep(1.0);
26 widget()->doubleAmount->setRange(0.0, 99.99, 2);
27 widget()->doubleAmount->setSingleStep(0.2);
28
29 connect(widget()->doubleHalfSize, SIGNAL(valueChanged(double)), SIGNAL(sigConfigurationItemChanged()));
30 connect(widget()->doubleAmount, SIGNAL(valueChanged(double)), SIGNAL(sigConfigurationItemChanged()));
31 connect(widget()->intThreshold, SIGNAL(valueChanged(int)), SIGNAL(sigConfigurationItemChanged()));
32 connect(widget()->chkLightnessOnly, SIGNAL(stateChanged(int)), SIGNAL(sigConfigurationItemChanged()));
33}
34
39
41{
42 QVariant value;
43 widget()->doubleHalfSize->setValue((config->getProperty("halfSize", value)) ? value.toDouble() : 1.0);
44 widget()->doubleAmount->setValue((config->getProperty("amount", value)) ? value.toDouble() : 0.0);
45 widget()->intThreshold->setValue((config->getProperty("threshold", value)) ? value.toUInt() : 2);
46 widget()->chkLightnessOnly->setChecked((config->getProperty("lightnessOnly", value)) ? value.toBool() : true);
47}
48
50{
52 config->setProperty("halfSize", widget()->doubleHalfSize->value());
53 config->setProperty("amount", widget()->doubleAmount->value());
54 config->setProperty("threshold", widget()->intThreshold->value());
55 config->setProperty("lightnessOnly", widget()->chkLightnessOnly->isChecked());
56 return config;
57}
58
59
float value(const T *src, size_t ch)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void sigConfigurationItemChanged()
static KisResourcesInterfaceSP instance()
Ui_WdgUnsharp * m_widget
void setConfiguration(const KisPropertiesConfigurationSP) override
~KisWdgUnsharp() override
KisWdgUnsharp(QWidget *parent)
KisPropertiesConfigurationSP configuration() const override
const Ui_WdgUnsharp * widget() const