remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / plugins / swapchannels / swapchannels.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 SWAPCHANNELS_H
23 #define SWAPCHANNELS_H
24
25 #include "bchash.inc"
26 #include "guicast.h"
27 #include "mutex.h"
28 #include "pluginvclient.h"
29 #include "vframe.inc"
30
31
32
33
34
35 class SwapMain;
36
37 #define RED_SRC 0
38 #define GREEN_SRC 1
39 #define BLUE_SRC 2
40 #define ALPHA_SRC 3
41 #define NO_SRC 4
42 #define MAX_SRC 5
43
44
45
46 class SwapConfig
47 {
48 public:
49         SwapConfig();
50
51         int equivalent(SwapConfig &that);
52         void copy_from(SwapConfig &that);
53
54         int red;
55         int green;
56         int blue;
57         int alpha;
58 };
59
60
61
62 class SwapMenu : public BC_PopupMenu
63 {
64 public:
65         SwapMenu(SwapMain *client, int *output, int x, int y);
66
67
68         int handle_event();
69         void create_objects();
70
71         SwapMain *client;
72         int *output;
73 };
74
75
76 class SwapItem : public BC_MenuItem
77 {
78 public:
79         SwapItem(SwapMenu *menu, const char *title);
80
81         int handle_event();
82
83         SwapMenu *menu;
84         char *title;
85 };
86
87 class SwapWindow : public PluginClientWindow
88 {
89 public:
90         SwapWindow(SwapMain *plugin);
91         ~SwapWindow();
92
93
94         void create_objects();
95
96         SwapMain *plugin;
97         SwapMenu *red;
98         SwapMenu *green;
99         SwapMenu *blue;
100         SwapMenu *alpha;
101 };
102
103
104
105
106
107
108
109 class SwapMain : public PluginVClient
110 {
111 public:
112         SwapMain(PluginServer *server);
113         ~SwapMain();
114
115         PLUGIN_CLASS_MEMBERS(SwapConfig)
116 // required for all realtime plugins
117         int process_buffer(VFrame *frame,
118                 int64_t start_position,
119                 double frame_rate);
120         int is_realtime();
121         int is_synthesis();
122         void update_gui();
123         void save_data(KeyFrame *keyframe);
124         void read_data(KeyFrame *keyframe);
125         int handle_opengl();
126
127
128
129
130
131
132
133         void reset();
134
135
136
137
138 // parameters needed for processor
139         const char* output_to_text(int value);
140         int text_to_output(const char *text);
141
142         VFrame *temp;
143 };
144
145
146 #endif