1 #include "bcdisplayinfo.h"
5 yuv411Window::yuv411Window(yuv411Main *client)
6 : PluginClientWindow(client, 250, 220, 250, 220, 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));
48 yuv_warning = new BC_Title(x, y, _("Warning: colormodel not YUV"),MEDIUMFONT,RED);
49 add_subwindow(yuv_warning);
50 yuv_warning->hide_window();
53 int yuv411Window::close_event()
59 yuv411Toggle::yuv411Toggle(yuv411Main *client, int *output, char *string, int x, int y)
60 : BC_CheckBox(x, y, *output, string)
62 this->client = client;
63 this->output = output;
65 yuv411Toggle::~yuv411Toggle()
68 int yuv411Toggle::handle_event()
70 *output = get_value();
71 ((yuv411Window*)client->thread->window)->update_enables();
72 client->send_configure_change();
76 yuv411Offset::yuv411Offset(yuv411Main *client, int x, int y)
77 : BC_FSlider(x, y, 0, 100, 100, (float)0, (float)2,
78 (float)client->config.offset)
80 this->client = client;
83 int yuv411Offset::handle_event()
85 client->config.offset = get_value();
86 client->send_configure_change();
90 yuv411Thresh::yuv411Thresh(yuv411Main *client, int x, int y)
91 : BC_FSlider(x, y, 0, 100, 100, (float)1, (float)100,
92 (float)client->config.thresh)
94 this->client = client;
97 int yuv411Thresh::handle_event()
99 client->config.thresh = get_value();
100 client->send_configure_change();
104 yuv411Bias::yuv411Bias(yuv411Main *client, int x, int y)
105 : BC_FSlider(x, y, 0, 100, 100, (float)0, (float)25,
106 (float)client->config.bias)
108 this->client = client;
112 int yuv411Bias::handle_event()
114 client->config.bias = get_value();
115 client->send_configure_change();
119 void yuv411Window::update_enables()
121 yuv411Config &config = client->config;
122 if( !config.int_horizontal && config.inpainting ) {
123 config.inpainting = 0;
124 inpainting->set_value(0);
126 if( config.int_horizontal ) {
127 inpainting->enable();
128 offset->show_window();
131 inpainting->disable();
132 offset->hide_window();
134 if( config.int_horizontal && config.inpainting ) {
135 thresh->show_window();
139 thresh->hide_window();
144 void yuv411Window::show_warning(int warn)
147 yuv_warning->show_window();
149 yuv_warning->hide_window();