X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fchromakey%2Fchromakey.C;h=4eb39787aca1d997ac80c208f511c7393e39769f;hb=667ff598ae2a94f48c7056aee1d77d7cde39066b;hp=9d1926fc82ce83c66fde4233fe9860e8fcbcf73c;hpb=28600526f736ffd4f104f29495a4bb36497e1ea8;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/chromakey/chromakey.C b/cinelerra-5.1/plugins/chromakey/chromakey.C index 9d1926fc..4eb39787 100644 --- a/cinelerra-5.1/plugins/chromakey/chromakey.C +++ b/cinelerra-5.1/plugins/chromakey/chromakey.C @@ -30,7 +30,7 @@ #include "language.h" #include "loadbalance.h" #include "playback3d.h" -#include "cicolors.h" +#include "bccolors.h" #include "pluginvclient.h" #include "vframe.h" @@ -39,9 +39,13 @@ +ChromaKeyConfig::ChromaKeyConfig() +{ + reset(); +} +void ChromaKeyConfig::reset() -ChromaKeyConfig::ChromaKeyConfig() { red = 0.0; green = 0.0; @@ -147,6 +151,9 @@ void ChromaKeyWindow::create_objects() y += 30; add_subwindow(use_colorpicker = new ChromaKeyUseColorPicker(plugin, this, x1, y)); + y += use_colorpicker->get_h() + 10; + add_subwindow(new ChromaKeyReset(plugin, this, x, y)); + color_thread = new ChromaKeyColorThread(plugin, this); update_sample(); @@ -246,7 +253,6 @@ int ChromaKeySlope::handle_event() return 1; } - ChromaKeyUseValue::ChromaKeyUseValue(ChromaKey *plugin, int x, int y) : BC_CheckBox(x, y, plugin->config.use_value, _("Use value")) { @@ -259,6 +265,20 @@ int ChromaKeyUseValue::handle_event() return 1; } +ChromaKeyReset::ChromaKeyReset(ChromaKey *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(ChromaKey *plugin, ChromaKeyWindow *gui, @@ -630,15 +650,20 @@ void ChromaKey::update_gui() { load_configuration(); thread->window->lock_window(); - ((ChromaKeyWindow*)thread->window)->threshold->update(config.threshold); - ((ChromaKeyWindow*)thread->window)->slope->update(config.slope); - ((ChromaKeyWindow*)thread->window)->use_value->update(config.use_value); - ((ChromaKeyWindow*)thread->window)->update_sample(); - + ((ChromaKeyWindow *)(thread->window))->update_gui(); thread->window->unlock_window(); } } +void ChromaKeyWindow::update_gui() +{ + ChromaKeyConfig &config = plugin->config; + threshold->update(config.threshold); + slope->update(config.slope); + use_value->update(config.use_value); + update_sample(); +} + int ChromaKey::handle_opengl() { #ifdef HAVE_GL