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 *plugin, LensGUI *gui,
45 LensText *text, float *output, int x, int y,
46 float min, float max);
55 class LensText : public BC_TextBox
58 LensText(LensMain *plugin, LensGUI *gui,
59 LensSlider *slider, float *output, int x, int y);
69 class LensToggle : public BC_CheckBox
72 LensToggle(LensMain *plugin, int *output, int x, int y,
81 class LensInterpItem : public BC_MenuItem
84 LensInterpItem(const char *text, int id);
90 class LensInterp : public BC_PopupMenu
93 LensInterp(LensMain *plugin, int x, int y);
94 void create_objects();
95 void set_value(int id);
103 class LensReset : public BC_GenericButton
106 LensReset(LensMain *plugin, LensGUI *gui, int x, int y);
114 class LensMode : public BC_PopupMenu
117 LensMode(LensMain *plugin, LensGUI *gui, int x, int y);
119 void create_objects();
120 static int calculate_w(LensGUI *gui);
121 static int from_text(char *text);
122 static const char* to_text(int mode);
123 void update(int mode);
129 class LensPresets : public BC_PopupMenu
132 LensPresets(LensMain *plugin, LensGUI *gui, int x, int y, int w);
134 void create_objects();
135 int from_text(LensMain *plugin, char *text);
136 const char* to_text(LensMain *plugin, int preset);
137 void update(int preset);
142 class LensSavePreset : public BC_GenericButton
145 LensSavePreset(LensMain *plugin, LensGUI *gui, int x, int y);
151 class LensDeletePreset : public BC_GenericButton
154 LensDeletePreset(LensMain *plugin, LensGUI *gui, int x, int y);
160 class LensPresetText : public BC_TextBox
163 LensPresetText(LensMain *plugin, LensGUI *gui, int x, int y, int w);
169 class LensGUI : public PluginClientWindow
172 LensGUI(LensMain *plugin);
175 void create_objects();
179 LensSlider *fov_slider[FOV_CHANNELS];
180 LensText *fov_text[FOV_CHANNELS];
181 LensSlider *aspect_slider;
182 LensText *aspect_text;
183 LensSlider *radius_slider;
184 LensText *radius_text;
185 LensSlider *centerx_slider;
186 LensText *centerx_text;
187 LensSlider *centery_slider;
188 LensText *centery_text;
192 // LensPresets *presets;
193 // LensSavePreset *save_preset;
194 // LensDeletePreset *delete_preset;
195 // LensPresetText *preset_text;
197 LensToggle *draw_guides;
205 int equivalent(LensConfig &that);
206 void copy_from(LensConfig &that);
207 void interpolate(LensConfig &prev, LensConfig &next,
208 int64_t prev_frame, int64_t next_frame, int64_t current_frame);
210 float fov[FOV_CHANNELS];
235 char title[BCTEXTLEN];
236 float fov[FOV_CHANNELS];
246 class LensPackage : public LoadPackage
254 class LensUnit : public LoadClient
257 LensUnit(LensEngine *engine, LensMain *plugin);
259 void process_package(LoadPackage *package);
260 void process_spherical_stretch(LensPackage *pkg);
261 void process_spherical_shrink(LensPackage *pkg);
262 void process_rectilinear_stretch(LensPackage *pkg);
263 void process_rectilinear_shrink(LensPackage *pkg);
268 class LensEngine : public LoadServer
271 LensEngine(LensMain *plugin);
274 void init_packages();
275 LoadClient* new_client();
276 LoadPackage* new_package();
282 class LensMain : public PluginVClient
285 LensMain(PluginServer *server);
288 PLUGIN_CLASS_MEMBERS(LensConfig)
289 int process_buffer(VFrame *frame,
290 int64_t start_position,
294 void save_data(KeyFrame *keyframe);
295 void read_data(KeyFrame *keyframe);
296 // void load_presets();
297 // void save_presets();
303 ArrayList<LensPreset*> presets;