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
49 class ZoomBlurDefaultSettings;
50 class ZoomBlurSliderClr;
59 void reset(int clear);
60 int equivalent(ZoomBlurConfig &that);
61 void copy_from(ZoomBlurConfig &that);
62 void interpolate(ZoomBlurConfig &prev,
80 class ZoomBlurSize : public BC_ISlider
83 ZoomBlurSize(ZoomBlurMain *plugin,
94 class ZoomBlurToggle : public BC_CheckBox
97 ZoomBlurToggle(ZoomBlurMain *plugin,
103 ZoomBlurMain *plugin;
107 class ZoomBlurWindow : public PluginClientWindow
110 ZoomBlurWindow(ZoomBlurMain *plugin);
113 void create_objects();
114 void update_gui(int clear);
116 ZoomBlurSize *x, *y, *radius, *steps;
117 ZoomBlurToggle *r, *g, *b, *a;
118 ZoomBlurMain *plugin;
119 ZoomBlurReset *reset;
120 ZoomBlurDefaultSettings *default_settings;
121 ZoomBlurSliderClr *xClr, *yClr, *radiusClr, *stepsClr;
124 class ZoomBlurReset : public BC_GenericButton
127 ZoomBlurReset(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y);
130 ZoomBlurMain *plugin;
131 ZoomBlurWindow *window;
134 class ZoomBlurDefaultSettings : public BC_GenericButton
137 ZoomBlurDefaultSettings(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int w);
138 ~ZoomBlurDefaultSettings();
140 ZoomBlurMain *plugin;
141 ZoomBlurWindow *window;
145 class ZoomBlurSliderClr : public BC_Button
148 ZoomBlurSliderClr(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int w, int clear);
149 ~ZoomBlurSliderClr();
151 ZoomBlurMain *plugin;
152 ZoomBlurWindow *window;
158 // Output coords for a layer of blurring
159 // Used for OpenGL only
164 float x1, y1, x2, y2;
167 class ZoomBlurMain : public PluginVClient
170 ZoomBlurMain(PluginServer *server);
173 int process_buffer(VFrame *frame,
174 int64_t start_position,
177 void save_data(KeyFrame *keyframe);
178 void read_data(KeyFrame *keyframe);
182 PLUGIN_CLASS_MEMBERS(ZoomBlurConfig)
184 void delete_tables();
185 VFrame *input, *output, *temp;
186 ZoomBlurEngine *engine;
189 ZoomBlurLayer *layer_table;
191 int need_reconfigure;
192 // The accumulation buffer is needed because 8 bits isn't precise enough
193 unsigned char *accum;
196 class ZoomBlurPackage : public LoadPackage
203 class ZoomBlurUnit : public LoadClient
206 ZoomBlurUnit(ZoomBlurEngine *server, ZoomBlurMain *plugin);
207 void process_package(LoadPackage *package);
208 ZoomBlurEngine *server;
209 ZoomBlurMain *plugin;
212 class ZoomBlurEngine : public LoadServer
215 ZoomBlurEngine(ZoomBlurMain *plugin,
218 void init_packages();
219 LoadClient* new_client();
220 LoadPackage* new_package();
221 ZoomBlurMain *plugin;