add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.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 class SwapWindow;
37 class SwapReset;
38
39 #define RED_SRC 0
40 #define GREEN_SRC 1
41 #define BLUE_SRC 2
42 #define ALPHA_SRC 3
43 #define NO_SRC 4
44 #define MAX_SRC 5
45
46
47
48 class SwapConfig
49 {
50 public:
51         SwapConfig();
52
53         void reset_Config();
54         int equivalent(SwapConfig &that);
55         void copy_from(SwapConfig &that);
56
57         int red;
58         int green;
59         int blue;
60         int alpha;
61 };
62
63
64
65 class SwapMenu : public BC_PopupMenu
66 {
67 public:
68         SwapMenu(SwapMain *client, int *output, int x, int y);
69
70
71         int handle_event();
72         void create_objects();
73
74         SwapMain *client;
75         int *output;
76 };
77
78
79 class SwapItem : public BC_MenuItem
80 {
81 public:
82         SwapItem(SwapMenu *menu, const char *title);
83
84         int handle_event();
85
86         SwapMenu *menu;
87         char *title;
88 };
89
90
91 class SwapReset : public BC_GenericButton
92 {
93 public:
94         SwapReset(SwapMain *plugin, SwapWindow *gui, int x, int y);
95         ~SwapReset();
96         int handle_event();
97         SwapMain *plugin;
98         SwapWindow *gui;
99 };
100
101
102 class SwapWindow : public PluginClientWindow
103 {
104 public:
105         SwapWindow(SwapMain *plugin);
106         ~SwapWindow();
107
108         void create_objects();
109
110         SwapMain *plugin;
111         SwapMenu *red;
112         SwapMenu *green;
113         SwapMenu *blue;
114         SwapMenu *alpha;
115         SwapReset *reset;
116 };
117
118
119
120
121
122
123
124 class SwapMain : public PluginVClient
125 {
126 public:
127         SwapMain(PluginServer *server);
128         ~SwapMain();
129
130         PLUGIN_CLASS_MEMBERS(SwapConfig)
131 // required for all realtime plugins
132         int process_buffer(VFrame *frame,
133                 int64_t start_position,
134                 double frame_rate);
135         int is_realtime();
136         int is_synthesis();
137         void update_gui();
138         void save_data(KeyFrame *keyframe);
139         void read_data(KeyFrame *keyframe);
140         int handle_opengl();
141
142
143
144
145
146
147
148         void reset();
149
150
151
152
153 // parameters needed for processor
154         const char* output_to_text(int value);
155         int text_to_output(const char *text);
156
157         VFrame *temp;
158 };
159
160
161 #endif