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
30 #include "bcdisplayinfo.h"
36 #include "loadbalance.h"
37 #include "pluginvclient.h"
40 #define RESET_DEFAULT_SETTINGS 10
42 #define RESET_RADIUS 1
47 class LinearBlurWindow;
48 class LinearBlurEngine;
49 class LinearBlurReset;
50 class LinearBlurDefaultSettings;
51 class LinearBlurSliderClr;
55 class LinearBlurConfig
60 void reset(int clear);
61 int equivalent(LinearBlurConfig &that);
62 void copy_from(LinearBlurConfig &that);
63 void interpolate(LinearBlurConfig &prev,
64 LinearBlurConfig &next,
80 class LinearBlurSize : public BC_ISlider
83 LinearBlurSize(LinearBlurMain *plugin,
90 LinearBlurMain *plugin;
94 class LinearBlurToggle : public BC_CheckBox
97 LinearBlurToggle(LinearBlurMain *plugin,
103 LinearBlurMain *plugin;
107 class LinearBlurReset : public BC_GenericButton
110 LinearBlurReset(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y);
113 LinearBlurMain *plugin;
114 LinearBlurWindow *gui;
117 class LinearBlurDefaultSettings : public BC_GenericButton
120 LinearBlurDefaultSettings(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y, int w);
121 ~LinearBlurDefaultSettings();
123 LinearBlurMain *plugin;
124 LinearBlurWindow *gui;
127 class LinearBlurSliderClr : public BC_Button
130 LinearBlurSliderClr(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y, int w, int clear);
131 ~LinearBlurSliderClr();
133 LinearBlurMain *plugin;
134 LinearBlurWindow *gui;
138 class LinearBlurWindow : public PluginClientWindow
141 LinearBlurWindow(LinearBlurMain *plugin);
144 void create_objects();
145 void update_gui(int clear);
147 LinearBlurSize *angle, *steps, *radius;
148 LinearBlurToggle *r, *g, *b, *a;
149 LinearBlurMain *plugin;
150 LinearBlurReset *reset;
151 LinearBlurDefaultSettings *default_settings;
152 LinearBlurSliderClr *radiusClr;
153 LinearBlurSliderClr *angleClr;
154 LinearBlurSliderClr *stepsClr;
161 // Output coords for a layer of blurring
162 // Used for OpenGL only
163 class LinearBlurLayer
166 LinearBlurLayer() {};
170 class LinearBlurMain : public PluginVClient
173 LinearBlurMain(PluginServer *server);
176 int process_buffer(VFrame *frame,
177 int64_t start_position,
180 void save_data(KeyFrame *keyframe);
181 void read_data(KeyFrame *keyframe);
185 PLUGIN_CLASS_MEMBERS(LinearBlurConfig)
187 void delete_tables();
188 VFrame *input, *output, *temp;
189 LinearBlurEngine *engine;
192 LinearBlurLayer *layer_table;
194 int need_reconfigure;
195 // The accumulation buffer is needed because 8 bits isn't precise enough
196 unsigned char *accum;
199 class LinearBlurPackage : public LoadPackage
206 class LinearBlurUnit : public LoadClient
209 LinearBlurUnit(LinearBlurEngine *server, LinearBlurMain *plugin);
210 void process_package(LoadPackage *package);
211 LinearBlurEngine *server;
212 LinearBlurMain *plugin;
215 class LinearBlurEngine : public LoadServer
218 LinearBlurEngine(LinearBlurMain *plugin,
221 void init_packages();
222 LoadClient* new_client();
223 LoadPackage* new_package();
224 LinearBlurMain *plugin;