remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / plugins / unsharp / unsharpwindow.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "bcdisplayinfo.h"
23 #include "language.h"
24 #include "unsharp.h"
25 #include "unsharpwindow.h"
26
27
28
29
30
31
32
33
34
35
36 UnsharpWindow::UnsharpWindow(UnsharpMain *plugin)
37  : PluginClientWindow(plugin, 285, 160, 285, 160, 0)
38 {
39         this->plugin = plugin;
40 }
41
42 UnsharpWindow::~UnsharpWindow()
43 {
44 }
45
46 void UnsharpWindow::create_objects()
47 {
48         int x = 10, y = 10;
49         BC_Title *title;
50
51         add_subwindow(title = new BC_Title(x, y + 10, _("Radius:")));
52         add_subwindow(radius = new UnsharpRadius(plugin,
53                 x + title->get_w() + 10,
54                 y));
55
56         y += 40;
57         add_subwindow(title = new BC_Title(x, y + 10, _("Amount:")));
58         add_subwindow(amount = new UnsharpAmount(plugin,
59                 x + title->get_w() + 10,
60                 y));
61
62         y += 40;
63         add_subwindow(title = new BC_Title(x, y + 10, _("Threshold:")));
64         add_subwindow(threshold = new UnsharpThreshold(plugin,
65                 x + title->get_w() + 10,
66                 y));
67
68         show_window();
69         flush();
70 }
71
72
73 void UnsharpWindow::update()
74 {
75         radius->update(plugin->config.radius);
76         amount->update(plugin->config.amount);
77         threshold->update(plugin->config.threshold);
78 }
79
80
81
82
83
84
85
86
87
88
89 UnsharpRadius::UnsharpRadius(UnsharpMain *plugin, int x, int y)
90  : BC_FPot(x, y, plugin->config.radius, 0.1, 120)
91 {
92         this->plugin = plugin;
93 }
94 int UnsharpRadius::handle_event()
95 {
96         plugin->config.radius = get_value();
97         plugin->send_configure_change();
98         return 1;
99 }
100
101 UnsharpAmount::UnsharpAmount(UnsharpMain *plugin, int x, int y)
102  : BC_FPot(x, y, plugin->config.amount, 0, 5)
103 {
104         this->plugin = plugin;
105 }
106 int UnsharpAmount::handle_event()
107 {
108         plugin->config.amount = get_value();
109         plugin->send_configure_change();
110         return 1;
111 }
112
113 UnsharpThreshold::UnsharpThreshold(UnsharpMain *plugin, int x, int y)
114  : BC_IPot(x, y, plugin->config.threshold, 0, 255)
115 {
116         this->plugin = plugin;
117 }
118 int UnsharpThreshold::handle_event()
119 {
120         plugin->config.threshold = get_value();
121         plugin->send_configure_change();
122         return 1;
123 }
124
125
126
127