modify clr btn 16 plugins, add regdmp for sigtraps, rework mask_engine, mask rotate...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / huesaturation / huesaturation.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 HUESATURATION_H
23 #define HUESATURATION_H
24
25 #include "bccolors.h"
26 #include "bcdisplayinfo.h"
27 #include "clip.h"
28 #include "bchash.h"
29 #include "filexml.h"
30 #include "guicast.h"
31 #include "language.h"
32 #include "loadbalance.h"
33 #include "bccolors.h"
34 #include "playback3d.h"
35 #include "pluginvclient.h"
36 #include "vframe.h"
37
38 #include <stdint.h>
39 #include <string.h>
40
41
42 class HueEffect;
43 class HueWindow;
44 class HueReset;
45 class HueSliderClr;
46
47 #define MINHUE -180
48 #define MAXHUE 180
49 #define MINSATURATION -100
50 #define MAXSATURATION 100
51 #define MINVALUE -100
52 #define MAXVALUE 100
53
54 #define RESET_ALL 0
55 #define RESET_HUV 1
56 #define RESET_SAT 2
57 #define RESET_VAL 3
58
59
60 class HueConfig
61 {
62 public:
63         HueConfig();
64
65         void copy_from(HueConfig &src);
66         int equivalent(HueConfig &src);
67         void reset(int clear);
68         void interpolate(HueConfig &prev,
69                 HueConfig &next,
70                 long prev_frame,
71                 long next_frame,
72                 long current_frame);
73         float hue, saturation, value;
74 };
75
76 class HueSlider : public BC_FSlider
77 {
78 public:
79         HueSlider(HueEffect *plugin, int x, int y, int w);
80         int handle_event();
81         HueEffect *plugin;
82 };
83
84 class SaturationSlider : public BC_FSlider
85 {
86 public:
87         SaturationSlider(HueEffect *plugin, int x, int y, int w);
88         int handle_event();
89         char* get_caption();
90         HueEffect *plugin;
91         char string[BCTEXTLEN];
92 };
93
94 class ValueSlider : public BC_FSlider
95 {
96 public:
97         ValueSlider(HueEffect *plugin, int x, int y, int w);
98         int handle_event();
99         char* get_caption();
100         HueEffect *plugin;
101         char string[BCTEXTLEN];
102 };
103
104 class HueReset : public BC_GenericButton
105 {
106 public:
107         HueReset(HueEffect *plugin, HueWindow *gui, int x, int y);
108         ~HueReset();
109         int handle_event();
110         HueEffect *plugin;
111         HueWindow *gui;
112 };
113
114 class HueSliderClr : public BC_Button
115 {
116 public:
117         HueSliderClr(HueEffect *plugin, HueWindow *gui, int x, int y, int w, int clear);
118         ~HueSliderClr();
119         int handle_event();
120         HueEffect *plugin;
121         HueWindow *gui;
122         int clear;
123 };
124
125 class HueWindow : public PluginClientWindow
126 {
127 public:
128         HueWindow(HueEffect *plugin);
129         void create_objects();
130         void update_gui(int clear);
131         HueEffect *plugin;
132         HueSlider *hue;
133         SaturationSlider *saturation;
134         ValueSlider *value;
135         HueReset *reset;
136         HueSliderClr *hueClr;
137         HueSliderClr *satClr;
138         HueSliderClr *valClr;
139 };
140
141
142 class HueEngine : public LoadServer
143 {
144 public:
145         HueEngine(HueEffect *plugin, int cpus);
146         void init_packages();
147         LoadClient* new_client();
148         LoadPackage* new_package();
149         HueEffect *plugin;
150 };
151
152 class HuePackage : public LoadPackage
153 {
154 public:
155         HuePackage();
156         int row1, row2;
157 };
158
159 class HueUnit : public LoadClient
160 {
161 public:
162         HueUnit(HueEffect *plugin, HueEngine *server);
163         void process_package(LoadPackage *package);
164         HueEffect *plugin;
165 };
166
167 class HueEffect : public PluginVClient
168 {
169 public:
170         HueEffect(PluginServer *server);
171         ~HueEffect();
172
173
174         PLUGIN_CLASS_MEMBERS(HueConfig);
175         int process_buffer(VFrame *frame,
176                 int64_t start_position,
177                 double frame_rate);
178         int is_realtime();
179         void save_data(KeyFrame *keyframe);
180         void read_data(KeyFrame *keyframe);
181         void update_gui();
182         int handle_opengl();
183
184         VFrame *input, *output;
185         HueEngine *engine;
186 };
187
188 #endif
189