X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Faffine.h;h=1740d90545e1e3923fd2931fba8c3ad20ab7d065;hb=eecf057a9d6b8c8cffc7d0001bff89bc9cac7b05;hp=46119e2b1e202b0128b175cdc5e8d9f3da7aa920;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/affine.h b/cinelerra-5.1/cinelerra/affine.h index 46119e2b..1740d905 100644 --- a/cinelerra-5.1/cinelerra/affine.h +++ b/cinelerra-5.1/cinelerra/affine.h @@ -42,6 +42,11 @@ public: void multiply(AffineMatrix *dst); void copy_from(AffineMatrix *src); void invert(AffineMatrix *dst); +// in x1,y1 x2,y1 out x1,y1 x2,y2 +// x1,y2 x2,y2 x3,y3 x4,y4 + void set_matrix(double in_x1, double in_y1, double in_x2, double in_y2, + double out_x1, double out_y1, double out_x2, double out_y2, + double out_x3, double out_y3, double out_x4, double out_y4); void transform_point(float x, float y, float *newx, float *newy); double determinant(); void dump(); @@ -60,25 +65,7 @@ class AffineUnit : public LoadClient public: AffineUnit(AffineEngine *server); void process_package(LoadPackage *package); - void calculate_matrix( - double in_x1, - double in_y1, - double in_x2, - double in_y2, - double out_x1, - double out_y1, - double out_x2, - double out_y2, - double out_x3, - double out_y3, - double out_x4, - double out_y4, - AffineMatrix *result); - float transform_cubic(float dx, - float jm1, - float j, - float jp1, - float jp2); +// float transform_cubic(float dx, float jm1, float j, float jp1, float jp2); AffineEngine *server; }; @@ -90,25 +77,17 @@ public: // Range of coords is 0 to 100 for coordinates in the image. // The coordinate locations are clockwise around the image. - void process(VFrame *output, - VFrame *input, - VFrame *temp, - int mode, - float x1, - float y1, - float x2, - float y2, - float x3, - float y3, - float x4, - float y4, + void process(VFrame *output, VFrame *input, VFrame *temp, int mode, + float x1, float y1, float x2, float y2, + float x3, float y3, float x4, float y4, int forward); + void set_matrix( + double in_x1, double in_y1, double in_x2, double in_y2, + double out_x1, double out_y1, double out_x2, double out_y2, + double out_x3, double out_y3, double out_x4, double out_y4); // Do rotation with the affine/perspective transform. // This removes some of the extremely faint artifacts in the trig rotation. - void rotate(VFrame *output, - VFrame *input, - float angle); - void set_matrix(AffineMatrix *matrix); + void rotate(VFrame *output, VFrame *input, float angle); // Set the viewport to transform. The transform is based on the input viewport. // The output viewport clips the transformed output. void set_in_viewport(int x, int y, int w, int h); @@ -131,6 +110,8 @@ public: // Never used void unset_pivot(); void unset_viewport(); +// default: AF_CUBIC + void set_interpolation(int type); // To use OpenGL for the processing, set to 1 void set_opengl(int value); void init_packages(); @@ -140,8 +121,7 @@ public: VFrame *input, *output, *temp; int mode; - enum - { + enum { PERSPECTIVE, SHEER, STRETCH, @@ -149,6 +129,14 @@ public: // multiply directly by a matrix. TRANSFORM }; + int interpolation; + enum { + AF_DEFAULT, + AF_NEAREST, + AF_LINEAR, + AF_CUBIC, + AF_MODES + }; // arbitrary matrix AffineMatrix matrix;