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 int cubic_bspline(float x);
40 void tabulate_bspline(int* &table,
44 void tabulate_blinear(int* &table_int,
50 void process_package(LoadPackage *package);
52 OverlayFrame *overlay;
55 class ScaleEngine : public LoadServer
58 ScaleEngine(OverlayFrame *overlay, int cpus);
62 LoadClient* new_client();
63 LoadPackage* new_package();
65 OverlayFrame *overlay;
74 class TranslateEngine;
76 class TranslatePackage : public LoadPackage
81 int out_row1, out_row2;
85 class TranslateUnit : public LoadClient
88 TranslateUnit(TranslateEngine *server, OverlayFrame *overlay);
91 void process_package(LoadPackage *package);
92 void translation_array(transfer_table* &table,
101 void translate(VFrame *output,
116 OverlayFrame *overlay;
119 class TranslateEngine : public LoadServer
122 TranslateEngine(OverlayFrame *overlay, int cpus);
125 void init_packages();
126 LoadClient* new_client();
127 LoadPackage* new_package();
129 OverlayFrame *overlay;
140 class ScaleTranslateEngine;
142 class ScaleTranslatePackage : public LoadPackage
145 ScaleTranslatePackage();
147 int out_row1, out_row2;
151 class ScaleTranslateUnit : public LoadClient
154 ScaleTranslateUnit(ScaleTranslateEngine *server, OverlayFrame *overlay);
155 ~ScaleTranslateUnit();
157 void process_package(LoadPackage *package);
158 void scale_array(int* &table,
165 OverlayFrame *overlay;
166 ScaleTranslateEngine *scale_translate;
169 class ScaleTranslateEngine : public LoadServer
172 ScaleTranslateEngine(OverlayFrame *overlay, int cpus);
173 ~ScaleTranslateEngine();
175 void init_packages();
176 LoadClient* new_client();
177 LoadPackage* new_package();
179 OverlayFrame *overlay;
213 class BlendPackage : public LoadPackage
218 int out_row1, out_row2;
222 class BlendUnit : public LoadClient
225 BlendUnit(BlendEngine *server, OverlayFrame *overlay);
228 void process_package(LoadPackage *package);
229 void translation_array(transfer_table* &table,
238 void translate(VFrame *output,
253 OverlayFrame *overlay;
254 BlendEngine *blend_engine;
257 class BlendEngine : public LoadServer
260 BlendEngine(OverlayFrame *overlay, int cpus);
263 void init_packages();
264 LoadClient* new_client();
265 LoadPackage* new_package();
267 OverlayFrame *overlay;
292 OverlayFrame(int cpus = 1);
293 virtual ~OverlayFrame();
295 // Alpha is from 0 - 1
296 int overlay(VFrame *output,
308 int interpolation_type);
310 int overlay(VFrame *output, unsigned char *input,
311 float in_x1, float in_y1, float in_x2, float in_y2,
312 float out_x1, float out_y1, float out_x2, float out_y2,
313 int alpha, int in_w, int in_h);
314 int use_alpha, use_float, mode, interpolate;
317 BlendEngine *blend_engine;
318 ScaleEngine *scale_engine;
319 TranslateEngine *translate_engine;
320 ScaleTranslateEngine *scaletranslate_engine;
326 // TODO: These should all be in their respective Engine
327 // Global parameters for scaling units
328 VFrame *scale_output;
336 int interpolation_type;
337 // Global parameters for translate units
338 VFrame *translate_output;
339 VFrame *translate_input;
340 float translate_in_x1;
341 float translate_in_y1;
342 float translate_in_x2;
343 float translate_in_y2;
344 float translate_out_x1;
345 float translate_out_y1;
346 float translate_out_x2;
347 float translate_out_y2;
348 float translate_alpha;