5 #include "pluginvclient.h"
8 // C41_FAST_POW increases processing speed more than 10 times
9 // Depending on gcc version, used optimizations and cpu C41_FAST_POW may not work
10 // With gcc versiion >= 4.4 it seems safe to enable C41_FAST_POW
11 // Test some samples after you have enabled it
20 // Shave the image in order to avoid black borders
21 // The min max pixel value difference must be at least 0.05
22 #define C41_SHAVE_TOLERANCE 0.05
23 #define C41_SHAVE_MARGIN 0.1
43 float gamma_g, gamma_b;
45 int shave_min_row, shave_max_row;
46 int shave_min_col, shave_max_col;
54 void copy_from(C41Config &src);
55 int equivalent(C41Config &src);
56 void interpolate(C41Config &prev, C41Config &next,
57 long prev_frame, long next_frame, long current_frame);
59 int active, compute_magic;
60 int postproc, show_box;
61 float fix_min_r, fix_min_g, fix_min_b;
62 float fix_light, fix_gamma_g, fix_gamma_b;
63 float fix_coef1, fix_coef2;
64 int min_col, max_col, min_row, max_row;
65 int window_w, window_h;
68 class C41Enable : public BC_CheckBox
71 C41Enable(C41Effect *plugin, int *output, int x, int y, const char *text);
78 class C41TextBox : public BC_TextBox
81 C41TextBox(C41Effect *plugin, float *value, int x, int y);
88 class C41Button : public BC_GenericButton
91 C41Button(C41Effect *plugin, C41Window *window, int x, int y);
98 class C41BoxButton : public BC_GenericButton
101 C41BoxButton(C41Effect *plugin, C41Window *window, int x, int y);
108 class C41Slider : public BC_ISlider
111 C41Slider(C41Effect *plugin, int *output, int x, int y, int is_row);
121 class C41Window : public PluginClientWindow
124 C41Window(C41Effect *client);
125 void create_objects();
131 C41Enable *compute_magic;
142 BC_Title *box_col_min;
143 BC_Title *box_col_max;
144 BC_Title *box_row_min;
145 BC_Title *box_row_max;
146 C41TextBox *fix_min_r;
147 C41TextBox *fix_min_g;
148 C41TextBox *fix_min_b;
149 C41TextBox *fix_light;
150 C41TextBox *fix_gamma_g;
151 C41TextBox *fix_gamma_b;
152 C41TextBox *fix_coef1;
153 C41TextBox *fix_coef2;
155 C41BoxButton *boxlock;
165 class C41Effect : public PluginVClient
168 C41Effect(PluginServer *server);
171 PLUGIN_CLASS_MEMBERS(C41Config);
175 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
176 void save_data(KeyFrame *keyframe);
177 void read_data(KeyFrame *keyframe);
178 void render_gui(void* data);
179 #if defined(C41_FAST_POW)
180 float myLog2(float i) __attribute__ ((optimize(0)));
181 float myPow2(float i) __attribute__ ((optimize(0)));
182 float myPow(float a, float b);
184 void pix_fix(float &pix, float min, float gamma);
185 VFrame *frame, *tmp_frame, *blurry_frame;
188 int shave_min_row, shave_max_row, shave_min_col, shave_max_col;
189 int min_col, max_col, min_row, max_row;