5 #include "bcdisplayinfo.h"
10 #include "loadbalance.h"
11 #include "picon_png.h"
12 #include "pluginvclient.h"
15 class PerspectiveMain
;
16 class PerspectiveWindow
;
17 class PerspectiveEngine
;
23 class PerspectiveConfig
28 int equivalent(PerspectiveConfig
&that
);
29 void copy_from(PerspectiveConfig
&that
);
30 void interpolate(PerspectiveConfig
&prev
,
31 PerspectiveConfig
&next
,
34 int64_t current_frame
);
36 float x1
, y1
, x2
, y2
, x3
, y3
, x4
, y4
;
38 int window_w
, window_h
;
51 class PerspectiveCanvas
: public BC_SubWindow
54 PerspectiveCanvas(PerspectiveMain
*plugin
,
59 int button_press_event();
60 int button_release_event();
61 int cursor_motion_event();
72 int start_cursor_x
, start_cursor_y
;
73 float start_x1
, start_y1
;
74 float start_x2
, start_y2
;
75 float start_x3
, start_y3
;
76 float start_x4
, start_y4
;
77 PerspectiveMain
*plugin
;
80 class PerspectiveCoord
: public BC_TumbleTextBox
83 PerspectiveCoord(PerspectiveWindow
*gui
,
84 PerspectiveMain
*plugin
,
90 PerspectiveMain
*plugin
;
94 class PerspectiveReset
: public BC_GenericButton
97 PerspectiveReset(PerspectiveMain
*plugin
,
101 PerspectiveMain
*plugin
;
104 class PerspectiveMode
: public BC_Radial
107 PerspectiveMode(PerspectiveMain
*plugin
,
113 PerspectiveMain
*plugin
;
117 class PerspectiveDirection
: public BC_Radial
120 PerspectiveDirection(PerspectiveMain
*plugin
,
126 PerspectiveMain
*plugin
;
130 class PerspectiveWindow
: public BC_Window
133 PerspectiveWindow(PerspectiveMain
*plugin
, int x
, int y
);
134 ~PerspectiveWindow();
136 int create_objects();
138 int resize_event(int x
, int y
);
139 void update_canvas();
142 void calculate_canvas_coords(int &x1
,
151 PerspectiveCanvas
*canvas
;
152 PerspectiveCoord
*x
, *y
;
153 PerspectiveReset
*reset
;
154 PerspectiveMode
*mode_perspective
, *mode_sheer
, *mode_stretch
;
155 PerspectiveMain
*plugin
;
156 PerspectiveDirection
*forward
, *reverse
;
161 PLUGIN_THREAD_HEADER(PerspectiveMain
, PerspectiveThread
, PerspectiveWindow
)
164 class PerspectiveMain
: public PluginVClient
167 PerspectiveMain(PluginServer
*server
);
170 int process_realtime(VFrame
*input_ptr
, VFrame
*output_ptr
);
174 void save_data(KeyFrame
*keyframe
);
175 void read_data(KeyFrame
*keyframe
);
178 PLUGIN_CLASS_MEMBERS(PerspectiveConfig
, PerspectiveThread
)
180 float get_current_x();
181 float get_current_y();
182 void set_current_x(float value
);
183 void set_current_y(float value
);
184 VFrame
*input
, *output
;
186 PerspectiveEngine
*engine
;
190 class PerspectiveMatrix
195 void translate(double x
, double y
);
196 void scale(double x
, double y
);
197 // Result is put in dst
198 void multiply(PerspectiveMatrix
*dst
);
199 void copy_from(PerspectiveMatrix
*src
);
200 void invert(PerspectiveMatrix
*dst
);
201 void transform_point(float x
, float y
, float *newx
, float *newy
);
202 double determinant();
207 class PerspectivePackage
: public LoadPackage
210 PerspectivePackage();
214 class PerspectiveUnit
: public LoadClient
217 PerspectiveUnit(PerspectiveEngine
*server
, PerspectiveMain
*plugin
);
218 void process_package(LoadPackage
*package
);
219 void calculate_matrix(
232 PerspectiveMatrix
*result
);
233 float PerspectiveUnit::transform_cubic(float dx
,
238 PerspectiveEngine
*server
;
239 PerspectiveMain
*plugin
;
242 class PerspectiveEngine
: public LoadServer
245 PerspectiveEngine(PerspectiveMain
*plugin
,
248 void init_packages();
249 LoadClient
* new_client();
250 LoadPackage
* new_package();
251 PerspectiveMain
*plugin
;