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 ColorPicker
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();
124 void done_event(int result);
126 ChromaKeyColor *color;
127 ChromaKeyThreshold *threshold;
128 ChromaKeyUseValue *use_value;
129 ChromaKeyUseColorPicker *use_colorpicker;
130 ChromaKeySlope *slope;
131 BC_SubWindow *sample;
133 ChromaKeyColorThread *color_thread;
140 class ChromaKeyServer : public LoadServer
143 ChromaKeyServer(ChromaKey *plugin);
144 void init_packages();
145 LoadClient* new_client();
146 LoadPackage* new_package();
150 class ChromaKeyPackage : public LoadPackage
157 class ChromaKeyUnit : public LoadClient
160 ChromaKeyUnit(ChromaKey *plugin, ChromaKeyServer *server);
161 void process_package(LoadPackage *package);
168 class ChromaKey : public PluginVClient
171 ChromaKey(PluginServer *server);
174 PLUGIN_CLASS_MEMBERS(ChromaKeyConfig)
175 int process_buffer(VFrame *frame,
176 int64_t start_position,
180 void save_data(KeyFrame *keyframe);
181 void read_data(KeyFrame *keyframe);
184 VFrame *input, *output;
185 ChromaKeyServer *engine;