6f146ad81afea804c169d12dbb55699eac60af0f
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / alpha / alpha.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008-2019 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 #ifndef __ALPHA_H__
22 #define __ALPHA_H__
23
24 class AlphaConfig;
25 class AlphaColors;
26 class AlphaWindow;
27 class AlphaMain;
28
29 #include "bccolors.h"
30 #include "filexml.inc"
31 #include "guicast.h"
32 #include "pluginvclient.h"
33 #include "vframe.inc"
34
35 class AlphaConfig
36 {
37 public:
38         AlphaConfig();
39
40         int equivalent(AlphaConfig &that);
41         void copy_from(AlphaConfig &that);
42         void interpolate(AlphaConfig &prev, AlphaConfig &next,
43                 long prev_frame, long next_frame, long current_frame);
44
45         float a;
46 };
47
48 class AlphaSlider : public BC_FSlider
49 {
50 public:
51         AlphaSlider(AlphaWindow *window, AlphaMain *plugin, int x, int y, int w);
52         ~AlphaSlider();
53         int handle_event();
54
55         AlphaWindow *window;
56         AlphaMain *plugin;
57 };
58
59
60 class AlphaWindow : public PluginClientWindow
61 {
62 public:
63         AlphaWindow(AlphaMain *plugin);
64         ~AlphaWindow();
65
66         void create_objects();
67         void update();
68
69         AlphaMain *plugin;
70         AlphaSlider *alpha_slider;
71 };
72
73 class AlphaMain : public PluginVClient
74 {
75 public:
76         AlphaMain(PluginServer *server);
77         ~AlphaMain();
78
79         int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
80         int is_realtime();
81         void save_data(KeyFrame *keyframe);
82         void read_data(KeyFrame *keyframe);
83         void update_gui();
84         int is_synthesis();
85
86         PLUGIN_CLASS_MEMBERS(AlphaConfig)
87 };
88
89 #endif