r553: Modern gccs require __attribute__((used)) for variables used only in assembly.
[cinelerra_cv/mob.git] / cinelerra / maskengine.h
blobb91fd023588027fcab40e6b97186f1b759ae96d4
1 #ifndef MASKENGINE_H
2 #define MASKENGINE_H
5 #include "condition.inc"
6 #include "loadbalance.h"
7 #include "maskautos.inc"
8 #include "maskauto.inc"
9 #include "mutex.inc"
10 #include "vframe.inc"
13 #define OVERSAMPLE 8
14 #define NUM_SPANS 4 /* starting number of spans to be allocated for */
16 class MaskEngine;
19 enum
21 RECALCULATE_PART,
22 APPLY_PART
26 class MaskPackage : public LoadPackage
28 public:
29 MaskPackage();
30 ~MaskPackage();
32 int row1, row2;
35 class MaskUnit : public LoadClient
37 public:
38 MaskUnit(MaskEngine *engine);
39 ~MaskUnit();
41 void process_package(LoadPackage *package);
42 void draw_line_clamped(int x1, int y1, int x2, int y2, int w, int h, int hoffset);
43 void do_feather(VFrame *output,
44 VFrame *input,
45 float feather,
46 int start_out,
47 int end_out);
48 int do_feather_2(VFrame *output,
49 VFrame *input,
50 float feather,
51 int start_out,
52 int end_out);
53 void blur_strip(float *val_p,
54 float *val_m,
55 float *dst,
56 float *src,
57 int size,
58 int max);
60 float n_p[5], n_m[5];
61 float d_p[5], d_m[5];
62 float bd_p[5], bd_m[5];
63 MaskEngine *engine;
64 short **row_spans;
65 short row_spans_h;
69 class MaskEngine : public LoadServer
71 public:
72 MaskEngine(int cpus);
73 ~MaskEngine();
75 void do_mask(VFrame *output,
76 int64_t start_position,
77 double frame_rate,
78 double project_frame_rate,
79 MaskAutos *keyframe_set,
80 int direction);
81 int points_equivalent(ArrayList<MaskPoint*> *new_points,
82 ArrayList<MaskPoint*> *points);
84 void delete_packages();
85 void init_packages();
86 LoadClient* new_client();
87 LoadPackage* new_package();
89 VFrame *output;
90 // State of last mask
91 VFrame *mask;
92 // Temporary for feathering
93 VFrame *temp_mask;
94 ArrayList<ArrayList<MaskPoint*>*> point_sets;
95 int mode;
96 float feather; // gui feather
97 float realfeather; // real feather
98 int recalculate;
99 int value;
100 pthread_mutex_t stage1_finished_mutex;
101 pthread_cond_t stage1_finished_cond;
102 int stage1_finished_count;
103 Mutex protect_data; // protects the following members
104 int first_nonempty_rowspan;
105 int last_nonempty_rowspan;
110 #endif