add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / yuvshift / yuvshift.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 #ifndef YUVSHIFT_H
23 #define YUVSHIFT_H
24
25 #include "bcdisplayinfo.h"
26 #include "clip.h"
27 #include "bchash.h"
28 #include "filexml.h"
29 #include "guicast.h"
30 #include "language.h"
31 #include "bccolors.h"
32 #include "pluginvclient.h"
33 #include "vframe.h"
34
35 #include <stdint.h>
36 #include <string.h>
37
38
39 class YUVShiftEffect;
40 class YUVShiftWindow;
41 class YUVShiftReset;
42
43
44 class YUVShiftConfig
45 {
46 public:
47         YUVShiftConfig();
48
49         void reset();
50         void copy_from(YUVShiftConfig &src);
51         int equivalent(YUVShiftConfig &src);
52         void interpolate(YUVShiftConfig &prev,
53                 YUVShiftConfig &next,
54                 long prev_frame,
55                 long next_frame,
56                 long current_frame);
57
58         int y_dx, y_dy, u_dx, u_dy, v_dx, v_dy;
59 };
60
61 class YUVShiftLevel : public BC_ISlider
62 {
63 public:
64         YUVShiftLevel(YUVShiftEffect *plugin, int *output, int x, int y);
65         int handle_event();
66         YUVShiftEffect *plugin;
67         int *output;
68 };
69
70 class YUVShiftReset : public BC_GenericButton
71 {
72 public:
73         YUVShiftReset(YUVShiftEffect *plugin, YUVShiftWindow *window, int x, int y);
74         ~YUVShiftReset();
75         int handle_event();
76         YUVShiftEffect *plugin;
77         YUVShiftWindow *window;
78 };
79
80 class YUVShiftWindow : public PluginClientWindow
81 {
82 public:
83         YUVShiftWindow(YUVShiftEffect *plugin);
84         void create_objects();
85         void update();
86         YUVShiftLevel *y_dx, *y_dy, *u_dx, *u_dy, *v_dx, *v_dy;
87         YUVShiftEffect *plugin;
88         YUVShiftReset *reset;
89 };
90
91
92
93 class YUVShiftEffect : public PluginVClient
94 {
95         VFrame *temp_frame;
96 public:
97         YUVShiftEffect(PluginServer *server);
98         ~YUVShiftEffect();
99
100
101         PLUGIN_CLASS_MEMBERS(YUVShiftConfig)
102         int process_realtime(VFrame *input, VFrame *output);
103         int is_realtime();
104         void save_data(KeyFrame *keyframe);
105         void read_data(KeyFrame *keyframe);
106         void update_gui();
107 };
108
109 #endif