6 #include "loadbalance.h"
9 // Affine transform library
11 #define AFFINE_OVERSAMPLE 2
18 void translate(double x
, double y
);
19 void scale(double x
, double y
);
20 // Result is put in dst
21 void multiply(AffineMatrix
*dst
);
22 void copy_from(AffineMatrix
*src
);
23 void invert(AffineMatrix
*dst
);
24 void transform_point(float x
, float y
, float *newx
, float *newy
);
30 class AffinePackage
: public LoadPackage
37 class AffineUnit
: public LoadClient
40 AffineUnit(AffineEngine
*server
);
41 void process_package(LoadPackage
*package
);
42 void calculate_matrix(
55 AffineMatrix
*result
);
56 float transform_cubic(float dx
,
64 class AffineEngine
: public LoadServer
67 AffineEngine(int total_clients
,
70 // Temp is only used for STRETCH oversampling
71 // Range of coords is 0 to 100 for coordinates in the image.
72 // The coordinate locations are clockwise around the image.
73 void process(VFrame
*output
,
86 // Do rotation with the affine/perspective transform.
87 // This removes some of the extremely faint artifacts in the trig rotation.
88 void rotate(VFrame
*output
,
91 // Set the viewport to transform. All operations are clamped to this area
92 // instead of the frame dimensions. The rotation operation centers on this
94 void set_viewport(int x
, int y
, int w
, int h
);
95 // For rotation, set the pivot point. The default is in the middle of the viewport.
96 void set_pivot(int x
, int y
);
98 void unset_viewport();
99 // To use OpenGL for the processing, set to 1
100 void set_opengl(int value
);
101 void init_packages();
102 LoadClient
* new_client();
103 LoadPackage
* new_package();
104 VFrame
*input
, *output
, *temp
;
113 float x1
, y1
, x2
, y2
, x3
, y3
, x4
, y4
;
115 int pivot_x
, pivot_y
;