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
33 #include "whirlwindow.h"
34 #include "pluginvclient.h"
37 class WhirlMain : public PluginVClient
40 WhirlMain(int argc, char *argv[]);
43 // required for all realtime plugins
44 int process_realtime(long size, VFrame **input_ptr, VFrame **output_ptr);
45 int plugin_is_realtime();
46 int plugin_is_multi_channel();
47 const char* plugin_title();
50 PluginClientWindow* new_window();
51 int save_data(char *text);
52 int read_data(char *text);
55 int reconfigure(); // Rebuild tables
59 int automated_function;
68 class WhirlEngine : public Thread
71 WhirlEngine(WhirlMain *plugin, int start_y, int end_y);
74 int start_process_frame(VFrame **output, VFrame **input, int size);
75 int wait_process_frame();
78 int calc_undistorted_coords(double wx,
84 inline VWORD bilinear(double x, double y, VWORD *values)
93 m0 = (double)values[0] + x * ((double)values[1] - values[0]);
94 m1 = (double)values[2] + x * ((double)values[3] - values[2]);
95 return (VWORD)(m0 + y * (m1 - m0));
97 void get_pixel(const int &x, const int &y, VPixel *pixel, VPixel **input_rows);
103 VFrame **output, **input;
105 Mutex input_lock, output_lock;
106 double radius, radius2, radius3, pinch;
107 double scale_x, scale_y;