add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / radialblur / radialblur.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 RADIALBLUR_H
23 #define RADIALBLUR_H
24
25
26 #include <math.h>
27 #include <stdint.h>
28 #include <string.h>
29
30
31 #include "affine.h"
32 #include "bcdisplayinfo.h"
33 #include "clip.h"
34 #include "bchash.h"
35 #include "filexml.h"
36 #include "keyframe.h"
37 #include "language.h"
38 #include "loadbalance.h"
39 #include "pluginvclient.h"
40 #include "vframe.h"
41
42
43 class RadialBlurMain;
44 class RadialBlurWindow;
45 class RadialBlurEngine;
46 class RadialBlurReset;
47
48
49
50
51 class RadialBlurConfig
52 {
53 public:
54         RadialBlurConfig();
55
56         void reset();
57         int equivalent(RadialBlurConfig &that);
58         void copy_from(RadialBlurConfig &that);
59         void interpolate(RadialBlurConfig &prev,
60                 RadialBlurConfig &next,
61                 long prev_frame,
62                 long next_frame,
63                 long current_frame);
64
65         int x;
66         int y;
67         int steps;
68         int angle;
69         int r;
70         int g;
71         int b;
72         int a;
73 };
74
75
76
77 class RadialBlurSize : public BC_ISlider
78 {
79 public:
80         RadialBlurSize(RadialBlurMain *plugin,
81                 int x,
82                 int y,
83                 int *output,
84                 int min,
85                 int max);
86         int handle_event();
87         RadialBlurMain *plugin;
88         int *output;
89 };
90
91 class RadialBlurToggle : public BC_CheckBox
92 {
93 public:
94         RadialBlurToggle(RadialBlurMain *plugin,
95                 int x,
96                 int y,
97                 int *output,
98                 char *string);
99         int handle_event();
100         RadialBlurMain *plugin;
101         int *output;
102 };
103
104 class RadialBlurReset : public BC_GenericButton
105 {
106 public:
107         RadialBlurReset(RadialBlurMain *plugin, RadialBlurWindow *gui, int x, int y);
108         ~RadialBlurReset();
109         int handle_event();
110         RadialBlurMain *plugin;
111         RadialBlurWindow *gui;
112 };
113
114 class RadialBlurWindow : public PluginClientWindow
115 {
116 public:
117         RadialBlurWindow(RadialBlurMain *plugin);
118         ~RadialBlurWindow();
119
120         void create_objects();
121         void update();
122
123         RadialBlurSize *x, *y, *steps, *angle;
124         RadialBlurToggle *r, *g, *b, *a;
125         RadialBlurMain *plugin;
126         RadialBlurReset *reset;
127 };
128
129
130
131
132
133
134 class RadialBlurMain : public PluginVClient
135 {
136 public:
137         RadialBlurMain(PluginServer *server);
138         ~RadialBlurMain();
139
140         int process_buffer(VFrame *frame,
141                 int64_t start_position,
142                 double frame_rate);
143         int is_realtime();
144         void save_data(KeyFrame *keyframe);
145         void read_data(KeyFrame *keyframe);
146         void update_gui();
147         int handle_opengl();
148
149         PLUGIN_CLASS_MEMBERS(RadialBlurConfig)
150
151         VFrame *input, *output, *temp;
152         RadialBlurEngine *engine;
153 // Rotate engine only used for OpenGL
154         AffineEngine *rotate;
155 };
156
157 class RadialBlurPackage : public LoadPackage
158 {
159 public:
160         RadialBlurPackage();
161         int y1, y2;
162 };
163
164 class RadialBlurUnit : public LoadClient
165 {
166 public:
167         RadialBlurUnit(RadialBlurEngine *server, RadialBlurMain *plugin);
168         void process_package(LoadPackage *package);
169         RadialBlurEngine *server;
170         RadialBlurMain *plugin;
171 };
172
173 class RadialBlurEngine : public LoadServer
174 {
175 public:
176         RadialBlurEngine(RadialBlurMain *plugin,
177                 int total_clients,
178                 int total_packages);
179         void init_packages();
180         LoadClient* new_client();
181         LoadPackage* new_package();
182         RadialBlurMain *plugin;
183 };
184
185 #endif