4 * Copyright (C) 2008 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 #include "condition.inc"
27 #include "loadbalance.h"
28 #include "maskautos.inc"
29 #include "maskauto.inc"
33 typedef uint16_t temp_t; // temp is A16
48 class MaskPackage : public LoadPackage
58 class MaskUnit : public LoadClient
61 MaskUnit(MaskEngine *engine);
64 void clear_mask(VFrame *msk, int a);
65 void draw_line(int x1, int y1, int x2, int y2);
67 void draw_feather(int ix1,int iy1, int ix2,int iy2);
68 void draw_edge(int ix, int iy);
69 void draw_filled_polygon(MaskEdge &edge);
70 void feather_x(VFrame *in, VFrame *out);
71 void feather_y(VFrame *in, VFrame *out);
72 void mask_blend(VFrame *in, VFrame *mask, float r, float v);
73 void apply_mask_alpha(VFrame *output, VFrame *mask);
75 void process_package(LoadPackage *package);
85 class MaskEngine : public LoadServer
91 void do_mask(VFrame *output,
92 // Position relative to project, compensated for playback direction
93 int64_t start_position_project,
94 MaskAutos *keyframe_set,
96 MaskAuto *default_auto);
97 int points_equivalent(MaskPoints *new_points,
99 void clear_mask(VFrame *msk, int a);
100 void draw_point_spot(float r);
102 void delete_packages();
103 void init_packages();
104 LoadClient* new_client();
105 LoadPackage* new_package();
108 VFrame *mask, *in, *out;
110 MaskPointSets point_sets;
111 ArrayList<float> faders;
112 ArrayList<float> feathers;
113 int step, total_submasks;