r869: Merge 2.1:
[cinelerra_cv.git] / plugins / colorbalance / colorbalance.h
blob9859f8d620dfe93b8428558f66f67ebc7c21d6b4
1 #ifndef COLORBALANCE_H
2 #define COLORBALANCE_H
4 class ColorBalanceMain;
6 #include "colorbalancewindow.h"
7 #include "condition.h"
8 #include "plugincolors.h"
9 #include "guicast.h"
10 #include "pluginvclient.h"
11 #include "thread.h"
13 #define SHADOWS 0
14 #define MIDTONES 1
15 #define HIGHLIGHTS 2
17 class ColorBalanceConfig
19 public:
20 ColorBalanceConfig();
22 int equivalent(ColorBalanceConfig &that);
23 void copy_from(ColorBalanceConfig &that);
24 void interpolate(ColorBalanceConfig &prev,
25 ColorBalanceConfig &next,
26 int64_t prev_frame,
27 int64_t next_frame,
28 int64_t current_frame);
30 // -1000 - 1000
31 float cyan;
32 float magenta;
33 float yellow;
34 int preserve;
35 int lock_params;
38 class ColorBalanceEngine : public Thread
40 public:
41 ColorBalanceEngine(ColorBalanceMain *plugin);
42 ~ColorBalanceEngine();
44 int start_process_frame(VFrame *output, VFrame *input, int row_start, int row_end);
45 int wait_process_frame();
46 void run();
48 ColorBalanceMain *plugin;
49 int row_start, row_end;
50 int last_frame;
51 Condition input_lock, output_lock;
52 VFrame *input, *output;
53 YUV yuv;
54 float cyan_f, magenta_f, yellow_f;
57 class ColorBalanceMain : public PluginVClient
59 public:
60 ColorBalanceMain(PluginServer *server);
61 ~ColorBalanceMain();
63 // required for all realtime plugins
64 int process_buffer(VFrame *frame,
65 int64_t start_position,
66 double frame_rate);
67 int is_realtime();
68 char* plugin_title();
69 int show_gui();
70 void update_gui();
71 void raise_window();
72 int set_string();
73 int load_configuration();
74 void save_data(KeyFrame *keyframe);
75 void read_data(KeyFrame *keyframe);
76 int load_defaults();
77 int save_defaults();
78 VFrame* new_picon();
79 int handle_opengl();
81 void get_aggregation(int *aggregate_interpolate,
82 int *aggregate_gamma);
85 int64_t calculate_slider(float in);
86 float calculate_transfer(float in);
88 // parameters needed for processor
89 int reconfigure();
90 int synchronize_params(ColorBalanceSlider *slider, float difference);
91 int test_boundary(float &value);
93 ColorBalanceConfig config;
94 // a thread for the GUI
95 ColorBalanceThread *thread;
96 ColorBalanceEngine **engine;
97 int total_engines;
100 BC_Hash *defaults;
101 int r_lookup_8[0x100];
102 int g_lookup_8[0x100];
103 int b_lookup_8[0x100];
104 int r_lookup_16[0x10000];
105 int g_lookup_16[0x10000];
106 int b_lookup_16[0x10000];
107 int redo_buffers;
108 int need_reconfigure;
113 #endif