11 #define MAXRADIUS 10000
13 #include "colorpicker.h"
15 #include "filexml.inc"
17 #include "loadbalance.h"
18 #include "overlayframe.inc"
19 #include "plugincolors.h"
20 #include "pluginvclient.h"
29 int equivalent(GradientConfig
&that
);
30 void copy_from(GradientConfig
&that
);
31 void interpolate(GradientConfig
&prev
,
36 // Int to hex triplet conversion
42 // LINEAR or LOG or SQUARE
58 int in_r
, in_g
, in_b
, in_a
;
59 int out_r
, out_g
, out_b
, out_a
;
63 class GradientShape
: public BC_PopupMenu
66 GradientShape(GradientMain
*plugin
,
70 void create_objects();
71 static char* to_text(int shape
);
72 static int from_text(char *text
);
79 class GradientRate
: public BC_PopupMenu
82 GradientRate(GradientMain
*plugin
,
85 void create_objects();
86 static char* to_text(int shape
);
87 static int from_text(char *text
);
93 class GradientCenterX
: public BC_FPot
96 GradientCenterX(GradientMain
*plugin
, int x
, int y
);
101 class GradientCenterY
: public BC_FPot
104 GradientCenterY(GradientMain
*plugin
, int x
, int y
);
106 GradientMain
*plugin
;
109 class GradientAngle
: public BC_FPot
112 GradientAngle(GradientMain
*plugin
, int x
, int y
);
114 GradientMain
*plugin
;
117 class GradientInRadius
: public BC_FSlider
120 GradientInRadius(GradientMain
*plugin
, int x
, int y
);
122 GradientMain
*plugin
;
125 class GradientOutRadius
: public BC_FSlider
128 GradientOutRadius(GradientMain
*plugin
, int x
, int y
);
130 GradientMain
*plugin
;
133 class GradientInColorButton
: public BC_GenericButton
136 GradientInColorButton(GradientMain
*plugin
, GradientWindow
*window
, int x
, int y
);
138 GradientMain
*plugin
;
139 GradientWindow
*window
;
143 class GradientOutColorButton
: public BC_GenericButton
146 GradientOutColorButton(GradientMain
*plugin
, GradientWindow
*window
, int x
, int y
);
148 GradientMain
*plugin
;
149 GradientWindow
*window
;
153 class GradientInColorThread
: public ColorThread
156 GradientInColorThread(GradientMain
*plugin
, GradientWindow
*window
);
157 virtual int handle_new_color(int output
, int alpha
);
158 GradientMain
*plugin
;
159 GradientWindow
*window
;
163 class GradientOutColorThread
: public ColorThread
166 GradientOutColorThread(GradientMain
*plugin
, GradientWindow
*window
);
167 virtual int handle_new_color(int output
, int alpha
);
168 GradientMain
*plugin
;
169 GradientWindow
*window
;
174 class GradientWindow
: public BC_Window
177 GradientWindow(GradientMain
*plugin
, int x
, int y
);
180 int create_objects();
182 void update_in_color();
183 void update_out_color();
186 GradientMain
*plugin
;
187 BC_Title
*angle_title
;
188 GradientAngle
*angle
;
189 GradientInRadius
*in_radius
;
190 GradientOutRadius
*out_radius
;
191 GradientInColorButton
*in_color
;
192 GradientOutColorButton
*out_color
;
193 GradientInColorThread
*in_color_thread
;
194 GradientOutColorThread
*out_color_thread
;
195 GradientShape
*shape
;
196 BC_Title
*shape_title
;
197 GradientCenterX
*center_x
;
198 BC_Title
*center_x_title
;
199 BC_Title
*center_y_title
;
200 GradientCenterY
*center_y
;
202 int in_color_x
, in_color_y
;
203 int out_color_x
, out_color_y
;
204 int shape_x
, shape_y
;
209 PLUGIN_THREAD_HEADER(GradientMain
, GradientThread
, GradientWindow
)
212 class GradientMain
: public PluginVClient
215 GradientMain(PluginServer
*server
);
218 int process_buffer(VFrame
*frame
,
219 int64_t start_position
,
224 void save_data(KeyFrame
*keyframe
);
225 void read_data(KeyFrame
*keyframe
);
230 PLUGIN_CLASS_MEMBERS(GradientConfig
, GradientThread
)
232 int need_reconfigure
;
234 OverlayFrame
*overlayer
;
236 VFrame
*input
, *output
;
237 GradientServer
*engine
;
240 class GradientPackage
: public LoadPackage
248 class GradientUnit
: public LoadClient
251 GradientUnit(GradientServer
*server
, GradientMain
*plugin
);
252 void process_package(LoadPackage
*package
);
253 GradientServer
*server
;
254 GradientMain
*plugin
;
258 class GradientServer
: public LoadServer
261 GradientServer(GradientMain
*plugin
, int total_clients
, int total_packages
);
262 void init_packages();
263 LoadClient
* new_client();
264 LoadPackage
* new_package();
265 GradientMain
*plugin
;