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
26 class Color3WayEngine;
33 #define ROOT_2 1.414214
35 #include "color3waywindow.h"
36 #include "condition.h"
39 #include "loadbalance.h"
40 #include "pluginvclient.h"
49 int equivalent(Color3WayConfig &that);
50 void copy_from(Color3WayConfig &that);
51 void interpolate(Color3WayConfig &prev,
52 Color3WayConfig &next,
55 int64_t current_frame);
57 void copy_to_all(int section);
59 float hue_x[SECTIONS];
60 float hue_y[SECTIONS];
61 float value[SECTIONS];
62 float saturation[SECTIONS];
69 class Color3WayPackage : public LoadPackage
77 class Color3WayUnit : public LoadClient
80 Color3WayUnit(Color3WayMain *plugin, Color3WayEngine *server);
81 void process_package(LoadPackage *package);
82 Color3WayMain *plugin;
85 class Color3WayEngine : public LoadServer
88 Color3WayEngine(Color3WayMain *plugin, int cpus);
91 LoadClient* new_client();
92 LoadPackage* new_package();
93 Color3WayMain *plugin;
99 class Color3WayMain : public PluginVClient
102 Color3WayMain(PluginServer *server);
105 // required for all realtime plugins
106 PLUGIN_CLASS_MEMBERS2(Color3WayConfig);
107 int process_buffer(VFrame *frame,
108 int64_t start_position,
112 void save_data(KeyFrame *keyframe);
113 void read_data(KeyFrame *keyframe);
115 void get_aggregation(int *aggregate_interpolate,
116 int *aggregate_gamma);
118 void calculate_factors(float *r, float *g, float *b, int section);
119 void calculate_factors(float *r, float *g, float *b, float x, float y);
120 void process_pixel(float *r,
129 // parameters needed for processor
132 Color3WayEngine *engine;
136 int r_lookup_8[0x100];
137 int g_lookup_8[0x100];
138 int b_lookup_8[0x100];
139 int r_lookup_16[0x10000];
140 int g_lookup_16[0x10000];
141 int b_lookup_16[0x10000];
143 int need_reconfigure;
144 int copy_to_all[SECTIONS];