00001 #include "bcdisplayinfo.h"
00002 #include "language.h"
00003 #include "unsharp.h"
00004 #include "unsharpwindow.h"
00005
00006
00007
00008
00009
00010
00011 PLUGIN_THREAD_OBJECT(UnsharpMain, UnsharpThread, UnsharpWindow)
00012
00013
00014
00015 UnsharpWindow::UnsharpWindow(UnsharpMain *plugin, int x, int y)
00016 : BC_Window(plugin->gui_string,
00017 x,
00018 y,
00019 200,
00020 160,
00021 200,
00022 160,
00023 0,
00024 1)
00025 {
00026 this->plugin = plugin;
00027 }
00028
00029 UnsharpWindow::~UnsharpWindow()
00030 {
00031 }
00032
00033 int UnsharpWindow::create_objects()
00034 {
00035 int x = 10, y = 10;
00036 BC_Title *title;
00037
00038 add_subwindow(title = new BC_Title(x, y + 10, _("Radius:")));
00039 add_subwindow(radius = new UnsharpRadius(plugin,
00040 x + title->get_w() + 10,
00041 y));
00042
00043 y += 40;
00044 add_subwindow(title = new BC_Title(x, y + 10, _("Amount:")));
00045 add_subwindow(amount = new UnsharpAmount(plugin,
00046 x + title->get_w() + 10,
00047 y));
00048
00049 y += 40;
00050 add_subwindow(title = new BC_Title(x, y + 10, _("Threshold:")));
00051 add_subwindow(threshold = new UnsharpThreshold(plugin,
00052 x + title->get_w() + 10,
00053 y));
00054
00055 show_window();
00056 flush();
00057 return 0;
00058 }
00059
00060
00061 void UnsharpWindow::update()
00062 {
00063 radius->update(plugin->config.radius);
00064 amount->update(plugin->config.amount);
00065 threshold->update(plugin->config.threshold);
00066 }
00067
00068
00069 WINDOW_CLOSE_EVENT(UnsharpWindow)
00070
00071
00072
00073
00074
00075
00076
00077
00078 UnsharpRadius::UnsharpRadius(UnsharpMain *plugin, int x, int y)
00079 : BC_FPot(x, y, plugin->config.radius, 0.1, 120)
00080 {
00081 this->plugin = plugin;
00082 }
00083 int UnsharpRadius::handle_event()
00084 {
00085 plugin->config.radius = get_value();
00086 plugin->send_configure_change();
00087 return 1;
00088 }
00089
00090 UnsharpAmount::UnsharpAmount(UnsharpMain *plugin, int x, int y)
00091 : BC_FPot(x, y, plugin->config.amount, 0, 5)
00092 {
00093 this->plugin = plugin;
00094 }
00095 int UnsharpAmount::handle_event()
00096 {
00097 plugin->config.amount = get_value();
00098 plugin->send_configure_change();
00099 return 1;
00100 }
00101
00102 UnsharpThreshold::UnsharpThreshold(UnsharpMain *plugin, int x, int y)
00103 : BC_IPot(x, y, plugin->config.threshold, 0, 255)
00104 {
00105 this->plugin = plugin;
00106 }
00107 int UnsharpThreshold::handle_event()
00108 {
00109 plugin->config.threshold = get_value();
00110 plugin->send_configure_change();
00111 return 1;
00112 }
00113
00114
00115
00116