r123: Merged HEAD and TEST. New stuff shall be committed to HEAD from now on.
[cinelerra_cv/mob.git] / plugins / colorbalance / colorbalance.h
blob18beb4ea16ff68bc8e721d1e5e25310be7eca7b1
1 #ifndef COLORBALANCE_H
2 #define COLORBALANCE_H
4 class ColorBalanceMain;
6 #include "colorbalancewindow.h"
7 #include "plugincolors.h"
8 #include "guicast.h"
9 #include "mutex.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 float cyan;
31 float magenta;
32 float yellow;
33 int preserve;
34 int lock_params;
37 class ColorBalanceEngine : public Thread
39 public:
40 ColorBalanceEngine(ColorBalanceMain *plugin);
41 ~ColorBalanceEngine();
43 int start_process_frame(VFrame *output, VFrame *input, int row_start, int row_end);
44 int wait_process_frame();
45 void run();
47 ColorBalanceMain *plugin;
48 int row_start, row_end;
49 int last_frame;
50 Mutex input_lock, output_lock;
51 VFrame *input, *output;
52 YUV yuv;
55 class ColorBalanceMain : public PluginVClient
57 public:
58 ColorBalanceMain(PluginServer *server);
59 ~ColorBalanceMain();
61 // required for all realtime plugins
62 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
63 int is_realtime();
64 char* plugin_title();
65 int show_gui();
66 void raise_window();
67 int set_string();
68 int load_configuration();
69 void save_data(KeyFrame *keyframe);
70 void read_data(KeyFrame *keyframe);
71 int load_defaults();
72 int save_defaults();
73 VFrame* new_picon();
75 // parameters needed for processor
76 int reconfigure();
77 int synchronize_params(ColorBalanceSlider *slider, float difference);
78 int test_boundary(float &value);
80 ColorBalanceConfig config;
81 // a thread for the GUI
82 ColorBalanceThread *thread;
83 ColorBalanceEngine **engine;
84 int total_engines;
87 Defaults *defaults;
88 int r_lookup_8[0x100];
89 int g_lookup_8[0x100];
90 int b_lookup_8[0x100];
91 double highlights_add_8[0x100];
92 double highlights_sub_8[0x100];
93 int r_lookup_16[0x10000];
94 int g_lookup_16[0x10000];
95 int b_lookup_16[0x10000];
96 double highlights_add_16[0x10000];
97 double highlights_sub_16[0x10000];
98 int redo_buffers;
99 int need_reconfigure;
104 #endif