r665: Merged the official release 2.0.
[cinelerra_cv.git] / plugins / colorbalance / colorbalance.h
blob2aa3f4ac128e20e10217988b9b2da10d455fe1f6
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 // -100 - 100
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_realtime(VFrame *input_ptr, VFrame *output_ptr);
65 int is_realtime();
66 char* plugin_title();
67 int show_gui();
68 void update_gui();
69 void raise_window();
70 int set_string();
71 int load_configuration();
72 void save_data(KeyFrame *keyframe);
73 void read_data(KeyFrame *keyframe);
74 int load_defaults();
75 int save_defaults();
76 VFrame* new_picon();
78 int64_t calculate_slider(float in);
79 float calculate_transfer(float in);
81 // parameters needed for processor
82 int reconfigure();
83 int synchronize_params(ColorBalanceSlider *slider, float difference);
84 int test_boundary(float &value);
86 ColorBalanceConfig config;
87 // a thread for the GUI
88 ColorBalanceThread *thread;
89 ColorBalanceEngine **engine;
90 int total_engines;
93 Defaults *defaults;
94 int r_lookup_8[0x100];
95 int g_lookup_8[0x100];
96 int b_lookup_8[0x100];
97 int r_lookup_16[0x10000];
98 int g_lookup_16[0x10000];
99 int b_lookup_16[0x10000];
100 int redo_buffers;
101 int need_reconfigure;
106 #endif