add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / shiftinterlace / shiftinterlace.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 SHIFTINTERLACE_H
23 #define SHIFTINTERLACE_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 "pluginvclient.h"
32 #include "vframe.h"
33
34
35
36 #include <stdint.h>
37 #include <string.h>
38
39
40
41
42
43
44
45 class ShiftInterlaceWindow;
46 class ShiftInterlaceMain;
47
48 class ShiftInterlaceConfig
49 {
50 public:
51         ShiftInterlaceConfig();
52
53         void reset();
54         int equivalent(ShiftInterlaceConfig &that);
55         void copy_from(ShiftInterlaceConfig &that);
56         void interpolate(ShiftInterlaceConfig &prev,
57                 ShiftInterlaceConfig &next,
58                 long prev_frame,
59                 long next_frame,
60                 long current_frame);
61
62
63         int odd_offset;
64         int even_offset;
65 };
66
67
68 class ShiftInterlaceOdd : public BC_ISlider
69 {
70 public:
71         ShiftInterlaceOdd(ShiftInterlaceMain *plugin, int x, int y);
72         int handle_event();
73         ShiftInterlaceMain *plugin;
74 };
75
76 class ShiftInterlaceEven : public BC_ISlider
77 {
78 public:
79         ShiftInterlaceEven(ShiftInterlaceMain *plugin, int x, int y);
80         int handle_event();
81         ShiftInterlaceMain *plugin;
82 };
83
84 class ShiftInterlaceReset : public BC_GenericButton
85 {
86 public:
87         ShiftInterlaceReset(ShiftInterlaceMain *plugin, ShiftInterlaceWindow *gui, int x, int y);
88         ~ShiftInterlaceReset();
89         int handle_event();
90         ShiftInterlaceMain *plugin;
91         ShiftInterlaceWindow *gui;
92 };
93
94 class ShiftInterlaceWindow : public PluginClientWindow
95 {
96 public:
97         ShiftInterlaceWindow(ShiftInterlaceMain *plugin);
98
99         void create_objects();
100         void update();
101
102         ShiftInterlaceOdd *odd_offset;
103         ShiftInterlaceEven *even_offset;
104         ShiftInterlaceMain *plugin;
105         ShiftInterlaceReset *reset;
106 };
107
108
109
110
111
112
113 class ShiftInterlaceMain : public PluginVClient
114 {
115 public:
116         ShiftInterlaceMain(PluginServer *server);
117         ~ShiftInterlaceMain();
118
119 // required for all realtime plugins
120         PLUGIN_CLASS_MEMBERS(ShiftInterlaceConfig)
121         int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
122         int is_realtime();
123         void update_gui();
124         void save_data(KeyFrame *keyframe);
125         void read_data(KeyFrame *keyframe);
126
127
128         void shift_row(VFrame *input_frame,
129                 VFrame *output_frame,
130                 int offset,
131                 int row);
132
133
134 };
135
136 #endif