anonymous contribution for improved Chromakey plugin to include sliders, textbox...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / chromakey / chromakey.h
index f282554fec9df80c558dedaa5b29802ec0276a69..9eacd28424f7bca40f54a2592e513e88d5d21142 100644 (file)
 
 #include "colorpicker.h"
 #include "guicast.h"
+#include "theme.h"
 #include "loadbalance.h"
 #include "pluginvclient.h"
 
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL               0
+#define RESET_RGB               1
+#define RESET_SLOPE             2
+#define RESET_THRESHOLD         3
+
+#define MIN_VALUE   0.00
+#define MAX_VALUE 100.00
 
 class ChromaKey;
 class ChromaKey;
 class ChromaKeyWindow;
+class ChromaKeyFText;
+class ChromaKeyFSlider;
+class ChromaKeyReset;
+class ChromaKeyDefaultSettings;
+class ChromaKeyClr;
 
 class ChromaKeyConfig
 {
 public:
        ChromaKeyConfig();
-       void reset();
+       void reset(int clear);
        void copy_from(ChromaKeyConfig &src);
        int equivalent(ChromaKeyConfig &src);
        void interpolate(ChromaKeyConfig &prev,
@@ -93,6 +107,44 @@ public:
        ChromaKey *plugin;
 };
 
+class ChromaKeyFText : public BC_TumbleTextBox
+{
+public:
+       ChromaKeyFText(ChromaKey *plugin, ChromaKeyWindow *gui,
+               ChromaKeyFSlider *slider, float *output, int x, int y, float min, float max);
+       ~ChromaKeyFText();
+       int handle_event();
+       ChromaKey *plugin;
+       ChromaKeyWindow *gui;
+       ChromaKeyFSlider *slider;
+       float *output;
+       float min, max;
+};
+
+class ChromaKeyFSlider : public BC_FSlider
+{
+public:
+       ChromaKeyFSlider(ChromaKey *plugin,
+               ChromaKeyFText *text, float *output, int x, int y,
+               float min, float max, int w);
+       ~ChromaKeyFSlider();
+       int handle_event();
+       ChromaKey *plugin;
+       ChromaKeyFText *text;
+       float *output;
+};
+
+class ChromaKeyClr : public BC_Button
+{
+public:
+       ChromaKeyClr(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y, int clear);
+       ~ChromaKeyClr();
+       int handle_event();
+       ChromaKey *plugin;
+       ChromaKeyWindow *gui;
+       int clear;
+};
+
 class ChromaKeyReset : public BC_GenericButton
 {
 public:
@@ -102,6 +154,16 @@ public:
        ChromaKeyWindow *gui;
 };
 
+class ChromaKeyDefaultSettings : public BC_GenericButton
+{
+public:
+       ChromaKeyDefaultSettings(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y, int w);
+       ~ChromaKeyDefaultSettings();
+       int handle_event();
+       ChromaKey *plugin;
+       ChromaKeyWindow *gui;
+};
+
 class ChromaKeyUseColorPicker : public BC_GenericButton
 {
 public:
@@ -129,16 +191,27 @@ public:
        ~ChromaKeyWindow();
 
        void create_objects();
-       void update_gui();
+       void update_gui(int clear);
        void update_sample();
        void done_event(int result);
 
        ChromaKeyColor *color;
+
        ChromaKeyThreshold *threshold;
+       ChromaKeyFText *threshold_text;
+       ChromaKeyFSlider *threshold_slider;
+       ChromaKeyClr *threshold_Clr;
+
        ChromaKeyUseValue *use_value;
        ChromaKeyUseColorPicker *use_colorpicker;
+
        ChromaKeySlope *slope;
+       ChromaKeyFText *slope_text;
+       ChromaKeyFSlider *slope_slider;
+       ChromaKeyClr *slope_Clr;
+
        ChromaKeyReset *reset;
+       ChromaKeyDefaultSettings *default_settings;
        BC_SubWindow *sample;
        ChromaKey *plugin;
        ChromaKeyColorThread *color_thread;