4 * Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
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.
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.
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
27 #include "loadbalance.h"
29 #include "pluginvclient.h"
41 void copy_from(HistEqConfig &that);
42 int equivalent(HistEqConfig &that);
43 void interpolate(HistEqConfig &prev, HistEqConfig &next,
44 int64_t prev_frame, int64_t next_frame, int64_t current_frame);
47 class HistEqSplit : public BC_CheckBox
50 HistEqSplit(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
58 class HistEqPlot : public BC_CheckBox
61 HistEqPlot(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
69 class HistEqBlend : public BC_FSlider
72 HistEqBlend(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
80 class HistEqGain : public BC_FSlider
83 HistEqGain(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
91 class HistEqCanvas : public BC_SubWindow
94 HistEqCanvas(HistEqWindow *gui, HistEqMain *plugin,
95 int x, int y, int w, int h);
97 void draw_bins(HistEqMain *plugin);
98 void draw_wts(HistEqMain *plugin);
99 void draw_reg(HistEqMain *plugin);
100 void draw_lut(HistEqMain *plugin);
101 void update(HistEqMain *plugin);
107 class HistEqWindow : public PluginClientWindow
110 HistEqWindow(HistEqMain *plugin);
118 HistEqCanvas *canvas;
120 void create_objects();
124 class HistEqMain : public PluginVClient
127 HistEqMain(PluginServer *server);
130 int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
132 void save_data(KeyFrame *keyframe);
133 void read_data(KeyFrame *keyframe);
136 void render_gui(void *data);
138 PLUGIN_CLASS_MEMBERS(HistEqConfig)
140 VFrame *input, *output;
141 HistEqEngine *engine;
145 int binsz, bsz, *bins;
146 int lutsz, lsz, *lut;
150 class HistEqPackage : public LoadPackage
157 class HistEqUnit : public LoadClient
160 HistEqUnit(HistEqEngine *server, HistEqMain *plugin);
162 void process_package(LoadPackage *package);
163 HistEqEngine *server;
169 class HistEqEngine : public LoadServer
172 HistEqEngine(HistEqMain *plugin, int total_clients, int total_packages);
173 void process_packages(int operation, VFrame *data);
174 void init_packages();
175 LoadClient* new_client();
176 LoadPackage* new_package();
180 enum { HISTEQ, APPLY };