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 "loadbalance.h"
29 #include "pluginvclient.h"
38 #define FOV_CHANNELS 4
41 class LensSlider : public BC_FSlider
44 LensSlider(LensMain *client,
60 class LensText : public BC_TextBox
63 LensText(LensMain *client,
78 class LensToggle : public BC_CheckBox
81 LensToggle(LensMain *client,
93 class LensMode : public BC_PopupMenu
96 LensMode(LensMain *plugin,
101 void create_objects();
102 static int calculate_w(LensGUI *gui);
103 static int from_text(char *text);
104 static const char* to_text(int mode);
105 void update(int mode);
111 class LensPresets : public BC_PopupMenu
114 LensPresets(LensMain *plugin,
120 void create_objects();
121 int from_text(LensMain *plugin, char *text);
122 const char* to_text(LensMain *plugin, int preset);
123 void update(int preset);
128 class LensSavePreset : public BC_GenericButton
131 LensSavePreset(LensMain *plugin,
140 class LensDeletePreset : public BC_GenericButton
143 LensDeletePreset(LensMain *plugin,
152 class LensPresetText : public BC_TextBox
155 LensPresetText(LensMain *plugin,
165 class LensGUI : public PluginClientWindow
168 LensGUI(LensMain *client);
171 void create_objects();
174 LensSlider *fov_slider[FOV_CHANNELS];
175 LensText *fov_text[FOV_CHANNELS];
176 LensSlider *aspect_slider;
177 LensText *aspect_text;
178 LensSlider *radius_slider;
179 LensText *radius_text;
180 LensSlider *centerx_slider;
181 LensText *centerx_text;
182 LensSlider *centery_slider;
183 LensText *centery_text;
185 // LensPresets *presets;
186 // LensSavePreset *save_preset;
187 // LensDeletePreset *delete_preset;
188 // LensPresetText *preset_text;
190 LensToggle *draw_guides;
197 int equivalent(LensConfig &that);
198 void copy_from(LensConfig &that);
199 void interpolate(LensConfig &prev,
203 int64_t current_frame);
205 float fov[FOV_CHANNELS];
225 char title[BCTEXTLEN];
226 float fov[FOV_CHANNELS];
236 class LensPackage : public LoadPackage
244 class LensUnit : public LoadClient
247 LensUnit(LensEngine *engine, LensMain *plugin);
249 void process_package(LoadPackage *package);
250 void process_stretch(LensPackage *pkg);
251 void process_shrink(LensPackage *pkg);
252 void process_rectilinear_stretch(LensPackage *pkg);
253 void process_rectilinear_shrink(LensPackage *pkg);
258 class LensEngine : public LoadServer
261 LensEngine(LensMain *plugin);
264 void init_packages();
265 LoadClient* new_client();
266 LoadPackage* new_package();
271 class LensMain : public PluginVClient
274 LensMain(PluginServer *server);
277 PLUGIN_CLASS_MEMBERS(LensConfig)
278 int process_buffer(VFrame *frame,
279 int64_t start_position,
283 void save_data(KeyFrame *keyframe);
284 void read_data(KeyFrame *keyframe);
285 // void load_presets();
286 // void save_presets();
292 ArrayList<LensPreset*> presets;