1 #include "bcdisplayinfo.h"
4 #include "unsharpwindow.h"
11 PLUGIN_THREAD_OBJECT(UnsharpMain, UnsharpThread, UnsharpWindow)
15 UnsharpWindow::UnsharpWindow(UnsharpMain *plugin, int x, int y)
16 : BC_Window(plugin->gui_string,
26 this->plugin = plugin;
29 UnsharpWindow::~UnsharpWindow()
33 int UnsharpWindow::create_objects()
38 add_subwindow(title = new BC_Title(x, y + 10, _("Radius:")));
39 add_subwindow(radius = new UnsharpRadius(plugin,
40 x + title->get_w() + 10,
44 add_subwindow(title = new BC_Title(x, y + 10, _("Amount:")));
45 add_subwindow(amount = new UnsharpAmount(plugin,
46 x + title->get_w() + 10,
50 add_subwindow(title = new BC_Title(x, y + 10, _("Threshold:")));
51 add_subwindow(threshold = new UnsharpThreshold(plugin,
52 x + title->get_w() + 10,
61 void UnsharpWindow::update()
63 radius->update(plugin->config.radius);
64 amount->update(plugin->config.amount);
65 threshold->update(plugin->config.threshold);
69 WINDOW_CLOSE_EVENT(UnsharpWindow)
78 UnsharpRadius::UnsharpRadius(UnsharpMain *plugin, int x, int y)
79 : BC_FPot(x, y, plugin->config.radius, 0.1, 120)
81 this->plugin = plugin;
83 int UnsharpRadius::handle_event()
85 plugin->config.radius = get_value();
86 plugin->send_configure_change();
90 UnsharpAmount::UnsharpAmount(UnsharpMain *plugin, int x, int y)
91 : BC_FPot(x, y, plugin->config.amount, 0, 5)
93 this->plugin = plugin;
95 int UnsharpAmount::handle_event()
97 plugin->config.amount = get_value();
98 plugin->send_configure_change();
102 UnsharpThreshold::UnsharpThreshold(UnsharpMain *plugin, int x, int y)
103 : BC_IPot(x, y, plugin->config.threshold, 0, 255)
105 this->plugin = plugin;
107 int UnsharpThreshold::handle_event()
109 plugin->config.threshold = get_value();
110 plugin->send_configure_change();