no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / crop / crop.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 /*
23  * 2019. Derivative by Translate plugin. This plugin works also with Proxy.
24  * It uses Percent values instead of Pixel value coordinates.
25 */
26
27 #ifndef CROP_H
28 #define CROP_H
29
30 // the simplest plugin possible
31
32 class CropMain;
33
34 #include "bchash.h"
35 #include "mutex.h"
36 #include "cropwin.h"
37 #include "overlayframe.h"
38 #include "pluginvclient.h"
39
40 class CropConfig
41 {
42 public:
43         CropConfig();
44         void reset(int clear);
45         int equivalent(CropConfig &that);
46         void copy_from(CropConfig &that);
47         void interpolate(CropConfig &prev,
48                 CropConfig &next,
49                 int64_t prev_frame,
50                 int64_t next_frame,
51                 int64_t current_frame);
52
53         float crop_l, crop_t, crop_r, crop_b;
54         float position_x, position_y;
55 };
56
57
58 class CropMain : public PluginVClient
59 {
60 public:
61         CropMain(PluginServer *server);
62         ~CropMain();
63
64 // required for all realtime plugins
65         PLUGIN_CLASS_MEMBERS(CropConfig)
66         int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
67         int is_realtime();
68         void update_gui();
69         void save_data(KeyFrame *keyframe);
70         void read_data(KeyFrame *keyframe);
71
72
73         OverlayFrame *overlayer;   // To translate images
74         VFrame *temp_frame;
75 };
76
77
78 #endif