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
26 #include "bcdisplayinfo.h"
27 #include "bcsignals.h"
33 #include "loadbalance.h"
34 #include "pluginvclient.h"
38 #define RESET_DEFAULT_SETTINGS 10
40 #define RESET_XSLIDER 1
41 #define RESET_YSLIDER 2
42 #define RESET_RADIUS 3
47 #define RADIUS_MAX 100
55 class ZoomBlurISlider;
58 class ZoomBlurDefaultSettings;
68 void reset(int clear);
69 int equivalent(ZoomBlurConfig &that);
70 void copy_from(ZoomBlurConfig &that);
71 void interpolate(ZoomBlurConfig &prev,
90 class ZoomBlurIText : public BC_TumbleTextBox
93 ZoomBlurIText(ZoomBlurWindow *window, ZoomBlurMain *plugin,
94 ZoomBlurISlider *slider, int *output, int x, int y, int min, int max);
97 ZoomBlurWindow *window;
99 ZoomBlurISlider *slider;
104 class ZoomBlurISlider : public BC_ISlider
107 ZoomBlurISlider(ZoomBlurMain *plugin,
108 ZoomBlurIText *text, int *output, int x, int y,
109 int min, int max, int w);
112 ZoomBlurMain *plugin;
117 class ZoomBlurToggle : public BC_CheckBox
120 ZoomBlurToggle(ZoomBlurMain *plugin,
126 ZoomBlurMain *plugin;
130 class ZoomBlurWindow : public PluginClientWindow
133 ZoomBlurWindow(ZoomBlurMain *plugin);
136 void create_objects();
137 void update_gui(int clear);
139 ZoomBlurIText *x_text;
140 ZoomBlurISlider *x_slider;
143 ZoomBlurIText *y_text;
144 ZoomBlurISlider *y_slider;
147 ZoomBlurIText *radius_text;
148 ZoomBlurISlider *radius_slider;
149 ZoomBlurClr *radius_Clr;
151 ZoomBlurIText *steps_text;
152 ZoomBlurISlider *steps_slider;
153 ZoomBlurClr *steps_Clr;
155 ZoomBlurToggle *r, *g, *b, *a;
156 ZoomBlurMain *plugin;
157 ZoomBlurReset *reset;
158 ZoomBlurDefaultSettings *default_settings;
161 class ZoomBlurReset : public BC_GenericButton
164 ZoomBlurReset(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y);
167 ZoomBlurMain *plugin;
168 ZoomBlurWindow *window;
171 class ZoomBlurDefaultSettings : public BC_GenericButton
174 ZoomBlurDefaultSettings(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int w);
175 ~ZoomBlurDefaultSettings();
177 ZoomBlurMain *plugin;
178 ZoomBlurWindow *window;
182 class ZoomBlurClr : public BC_Button
185 ZoomBlurClr(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int clear);
188 ZoomBlurMain *plugin;
189 ZoomBlurWindow *window;
195 // Output coords for a layer of blurring
196 // Used for OpenGL only
201 float x1, y1, x2, y2;
204 class ZoomBlurMain : public PluginVClient
207 ZoomBlurMain(PluginServer *server);
210 int process_buffer(VFrame *frame,
211 int64_t start_position,
214 void save_data(KeyFrame *keyframe);
215 void read_data(KeyFrame *keyframe);
219 PLUGIN_CLASS_MEMBERS(ZoomBlurConfig)
221 void delete_tables();
222 VFrame *input, *output, *temp;
223 ZoomBlurEngine *engine;
226 ZoomBlurLayer *layer_table;
228 int need_reconfigure;
229 // The accumulation buffer is needed because 8 bits isn't precise enough
230 unsigned char *accum;
233 class ZoomBlurPackage : public LoadPackage
240 class ZoomBlurUnit : public LoadClient
243 ZoomBlurUnit(ZoomBlurEngine *server, ZoomBlurMain *plugin);
244 void process_package(LoadPackage *package);
245 ZoomBlurEngine *server;
246 ZoomBlurMain *plugin;
249 class ZoomBlurEngine : public LoadServer
252 ZoomBlurEngine(ZoomBlurMain *plugin,
255 void init_packages();
256 LoadClient* new_client();
257 LoadPackage* new_package();
258 ZoomBlurMain *plugin;