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
25 #include "condition.inc"
39 RotateFrame(int cpus, int width, int height);
43 void rotate(VFrame *output,
47 int rotate_rightangle(VFrame *input,
50 int rotate_obliqueangle(VFrame *input,
54 int get_rightdimensions(VFrame *frame,
66 RotateEngine **engine;
67 // Matrix of source pixel offsets
68 int *int_matrix, **int_rows;
69 // Interpolation uses input coordinates for each output coordinate.
70 SourceCoord *float_matrix, **float_rows;
71 VFrame *output, *input;
74 // Compare new angle with old angle
80 class RotateEngine : public Thread
83 RotateEngine(RotateFrame *plugin, int row1, int row2);
86 int generate_matrix(int interpolate);
87 int perform_rotation(VFrame *input,
90 int wait_completion();
92 int coords_to_pixel(int &input_y, int &input_x);
93 int coords_to_pixel(SourceCoord &float_pixel, float &input_y, float &input_x);
94 int perform_rotation();
99 int do_matrix, do_rotation;
102 Condition *input_lock;
103 Condition *output_lock;