4 #include "loadbalance.h"
5 #include "overlayframe.inc"
16 int in_x2; // Might be same as in_x1 for boundary
18 float output_fraction;
24 class ScalePackage : public LoadPackage
29 int out_row1, out_row2;
33 class ScaleUnit : public LoadClient
36 ScaleUnit(ScaleEngine *server, OverlayFrame *overlay);
39 float cubic_bspline(float x);
40 void tabulate_bspline(float* &table,
45 void process_package(LoadPackage *package);
47 OverlayFrame *overlay;
50 class ScaleEngine : public LoadServer
53 ScaleEngine(OverlayFrame *overlay, int cpus);
57 LoadClient* new_client();
58 LoadPackage* new_package();
60 OverlayFrame *overlay;
69 class TranslateEngine;
71 class TranslatePackage : public LoadPackage
76 int out_row1, out_row2;
80 class TranslateUnit : public LoadClient
83 TranslateUnit(TranslateEngine *server, OverlayFrame *overlay);
86 void process_package(LoadPackage *package);
87 void translation_array(transfer_table* &table,
96 void translate(VFrame *output,
111 OverlayFrame *overlay;
114 class TranslateEngine : public LoadServer
117 TranslateEngine(OverlayFrame *overlay, int cpus);
120 void init_packages();
121 LoadClient* new_client();
122 LoadPackage* new_package();
124 OverlayFrame *overlay;
135 class ScaleTranslateEngine;
137 class ScaleTranslatePackage : public LoadPackage
140 ScaleTranslatePackage();
142 int out_row1, out_row2;
146 class ScaleTranslateUnit : public LoadClient
149 ScaleTranslateUnit(ScaleTranslateEngine *server, OverlayFrame *overlay);
150 ~ScaleTranslateUnit();
152 void process_package(LoadPackage *package);
153 void scale_array(int* &table,
160 OverlayFrame *overlay;
161 ScaleTranslateEngine *scale_translate;
164 class ScaleTranslateEngine : public LoadServer
167 ScaleTranslateEngine(OverlayFrame *overlay, int cpus);
168 ~ScaleTranslateEngine();
170 void init_packages();
171 LoadClient* new_client();
172 LoadPackage* new_package();
174 OverlayFrame *overlay;
208 class BlendPackage : public LoadPackage
213 int out_row1, out_row2;
217 class BlendUnit : public LoadClient
220 BlendUnit(BlendEngine *server, OverlayFrame *overlay);
223 void process_package(LoadPackage *package);
224 void translation_array(transfer_table* &table,
233 void translate(VFrame *output,
248 OverlayFrame *overlay;
249 BlendEngine *blend_engine;
252 class BlendEngine : public LoadServer
255 BlendEngine(OverlayFrame *overlay, int cpus);
258 void init_packages();
259 LoadClient* new_client();
260 LoadPackage* new_package();
262 OverlayFrame *overlay;
287 OverlayFrame(int cpus = 1);
288 virtual ~OverlayFrame();
290 // Alpha is from 0 - 1
291 int overlay(VFrame *output,
303 int interpolation_type);
305 int overlay(VFrame *output, unsigned char *input,
306 float in_x1, float in_y1, float in_x2, float in_y2,
307 float out_x1, float out_y1, float out_x2, float out_y2,
308 int alpha, int in_w, int in_h);
309 int use_alpha, use_float, mode, interpolate;
312 BlendEngine *blend_engine;
313 ScaleEngine *scale_engine;
314 TranslateEngine *translate_engine;
315 ScaleTranslateEngine *scaletranslate_engine;
321 // TODO: These should all be in their respective Engine
322 // Global parameters for scaling units
323 VFrame *scale_output;
331 int interpolation_type;
332 // Global parameters for translate units
333 VFrame *translate_output;
334 VFrame *translate_input;
335 float translate_in_x1;
336 float translate_in_y1;
337 float translate_in_x2;
338 float translate_in_y2;
339 float translate_out_x1;
340 float translate_out_y1;
341 float translate_out_x2;
342 float translate_out_y2;
343 float translate_alpha;