11 #include "polarwindow.h"
12 #include "pluginvclient.h"
15 class PolarMain
: public PluginVClient
18 PolarMain(int argc
, char *argv
[]);
21 // required for all realtime plugins
22 int process_realtime(long size
, VFrame
**input_ptr
, VFrame
**output_ptr
);
23 int plugin_is_realtime();
24 int plugin_is_multi_channel();
33 int save_data(char *text
);
34 int read_data(char *text
);
37 int reconfigure(); // Rebuild tables
40 int polar_to_rectangular
;
43 int automated_function
;
47 // a thread for the GUI
55 class PolarEngine
: public Thread
58 PolarEngine(PolarMain
*plugin
, int start_y
, int end_y
);
61 int start_process_frame(VFrame
**output
, VFrame
**input
, int size
);
62 int wait_process_frame();
64 void get_pixel(const int &x
, const int &y
, VPixel
*pixel
, VPixel
**input_rows
);
65 int calc_undistorted_coords(int wx
,
69 inline VWORD
bilinear(double &x
, double &y
, VWORD
*values
)
78 m0
= (double)values
[0] + x
* ((double)values
[1] - values
[0]);
79 m1
= (double)values
[2] + x
* ((double)values
[3] - values
[2]);
80 return (VWORD
)(m0
+ y
* (m1
- m0
));
88 VFrame
**output
, **input
;
90 Mutex input_lock
, output_lock
;