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
31 #include "loadbalance.h"
32 #include "pluginvclient.h"
35 class PerspectiveMain;
36 class PerspectiveWindow;
41 class PerspectiveConfig
46 int equivalent(PerspectiveConfig &that);
47 void copy_from(PerspectiveConfig &that);
48 void interpolate(PerspectiveConfig &prev,
49 PerspectiveConfig &next,
52 int64_t current_frame);
54 float x1, y1, x2, y2, x3, y3, x4, y4;
56 int window_w, window_h;
63 class PerspectiveCanvas : public BC_SubWindow
66 PerspectiveCanvas(PerspectiveMain *plugin,
71 int button_press_event();
72 int button_release_event();
73 int cursor_motion_event();
84 int start_cursor_x, start_cursor_y;
85 float start_x1, start_y1;
86 float start_x2, start_y2;
87 float start_x3, start_y3;
88 float start_x4, start_y4;
89 PerspectiveMain *plugin;
92 class PerspectiveCoord : public BC_TumbleTextBox
95 PerspectiveCoord(PerspectiveWindow *gui,
96 PerspectiveMain *plugin,
102 PerspectiveMain *plugin;
106 class PerspectiveReset : public BC_GenericButton
109 PerspectiveReset(PerspectiveMain *plugin,
113 PerspectiveMain *plugin;
116 class PerspectiveMode : public BC_Radial
119 PerspectiveMode(PerspectiveMain *plugin,
125 PerspectiveMain *plugin;
129 class PerspectiveDirection : public BC_Radial
132 PerspectiveDirection(PerspectiveMain *plugin,
138 PerspectiveMain *plugin;
142 class PerspectiveWindow : public PluginClientWindow
145 PerspectiveWindow(PerspectiveMain *plugin);
146 ~PerspectiveWindow();
148 void create_objects();
149 int resize_event(int x, int y);
150 void update_canvas();
153 void calculate_canvas_coords(int &x1,
162 PerspectiveCanvas *canvas;
163 PerspectiveCoord *x, *y;
164 PerspectiveReset *reset;
165 PerspectiveMode *mode_perspective, *mode_sheer, *mode_stretch;
166 PerspectiveMain *plugin;
167 PerspectiveDirection *forward, *reverse;
175 class PerspectiveMain : public PluginVClient
178 PerspectiveMain(PluginServer *server);
181 int process_buffer(VFrame *frame,
182 int64_t start_position,
185 void save_data(KeyFrame *keyframe);
186 void read_data(KeyFrame *keyframe);
190 PLUGIN_CLASS_MEMBERS(PerspectiveConfig)
192 float get_current_x();
193 float get_current_y();
194 void set_current_x(float value);
195 void set_current_y(float value);
196 VFrame *input, *output;
198 AffineEngine *engine;