igor b reset btns, reframert bug fix
[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
46 #define MINHUE -180
47 #define MAXHUE 180
48 #define MINSATURATION -100
49 #define MAXSATURATION 100
50 #define MINVALUE -100
51 #define MAXVALUE 100
52
53
54
55
56
57
58 class HueConfig
59 {
60 public:
61         HueConfig();
62
63         void copy_from(HueConfig &src);
64         int equivalent(HueConfig &src);
65         void reset();
66         void interpolate(HueConfig &prev,
67                 HueConfig &next,
68                 long prev_frame,
69                 long next_frame,
70                 long current_frame);
71         float hue, saturation, value;
72 };
73
74 class HueSlider : public BC_FSlider
75 {
76 public:
77         HueSlider(HueEffect *plugin, int x, int y, int w);
78         int handle_event();
79         HueEffect *plugin;
80 };
81
82 class SaturationSlider : public BC_FSlider
83 {
84 public:
85         SaturationSlider(HueEffect *plugin, int x, int y, int w);
86         int handle_event();
87         char* get_caption();
88         HueEffect *plugin;
89         char string[BCTEXTLEN];
90 };
91
92 class ValueSlider : public BC_FSlider
93 {
94 public:
95         ValueSlider(HueEffect *plugin, int x, int y, int w);
96         int handle_event();
97         char* get_caption();
98         HueEffect *plugin;
99         char string[BCTEXTLEN];
100 };
101
102 class HueReset : public BC_GenericButton
103 {
104 public:
105         HueReset(HueEffect *plugin, HueWindow *gui, int x, int y);
106         ~HueReset();
107         int handle_event();
108         HueEffect *plugin;
109         HueWindow *gui;
110 };
111
112 class HueWindow : public PluginClientWindow
113 {
114 public:
115         HueWindow(HueEffect *plugin);
116         void create_objects();
117         void update();
118         HueEffect *plugin;
119         HueSlider *hue;
120         SaturationSlider *saturation;
121         ValueSlider *value;
122         HueReset *reset;
123 };
124
125
126 class HueEngine : public LoadServer
127 {
128 public:
129         HueEngine(HueEffect *plugin, int cpus);
130         void init_packages();
131         LoadClient* new_client();
132         LoadPackage* new_package();
133         HueEffect *plugin;
134 };
135
136 class HuePackage : public LoadPackage
137 {
138 public:
139         HuePackage();
140         int row1, row2;
141 };
142
143 class HueUnit : public LoadClient
144 {
145 public:
146         HueUnit(HueEffect *plugin, HueEngine *server);
147         void process_package(LoadPackage *package);
148         HueEffect *plugin;
149 };
150
151 class HueEffect : public PluginVClient
152 {
153 public:
154         HueEffect(PluginServer *server);
155         ~HueEffect();
156
157
158         PLUGIN_CLASS_MEMBERS(HueConfig);
159         int process_buffer(VFrame *frame,
160                 int64_t start_position,
161                 double frame_rate);
162         int is_realtime();
163         void save_data(KeyFrame *keyframe);
164         void read_data(KeyFrame *keyframe);
165         void update_gui();
166         int handle_opengl();
167
168         VFrame *input, *output;
169         HueEngine *engine;
170 };
171
172 #endif
173