4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "bcdisplayinfo.h"
25 #include "unsharpwindow.h"
36 UnsharpWindow::UnsharpWindow(UnsharpMain *plugin)
37 : PluginClientWindow(plugin, 285, 160, 285, 160, 0)
39 this->plugin = plugin;
42 UnsharpWindow::~UnsharpWindow()
46 void UnsharpWindow::create_objects()
51 add_subwindow(title = new BC_Title(x, y + 10, _("Radius:")));
52 add_subwindow(radius = new UnsharpRadius(plugin,
53 x + title->get_w() + 10,
57 add_subwindow(title = new BC_Title(x, y + 10, _("Amount:")));
58 add_subwindow(amount = new UnsharpAmount(plugin,
59 x + title->get_w() + 10,
63 add_subwindow(title = new BC_Title(x, y + 10, _("Threshold:")));
64 add_subwindow(threshold = new UnsharpThreshold(plugin,
65 x + title->get_w() + 10,
73 void UnsharpWindow::update()
75 radius->update(plugin->config.radius);
76 amount->update(plugin->config.amount);
77 threshold->update(plugin->config.threshold);
89 UnsharpRadius::UnsharpRadius(UnsharpMain *plugin, int x, int y)
90 : BC_FPot(x, y, plugin->config.radius, 0.1, 120)
92 this->plugin = plugin;
94 int UnsharpRadius::handle_event()
96 plugin->config.radius = get_value();
97 plugin->send_configure_change();
101 UnsharpAmount::UnsharpAmount(UnsharpMain *plugin, int x, int y)
102 : BC_FPot(x, y, plugin->config.amount, 0, 5)
104 this->plugin = plugin;
106 int UnsharpAmount::handle_event()
108 plugin->config.amount = get_value();
109 plugin->send_configure_change();
113 UnsharpThreshold::UnsharpThreshold(UnsharpMain *plugin, int x, int y)
114 : BC_IPot(x, y, plugin->config.threshold, 0, 255)
116 this->plugin = plugin;
118 int UnsharpThreshold::handle_event()
120 plugin->config.threshold = get_value();
121 plugin->send_configure_change();