4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "colorpicker.h"
30 #include "loadbalance.h"
31 #include "pluginvclient.h"
36 class ChromaKeyWindow;
43 void copy_from(ChromaKeyConfig &src);
44 int equivalent(ChromaKeyConfig &src);
45 void interpolate(ChromaKeyConfig &prev,
46 ChromaKeyConfig &next,
49 int64_t current_frame);
60 class ChromaKeyColor : public BC_GenericButton
63 ChromaKeyColor(ChromaKey *plugin,
74 class ChromaKeyThreshold : public BC_FSlider
77 ChromaKeyThreshold(ChromaKey *plugin, int x, int y);
81 class ChromaKeySlope : public BC_FSlider
84 ChromaKeySlope(ChromaKey *plugin, int x, int y);
88 class ChromaKeyUseValue : public BC_CheckBox
91 ChromaKeyUseValue(ChromaKey *plugin, int x, int y);
96 class ChromaKeyUseColorPicker : public BC_GenericButton
99 ChromaKeyUseColorPicker(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y);
102 ChromaKeyWindow *gui;
106 class ChromaKeyColorThread : public ColorThread
109 ChromaKeyColorThread(ChromaKey *plugin, ChromaKeyWindow *gui);
110 int handle_new_color(int output, int alpha);
112 ChromaKeyWindow *gui;
116 class ChromaKeyWindow : public PluginClientWindow
119 ChromaKeyWindow(ChromaKey *plugin);
122 void create_objects();
123 void update_sample();
125 ChromaKeyColor *color;
126 ChromaKeyThreshold *threshold;
127 ChromaKeyUseValue *use_value;
128 ChromaKeyUseColorPicker *use_colorpicker;
129 ChromaKeySlope *slope;
130 BC_SubWindow *sample;
132 ChromaKeyColorThread *color_thread;
139 class ChromaKeyServer : public LoadServer
142 ChromaKeyServer(ChromaKey *plugin);
143 void init_packages();
144 LoadClient* new_client();
145 LoadPackage* new_package();
149 class ChromaKeyPackage : public LoadPackage
156 class ChromaKeyUnit : public LoadClient
159 ChromaKeyUnit(ChromaKey *plugin, ChromaKeyServer *server);
160 void process_package(LoadPackage *package);
167 class ChromaKey : public PluginVClient
170 ChromaKey(PluginServer *server);
173 PLUGIN_CLASS_MEMBERS(ChromaKeyConfig)
174 int process_buffer(VFrame *frame,
175 int64_t start_position,
179 void save_data(KeyFrame *keyframe);
180 void read_data(KeyFrame *keyframe);
183 VFrame *input, *output;
184 ChromaKeyServer *engine;