X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fperspective%2Fperspective.h;h=074e20ba043e156ed2481b49102f5663d07007a5;hb=b75f0c6910f5f1e1094f17874cd404e3f0faee8c;hp=e1b7580a2f68cf7e5f6f20d4b10858a5d9fc5044;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/perspective/perspective.h b/cinelerra-5.1/plugins/perspective/perspective.h index e1b7580a..074e20ba 100644 --- a/cinelerra-5.1/plugins/perspective/perspective.h +++ b/cinelerra-5.1/plugins/perspective/perspective.h @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include @@ -27,16 +27,24 @@ #include "clip.h" #include "bchash.h" #include "filexml.h" +#include "guicast.h" #include "keyframe.h" #include "loadbalance.h" #include "pluginvclient.h" #include "vframe.h" -class PerspectiveMain; -class PerspectiveWindow; - - +class PerspectiveConfig; +class PerspectiveCanvas; +class PerspectiveCoord; +class PerspectiveReset; +class PerspectiveMode; +class PerspectiveDirection; +class PerspectiveAffine; +class PerspectiveAffineItem; +class PerspectiveZoomView; +class PerspectiveWindow; +class PerspectiveMain; class PerspectiveConfig { @@ -45,14 +53,12 @@ public: int equivalent(PerspectiveConfig &that); void copy_from(PerspectiveConfig &that); - void interpolate(PerspectiveConfig &prev, - PerspectiveConfig &next, - int64_t prev_frame, - int64_t next_frame, - int64_t current_frame); + void interpolate(PerspectiveConfig &prev, PerspectiveConfig &next, + int64_t prev_frame, int64_t next_frame, int64_t current_frame); float x1, y1, x2, y2, x3, y3, x4, y4; - int mode; + float view_x, view_y, view_zoom; + int mode, smoothing; int window_w, window_h; int current_point; int forward; @@ -63,82 +69,104 @@ public: class PerspectiveCanvas : public BC_SubWindow { public: - PerspectiveCanvas(PerspectiveMain *plugin, - int x, - int y, - int w, - int h); + PerspectiveCanvas(PerspectiveWindow *gui, + int x, int y, int w, int h); int button_press_event(); int button_release_event(); int cursor_motion_event(); - int state; - enum - { - NONE, - DRAG, - DRAG_FULL, - ZOOM - }; + int state; + enum { NONE, DRAG, DRAG_FULL, ZOOM, DRAG_VIEW }; - int start_cursor_x, start_cursor_y; + int start_x, start_y; float start_x1, start_y1; float start_x2, start_y2; float start_x3, start_y3; float start_x4, start_y4; - PerspectiveMain *plugin; + PerspectiveWindow *gui; }; class PerspectiveCoord : public BC_TumbleTextBox { public: PerspectiveCoord(PerspectiveWindow *gui, - PerspectiveMain *plugin, - int x, - int y, - float value, - int is_x); + int x, int y, float value, int is_x); int handle_event(); - PerspectiveMain *plugin; + PerspectiveWindow *gui; int is_x; }; class PerspectiveReset : public BC_GenericButton { public: - PerspectiveReset(PerspectiveMain *plugin, - int x, - int y); + PerspectiveReset(PerspectiveWindow *gui, int x, int y); int handle_event(); - PerspectiveMain *plugin; + PerspectiveWindow *gui; }; class PerspectiveMode : public BC_Radial { public: - PerspectiveMode(PerspectiveMain *plugin, - int x, - int y, - int value, - char *text); + PerspectiveMode(PerspectiveWindow *gui, + int x, int y, int value, char *text); int handle_event(); - PerspectiveMain *plugin; + PerspectiveWindow *gui; int value; }; class PerspectiveDirection : public BC_Radial { public: - PerspectiveDirection(PerspectiveMain *plugin, - int x, - int y, - int value, - char *text); + PerspectiveDirection(PerspectiveWindow *gui, + int x, int y, int value, char *text); int handle_event(); - PerspectiveMain *plugin; + PerspectiveWindow *gui; int value; }; +class PerspectiveAffine : public BC_PopupMenu +{ + static const int n_modes = AffineEngine::AF_MODES; + const char *affine_modes[n_modes]; + PerspectiveAffineItem *affine_items[n_modes]; +public: + PerspectiveAffine(PerspectiveWindow *gui, int x, int y); + ~PerspectiveAffine(); + + void create_objects(); + void update(int mode, int send=1); + void affine_item(int id); + + PerspectiveWindow *gui; + int mode; +}; + +class PerspectiveAffineItem : public BC_MenuItem +{ +public: + PerspectiveAffineItem(const char *txt, int id) + : BC_MenuItem(txt) { this->id = id; } + + int handle_event(); + PerspectiveWindow *gui; + int id; +}; + +class PerspectiveZoomView : public BC_FSlider +{ +public: + PerspectiveZoomView(PerspectiveWindow *gui, + int x, int y, int w); + ~PerspectiveZoomView(); + + int handle_event(); + char *get_caption(); + void update(float zoom); + + PerspectiveWindow *gui; +}; + + class PerspectiveWindow : public PluginClientWindow { public: @@ -149,29 +177,24 @@ public: int resize_event(int x, int y); void update_canvas(); void update_mode(); + void update_view_zoom(); + void reset_view(); void update_coord(); - void calculate_canvas_coords(int &x1, - int &y1, - int &x2, - int &y2, - int &x3, - int &y3, - int &x4, - int &y4); + void calculate_canvas_coords( + int &x1, int &y1, int &x2, int &y2, + int &x3, int &y3, int &x4, int &y4); PerspectiveCanvas *canvas; PerspectiveCoord *x, *y; PerspectiveReset *reset; + PerspectiveZoomView *zoom_view; PerspectiveMode *mode_perspective, *mode_sheer, *mode_stretch; + PerspectiveAffine *affine; PerspectiveMain *plugin; PerspectiveDirection *forward, *reverse; }; - - - - class PerspectiveMain : public PluginVClient { public: @@ -199,13 +222,3 @@ public: }; - - - - - - - - - -