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
22 #ifndef COLORBALANCE_H
23 #define COLORBALANCE_H
25 class ColorBalanceMain;
27 #include "colorbalancewindow.h"
28 #include "condition.h"
31 #include "pluginvclient.h"
38 class ColorBalanceConfig
42 void reset(int clear);
44 int equivalent(ColorBalanceConfig &that);
45 void copy_from(ColorBalanceConfig &that);
46 void interpolate(ColorBalanceConfig &prev,
47 ColorBalanceConfig &next,
50 int64_t current_frame);
60 class ColorBalanceEngine : public Thread
63 ColorBalanceEngine(ColorBalanceMain *plugin);
64 ~ColorBalanceEngine();
66 int start_process_frame(VFrame *output, VFrame *input, int row_start, int row_end);
67 int wait_process_frame();
70 ColorBalanceMain *plugin;
71 int row_start, row_end;
73 Condition input_lock, output_lock;
74 VFrame *input, *output;
75 float cyan_f, magenta_f, yellow_f;
78 class ColorBalanceMain : public PluginVClient
81 ColorBalanceMain(PluginServer *server);
84 // required for all realtime plugins
85 PLUGIN_CLASS_MEMBERS(ColorBalanceConfig);
86 int process_buffer(VFrame *frame,
87 int64_t start_position,
91 void save_data(KeyFrame *keyframe);
92 void read_data(KeyFrame *keyframe);
95 void get_aggregation(int *aggregate_interpolate,
96 int *aggregate_gamma);
99 int64_t calculate_slider(float in);
100 float calculate_transfer(float in);
102 // parameters needed for processor
104 int synchronize_params(ColorBalanceSlider *slider, float difference);
105 int test_boundary(float &value);
107 ColorBalanceEngine **engine;
111 int r_lookup_8[0x100];
112 int g_lookup_8[0x100];
113 int b_lookup_8[0x100];
114 int r_lookup_16[0x10000];
115 int g_lookup_16[0x10000];
116 int b_lookup_16[0x10000];
118 int need_reconfigure;