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 ChromaKeyReset : public BC_GenericButton
99 ChromaKeyReset(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y);
102 ChromaKeyWindow *gui;
105 class ChromaKeyUseColorPicker : public BC_GenericButton
108 ChromaKeyUseColorPicker(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y);
111 ChromaKeyWindow *gui;
115 class ChromaKeyColorThread : public ColorPicker
118 ChromaKeyColorThread(ChromaKey *plugin, ChromaKeyWindow *gui);
119 int handle_new_color(int output, int alpha);
121 ChromaKeyWindow *gui;
125 class ChromaKeyWindow : public PluginClientWindow
128 ChromaKeyWindow(ChromaKey *plugin);
131 void create_objects();
133 void update_sample();
134 void done_event(int result);
136 ChromaKeyColor *color;
137 ChromaKeyThreshold *threshold;
138 ChromaKeyUseValue *use_value;
139 ChromaKeyUseColorPicker *use_colorpicker;
140 ChromaKeySlope *slope;
141 ChromaKeyReset *reset;
142 BC_SubWindow *sample;
144 ChromaKeyColorThread *color_thread;
151 class ChromaKeyServer : public LoadServer
154 ChromaKeyServer(ChromaKey *plugin);
155 void init_packages();
156 LoadClient* new_client();
157 LoadPackage* new_package();
161 class ChromaKeyPackage : public LoadPackage
168 class ChromaKeyUnit : public LoadClient
171 ChromaKeyUnit(ChromaKey *plugin, ChromaKeyServer *server);
172 void process_package(LoadPackage *package);
179 class ChromaKey : public PluginVClient
182 ChromaKey(PluginServer *server);
185 PLUGIN_CLASS_MEMBERS(ChromaKeyConfig)
186 int process_buffer(VFrame *frame,
187 int64_t start_position,
191 void save_data(KeyFrame *keyframe);
192 void read_data(KeyFrame *keyframe);
195 VFrame *input, *output;
196 ChromaKeyServer *engine;