3 * Copyright (C) 2020 William Morrow
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "loadbalance.h"
28 #include "pluginvclient.h"
40 void copy_from(HistEqConfig &that);
41 int equivalent(HistEqConfig &that);
42 void interpolate(HistEqConfig &prev, HistEqConfig &next,
43 int64_t prev_frame, int64_t next_frame, int64_t current_frame);
46 class HistEqSplit : public BC_CheckBox
49 HistEqSplit(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
57 class HistEqPlot : public BC_CheckBox
60 HistEqPlot(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
68 class HistEqBlend : public BC_FSlider
71 HistEqBlend(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
79 class HistEqGain : public BC_FSlider
82 HistEqGain(HistEqWindow *gui, HistEqMain *plugin, int x, int y);
90 class HistEqCanvas : public BC_SubWindow
93 HistEqCanvas(HistEqWindow *gui, HistEqMain *plugin,
94 int x, int y, int w, int h);
96 void draw_bins(HistEqMain *plugin);
97 void draw_wts(HistEqMain *plugin);
98 void draw_reg(HistEqMain *plugin);
99 void draw_lut(HistEqMain *plugin);
100 void update(HistEqMain *plugin);
106 class HistEqWindow : public PluginClientWindow
109 HistEqWindow(HistEqMain *plugin);
117 HistEqCanvas *canvas;
119 void create_objects();
123 class HistEqMain : public PluginVClient
126 HistEqMain(PluginServer *server);
129 int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
131 void save_data(KeyFrame *keyframe);
132 void read_data(KeyFrame *keyframe);
135 void render_gui(void *data);
137 PLUGIN_CLASS_MEMBERS(HistEqConfig)
139 VFrame *input, *output;
140 HistEqEngine *engine;
144 int binsz, bsz, *bins;
145 int lutsz, lsz, *lut;
149 class HistEqPackage : public LoadPackage
156 class HistEqUnit : public LoadClient
159 HistEqUnit(HistEqEngine *server, HistEqMain *plugin);
161 void process_package(LoadPackage *package);
162 HistEqEngine *server;
168 class HistEqEngine : public LoadServer
171 HistEqEngine(HistEqMain *plugin, int total_clients, int total_packages);
172 void process_packages(int operation, VFrame *data);
173 void init_packages();
174 LoadClient* new_client();
175 LoadPackage* new_package();
179 enum { HISTEQ, APPLY };