r726: Implementing ability to add textural info to the labels
[cinelerra_cv/mob.git] / plugins / chromakey / chromakey.h
blob398a7d672b249b029c3a6ff960a95483fd63dd7d
1 #ifndef CHROMAKEY_H
2 #define CHROMAKEY_H
7 #include "colorpicker.h"
8 #include "guicast.h"
9 #include "loadbalance.h"
10 #include "pluginvclient.h"
13 class ChromaKey;
14 class ChromaKey;
15 class ChromaKeyWindow;
17 class ChromaKeyConfig
19 public:
20 ChromaKeyConfig();
22 void copy_from(ChromaKeyConfig &src);
23 int equivalent(ChromaKeyConfig &src);
24 void interpolate(ChromaKeyConfig &prev,
25 ChromaKeyConfig &next,
26 int64_t prev_frame,
27 int64_t next_frame,
28 int64_t current_frame);
29 int get_color();
31 float red;
32 float green;
33 float blue;
34 float threshold;
35 float slope;
36 int use_value;
39 class ChromaKeyColor : public BC_GenericButton
41 public:
42 ChromaKeyColor(ChromaKey *plugin,
43 ChromaKeyWindow *gui,
44 int x,
45 int y);
47 int handle_event();
49 ChromaKey *plugin;
50 ChromaKeyWindow *gui;
53 class ChromaKeyThreshold : public BC_FSlider
55 public:
56 ChromaKeyThreshold(ChromaKey *plugin, int x, int y);
57 int handle_event();
58 ChromaKey *plugin;
60 class ChromaKeySlope : public BC_FSlider
62 public:
63 ChromaKeySlope(ChromaKey *plugin, int x, int y);
64 int handle_event();
65 ChromaKey *plugin;
67 class ChromaKeyUseValue : public BC_CheckBox
69 public:
70 ChromaKeyUseValue(ChromaKey *plugin, int x, int y);
71 int handle_event();
72 ChromaKey *plugin;
75 class ChromaKeyUseColorPicker : public BC_GenericButton
77 public:
78 ChromaKeyUseColorPicker(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y);
79 int handle_event();
80 ChromaKey *plugin;
81 ChromaKeyWindow *gui;
85 class ChromaKeyColorThread : public ColorThread
87 public:
88 ChromaKeyColorThread(ChromaKey *plugin, ChromaKeyWindow *gui);
89 int handle_new_color(int output, int alpha);
90 ChromaKey *plugin;
91 ChromaKeyWindow *gui;
95 class ChromaKeyWindow : public BC_Window
97 public:
98 ChromaKeyWindow(ChromaKey *plugin, int x, int y);
99 ~ChromaKeyWindow();
101 void create_objects();
102 int close_event();
103 void update_sample();
105 ChromaKeyColor *color;
106 ChromaKeyThreshold *threshold;
107 ChromaKeyUseValue *use_value;
108 ChromaKeyUseColorPicker *use_colorpicker;
109 ChromaKeySlope *slope;
110 BC_SubWindow *sample;
111 ChromaKey *plugin;
112 ChromaKeyColorThread *color_thread;
117 PLUGIN_THREAD_HEADER(ChromaKey, ChromaKeyThread, ChromaKeyWindow)
120 class ChromaKeyServer : public LoadServer
122 public:
123 ChromaKeyServer(ChromaKey *plugin);
124 void init_packages();
125 LoadClient* new_client();
126 LoadPackage* new_package();
127 ChromaKey *plugin;
130 class ChromaKeyPackage : public LoadPackage
132 public:
133 ChromaKeyPackage();
134 int y1, y2;
137 class ChromaKeyUnit : public LoadClient
139 public:
140 ChromaKeyUnit(ChromaKey *plugin, ChromaKeyServer *server);
141 void process_package(LoadPackage *package);
142 ChromaKey *plugin;
148 class ChromaKey : public PluginVClient
150 public:
151 ChromaKey(PluginServer *server);
152 ~ChromaKey();
154 int process_realtime(VFrame *input, VFrame *output);
155 int is_realtime();
156 char* plugin_title();
157 VFrame* new_picon();
158 int load_configuration();
159 int load_defaults();
160 int save_defaults();
161 void save_data(KeyFrame *keyframe);
162 void read_data(KeyFrame *keyframe);
163 int show_gui();
164 int set_string();
165 void raise_window();
166 void update_gui();
168 ChromaKeyConfig config;
169 VFrame *input, *output;
170 ChromaKeyServer *engine;
171 ChromaKeyThread *thread;
172 Defaults *defaults;
182 #endif