#include "language.h"
#include "loadbalance.h"
#include "playback3d.h"
-#include "cicolors.h"
+#include "bccolors.h"
#include "pluginvclient.h"
#include "vframe.h"
ChromaKeyConfig::ChromaKeyConfig ()
+{
+ reset();
+}
+
+void ChromaKeyConfig::reset()
+
{
red = 0.0;
green = 1.0;
add_subwindow (use_colorpicker =
new ChromaKeyUseColorPicker (plugin, this, x, y));
y += use_colorpicker->get_h() + 10;
+
+ add_subwindow (new ChromaKeyReset (plugin, this, x2+240, y));
add_subwindow (show_mask = new ChromaKeyShowMask (plugin, x2, y));
y += show_mask->get_h() + 5;
return 1;
}
+ChromaKeyReset::ChromaKeyReset (ChromaKeyHSV *plugin, ChromaKeyWindow *gui, int x, int y)
+ :BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+
+int ChromaKeyReset::handle_event ()
+{
+ plugin->config.reset();
+ gui->update_gui();
+ plugin->send_configure_change();
+ return 1;
+}
+
ChromaKeyUseColorPicker::ChromaKeyUseColorPicker (ChromaKeyHSV * plugin, ChromaKeyWindow * gui, int x, int y)
: BC_GenericButton (x, y,
_
float y = r;
float u = g;
float v = b;
- YUV::yuv_to_rgb_f (r, g, b, y, u - 0.5, v - 0.5);
+ YUV::yuv.yuv_to_rgb_f (r, g, b, y, u - 0.5, v - 0.5);
}
HSV::rgb_to_hsv (r, g, b, h, s, v);
float y;
float u;
float v;
- YUV::rgb_to_yuv_f (r, g, b, y, u, v);
+ YUV::yuv.rgb_to_yuv_f (r, g, b, y, u, v);
CLAMP (y, 0, 1.0);
CLAMP (u, 0, 1.0);
CLAMP (v, 0, 1.0);
load_configuration();
ChromaKeyWindow *window = (ChromaKeyWindow*)thread->window;
window->lock_window();
- window->min_brightness->update(config.min_brightness);
- window->max_brightness->update(config.max_brightness);
- window->saturation->update(config.saturation);
- window->min_saturation->update(config.min_saturation);
- window->tolerance->update(config.tolerance);
- window->in_slope->update(config.in_slope);
- window->out_slope->update(config.out_slope);
- window->alpha_offset->update(config.alpha_offset);
- window->spill_threshold->update(config.spill_threshold);
- window->spill_amount->update(config.spill_amount);
- window->show_mask->update(config.show_mask);
- window->update_sample();
+ window->update_gui();
window->unlock_window();
}
}
+void ChromaKeyWindow::update_gui()
+{
+ ChromaKeyConfig &config = plugin->config;
+ min_brightness->update(config.min_brightness);
+ max_brightness->update(config.max_brightness);
+ saturation->update(config.saturation);
+ min_saturation->update(config.min_saturation);
+ tolerance->update(config.tolerance);
+ in_slope->update(config.in_slope);
+ out_slope->update(config.out_slope);
+ alpha_offset->update(config.alpha_offset);
+ spill_threshold->update(config.spill_threshold);
+ spill_amount->update(config.spill_amount);
+ show_mask->update(config.show_mask);
+ update_sample();
+}