add stacked edl editing, add sketcher/vframe line anti-aliasing
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / foreground / foreground.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 FOREGROUND_H
22 #define FOREGROUND_H
23
24 class ForegroundConfig;
25 class ForegroundColors;
26 class ForegroundWindow;
27 class ForegroundMain;
28
29 #include "bccolors.h"
30 #include "colorpicker.h"
31 #include "filexml.inc"
32 #include "guicast.h"
33 #include "pluginvclient.h"
34 #include "vframe.inc"
35
36 class ForegroundConfig
37 {
38 public:
39         ForegroundConfig();
40
41         int equivalent(ForegroundConfig &that);
42         void copy_from(ForegroundConfig &that);
43         void interpolate(ForegroundConfig &prev, ForegroundConfig &next,
44                 long prev_frame, long next_frame, long current_frame);
45 // Int to hex triplet conversion
46         int get_color();
47
48         int r, g, b, a;
49 };
50
51 class ForegroundColors : public ColorGUI
52 {
53 public:
54         ForegroundColors(ForegroundWindow *window,
55                         ForegroundMain *plugin);
56         virtual ~ForegroundColors();
57
58         int handle_new_color(int color, int alpha);
59         void update_gui(int color, int alpha);
60
61         ForegroundWindow *window;
62         ForegroundMain *plugin;
63 };
64
65
66 class ForegroundWindow : public PluginClientWindow
67 {
68 public:
69         ForegroundWindow(ForegroundMain *plugin);
70         ~ForegroundWindow();
71
72         void create_objects();
73         void update();
74
75         int close_event() { return colors->close_gui(); }
76         int cursor_motion_event() { return colors->cursor_motion_gui(); }
77         int button_press_event() { return colors->button_press_gui(); }
78         int button_release_event() { return colors->button_release_gui(); }
79         void done_event(int result) { colors->close_gui(); }
80
81         ForegroundMain *plugin;
82         ForegroundColors *colors;
83 };
84
85 class ForegroundMain : public PluginVClient
86 {
87 public:
88         ForegroundMain(PluginServer *server);
89         ~ForegroundMain();
90
91         int process_buffer(VFrame *frame,
92                 int64_t start_position,
93                 double frame_rate);
94         int is_realtime();
95         void save_data(KeyFrame *keyframe);
96         void read_data(KeyFrame *keyframe);
97         void update_gui();
98         int is_synthesis();
99
100         PLUGIN_CLASS_MEMBERS(ForegroundConfig)
101         YUV yuv;
102 };
103
104 #endif