Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / plugins / sharpen / sharpenwindow.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 "sharpenwindow.h"
25
26
27
28
29
30
31
32
33
34
35 SharpenWindow::SharpenWindow(SharpenMain *client)
36  : PluginClientWindow(client,
37         230, 150, 230, 150, 0)
38
39         this->client = client; 
40 }
41
42 SharpenWindow::~SharpenWindow()
43 {
44 }
45
46 void SharpenWindow::create_objects()
47 {
48         int x = 10, y = 10;
49         add_tool(new BC_Title(x, y, _("Sharpness")));
50         y += 20;
51         add_tool(sharpen_slider = new SharpenSlider(client, &(client->config.sharpness), x, y));
52         y += 30;
53         add_tool(sharpen_interlace = new SharpenInterlace(client, x, y));
54         y += 30;
55         add_tool(sharpen_horizontal = new SharpenHorizontal(client, x, y));
56         y += 30;
57         add_tool(sharpen_luminance = new SharpenLuminance(client, x, y));
58         show_window();
59         flush();
60 }
61
62
63
64
65
66
67 SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y)
68  : BC_ISlider(x, 
69         y, 
70         0,
71         200, 
72         200,
73         0, 
74         MAXSHARPNESS, 
75         (int)*output, 
76         0, 
77         0, 
78         0)
79 {
80         this->client = client;
81         this->output = output;
82 }
83 SharpenSlider::~SharpenSlider()
84 {
85 }
86 int SharpenSlider::handle_event()
87 {
88         *output = get_value();
89         client->send_configure_change();
90         return 1;
91 }
92
93
94
95
96 SharpenInterlace::SharpenInterlace(SharpenMain *client, int x, int y)
97  : BC_CheckBox(x, y, client->config.interlace, _("Interlace"))
98 {
99         this->client = client;
100 }
101 SharpenInterlace::~SharpenInterlace()
102 {
103 }
104 int SharpenInterlace::handle_event()
105 {
106         client->config.interlace = get_value();
107         client->send_configure_change();
108         return 1;
109 }
110
111
112
113
114 SharpenHorizontal::SharpenHorizontal(SharpenMain *client, int x, int y)
115  : BC_CheckBox(x, y, client->config.horizontal, _("Horizontal only"))
116 {
117         this->client = client;
118 }
119 SharpenHorizontal::~SharpenHorizontal()
120 {
121 }
122 int SharpenHorizontal::handle_event()
123 {
124         client->config.horizontal = get_value();
125         client->send_configure_change();
126         return 1;
127 }
128
129
130
131 SharpenLuminance::SharpenLuminance(SharpenMain *client, int x, int y)
132  : BC_CheckBox(x, y, client->config.luminance, _("Luminance only"))
133 {
134         this->client = client;
135 }
136 SharpenLuminance::~SharpenLuminance()
137 {
138 }
139 int SharpenLuminance::handle_event()
140 {
141         client->config.luminance = get_value();
142         client->send_configure_change();
143         return 1;
144 }
145