1 #include "bcdisplayinfo.h"
5 yuv411Window::yuv411Window(yuv411Main *client)
6 : PluginClientWindow(client, 250, 255, 250, 255, 0)
11 yuv411Window::~yuv411Window()
15 void yuv411Window::create_objects()
17 int x = 10, y = 10, x1=90;
18 add_tool(avg_vertical = new yuv411Toggle(client,
19 &(client->config.avg_vertical),
20 _("Vertical average"),
24 add_tool(int_horizontal = new yuv411Toggle(client,
25 &(client->config.int_horizontal),
26 _("Horizontal interpolate"),
30 add_tool(inpainting = new yuv411Toggle(client,
31 &(client->config.inpainting),
32 _("Inpainting method"),
36 add_subwindow(new BC_Title(x, y, _("Offset:")));
37 add_subwindow(offset=new yuv411Offset(client,x1,y));
39 add_subwindow(new BC_Title(x, y, _("Threshold:")));
40 add_subwindow(thresh=new yuv411Thresh(client,x1,y));
42 add_subwindow(new BC_Title(x, y, _("Bias:")));
43 add_subwindow(bias=new yuv411Bias(client,x1,y));
45 add_subwindow(reset = new yuv411Reset(client, this, x, y+35));
49 yuv_warning = new BC_Title(x, y, _("Warning: colormodel not YUV"),MEDIUMFONT,RED);
50 add_subwindow(yuv_warning);
51 yuv_warning->hide_window();
54 void yuv411Window::update()
56 avg_vertical->update(client->config.avg_vertical);
57 int_horizontal->update(client->config.int_horizontal);
58 inpainting->update(client->config.inpainting);
59 offset->update(client->config.offset);
60 thresh->update(client->config.thresh);
61 bias->update(client->config.bias);
64 int yuv411Window::close_event()
70 yuv411Toggle::yuv411Toggle(yuv411Main *client, int *output, char *string, int x, int y)
71 : BC_CheckBox(x, y, *output, string)
73 this->client = client;
74 this->output = output;
76 yuv411Toggle::~yuv411Toggle()
79 int yuv411Toggle::handle_event()
81 *output = get_value();
82 ((yuv411Window*)client->thread->window)->update_enables();
83 client->send_configure_change();
87 yuv411Offset::yuv411Offset(yuv411Main *client, int x, int y)
88 : BC_FSlider(x, y, 0, 100, 100, (float)0, (float)2,
89 (float)client->config.offset)
91 this->client = client;
94 int yuv411Offset::handle_event()
96 client->config.offset = get_value();
97 client->send_configure_change();
101 yuv411Thresh::yuv411Thresh(yuv411Main *client, int x, int y)
102 : BC_FSlider(x, y, 0, 100, 100, (float)1, (float)100,
103 (float)client->config.thresh)
105 this->client = client;
108 int yuv411Thresh::handle_event()
110 client->config.thresh = get_value();
111 client->send_configure_change();
115 yuv411Bias::yuv411Bias(yuv411Main *client, int x, int y)
116 : BC_FSlider(x, y, 0, 100, 100, (float)0, (float)25,
117 (float)client->config.bias)
119 this->client = client;
123 int yuv411Bias::handle_event()
125 client->config.bias = get_value();
126 client->send_configure_change();
130 yuv411Reset::yuv411Reset(yuv411Main *client, yuv411Window *window, int x, int y)
131 : BC_GenericButton(x, y, _("Reset"))
133 this->client = client;
134 this->window = window;
136 yuv411Reset::~yuv411Reset()
139 int yuv411Reset::handle_event()
141 client->config.reset();
143 window->update_enables();
144 client->send_configure_change();
149 void yuv411Window::update_enables()
151 yuv411Config &config = client->config;
152 if( !config.int_horizontal && config.inpainting ) {
153 config.inpainting = 0;
154 inpainting->set_value(0);
156 if( config.int_horizontal ) {
157 inpainting->enable();
158 offset->show_window();
161 inpainting->disable();
162 offset->hide_window();
164 if( config.int_horizontal && config.inpainting ) {
165 thresh->show_window();
169 thresh->hide_window();
174 void yuv411Window::show_warning(int warn)
177 yuv_warning->show_window();
179 yuv_warning->hide_window();