add igors mask svgs, add composer clear_color pref, remove key DEL for mask gui,...
[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 "theme.h"
33 #include "vframe.h"
34
35
36
37 #include <stdint.h>
38 #include <string.h>
39
40
41 #define RESET_ALL 0
42 #define RESET_ODD_OFFSET  1
43 #define RESET_EVEN_OFFSET 2
44
45
46 class ShiftInterlaceWindow;
47 class ShiftInterlaceMain;
48
49 class ShiftInterlaceConfig
50 {
51 public:
52         ShiftInterlaceConfig();
53
54         void reset(int clear);
55         int equivalent(ShiftInterlaceConfig &that);
56         void copy_from(ShiftInterlaceConfig &that);
57         void interpolate(ShiftInterlaceConfig &prev,
58                 ShiftInterlaceConfig &next,
59                 long prev_frame,
60                 long next_frame,
61                 long current_frame);
62
63
64         int odd_offset;
65         int even_offset;
66 };
67
68
69 class ShiftInterlaceOdd : public BC_ISlider
70 {
71 public:
72         ShiftInterlaceOdd(ShiftInterlaceMain *plugin, int x, int y);
73         int handle_event();
74         ShiftInterlaceMain *plugin;
75 };
76
77 class ShiftInterlaceEven : public BC_ISlider
78 {
79 public:
80         ShiftInterlaceEven(ShiftInterlaceMain *plugin, int x, int y);
81         int handle_event();
82         ShiftInterlaceMain *plugin;
83 };
84
85 class ShiftInterlaceReset : public BC_GenericButton
86 {
87 public:
88         ShiftInterlaceReset(ShiftInterlaceMain *plugin, ShiftInterlaceWindow *gui, int x, int y);
89         ~ShiftInterlaceReset();
90         int handle_event();
91         ShiftInterlaceMain *plugin;
92         ShiftInterlaceWindow *gui;
93 };
94
95 class ShiftInterlaceSliderClr : public BC_Button
96 {
97 public:
98         ShiftInterlaceSliderClr(ShiftInterlaceMain *plugin, ShiftInterlaceWindow *gui, int x, int y, int w, int clear);
99         ~ShiftInterlaceSliderClr();
100         int handle_event();
101         ShiftInterlaceMain *plugin;
102         ShiftInterlaceWindow *gui;
103         int clear;
104 };
105
106 class ShiftInterlaceWindow : public PluginClientWindow
107 {
108 public:
109         ShiftInterlaceWindow(ShiftInterlaceMain *plugin);
110
111         void create_objects();
112         void update_gui(int clear);
113
114         ShiftInterlaceOdd *odd_offset;
115         ShiftInterlaceEven *even_offset;
116         ShiftInterlaceMain *plugin;
117         ShiftInterlaceReset *reset;
118         ShiftInterlaceSliderClr *odd_offsetClr, *even_offsetClr;
119 };
120
121
122
123
124
125
126 class ShiftInterlaceMain : public PluginVClient
127 {
128 public:
129         ShiftInterlaceMain(PluginServer *server);
130         ~ShiftInterlaceMain();
131
132 // required for all realtime plugins
133         PLUGIN_CLASS_MEMBERS(ShiftInterlaceConfig)
134         int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
135         int is_realtime();
136         void update_gui();
137         void save_data(KeyFrame *keyframe);
138         void read_data(KeyFrame *keyframe);
139
140
141         void shift_row(VFrame *input_frame,
142                 VFrame *output_frame,
143                 int offset,
144                 int row);
145
146
147 };
148
149 #endif