2 * GreyCStoration plugin for Cinelerra
3 * Copyright (C) 2013 Slock Ruddy
4 * Copyright (C) 2014-2015 Nicola Ferralis <feranick at hotmail dot com>
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"
23 #include "greycstorationwindow.h"
28 // configuration window
29 GreyCStorationWindow::GreyCStorationWindow(GreyCStorationMain *client)
30 : PluginClientWindow(client, 300, 180, 300, 180, 0)
32 this->client = client;
35 GreyCStorationWindow::~GreyCStorationWindow()
40 void GreyCStorationWindow::create_objects()
44 add_subwindow(title = new BC_Title(x, y + 10, _("Amplitude:")));
45 add_tool(greycamp_slider = new GreyCAmpSlider(client, &(client->config.amplitude), x+title->get_w(), y));
48 add_subwindow(title = new BC_Title(x, y + 10, _("Sharpness:")));
49 add_tool(greycsharp_slider = new GreyCSharpSlider(client, &(client->config.sharpness), x+title->get_w(), y));
52 add_subwindow(title = new BC_Title(x, y + 10, _("Anisotropy:")));
53 add_tool(greycani_slider = new GreyCAniSlider(client, &(client->config.anisotropy), x+title->get_w(), y));
56 add_subwindow(title = new BC_Title(x, y + 10, _("Noise scale:")));
57 add_tool(greycnoise_slider = new GreyCNoiseSlider(client, &(client->config.noise_scale), x+title->get_w(), y));
64 int GreyCStorationWindow::close_event()
71 // amp slider implementation
73 GreyCAmpSlider::GreyCAmpSlider(GreyCStorationMain *client, float *output, int x, int y)
74 : BC_ISlider(x, y, 0, 200, 200, 0, 255, //MAX
75 (int)*output, 0, 0, 0)
77 this->client = client;
78 this->output = output;
80 GreyCAmpSlider::~GreyCAmpSlider()
83 int GreyCAmpSlider::handle_event()
85 *output = get_value();
86 client->send_configure_change();
93 GreyCSharpSlider::GreyCSharpSlider(GreyCStorationMain *client, float *output, int x, int y)
94 : BC_FSlider(x, y, 0, 200, 200, 0.0f, 1.0f, //MAX
97 this->client = client;
98 this->output = output;
101 GreyCSharpSlider::~GreyCSharpSlider()
105 int GreyCSharpSlider::handle_event()
107 *output = get_value();
108 client->send_configure_change();
115 GreyCAniSlider::GreyCAniSlider(GreyCStorationMain *client, float *output, int x, int y)
116 : BC_FSlider(x, y, 0, 200, 200, 0.0f, 1.0f, //MAX
117 (float)*output, 0, 0)
119 this->client = client;
120 this->output = output;
123 GreyCAniSlider::~GreyCAniSlider()
127 int GreyCAniSlider::handle_event()
129 *output = get_value();
130 client->send_configure_change();
137 GreyCNoiseSlider::GreyCNoiseSlider(GreyCStorationMain *client, float *output, int x, int y)
138 : BC_FSlider(x, y, 0, 200, 200, 0.0f, 10.0f, //MAX
139 (float)*output, 0, 0)
141 this->client = client;
142 this->output = output;
145 GreyCNoiseSlider::~GreyCNoiseSlider()
149 int GreyCNoiseSlider::handle_event()
151 *output = get_value();
152 client->send_configure_change();