initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / maskauto.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
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.
10  * 
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.
15  * 
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
19  * 
20  */
21
22 #ifndef MASKAUTO_H
23 #define MASKAUTO_H
24
25
26 #include "arraylist.h"
27 #include "auto.h"
28 #include "maskauto.inc"
29 #include "maskautos.inc"
30
31 class MaskPoint
32 {
33 public:
34         MaskPoint();
35
36         int operator==(MaskPoint& ptr);
37         MaskPoint& operator=(MaskPoint& ptr);
38         void copy_from(MaskPoint &ptr);
39
40         float x, y;
41 // Incoming acceleration
42         float control_x1, control_y1;
43 // Outgoing acceleration
44         float control_x2, control_y2;
45 };
46
47 class SubMask
48 {
49 public:
50         SubMask(MaskAuto *keyframe);
51         ~SubMask();
52
53 // Don't use ==
54         int operator==(SubMask& ptr);
55         int equivalent(SubMask& ptr);
56         void copy_from(SubMask& ptr);
57         void load(FileXML *file);
58         void copy(FileXML *file);
59         void dump();
60
61         ArrayList<MaskPoint*> points;
62         MaskAuto *keyframe;
63 };
64
65 class MaskAuto : public Auto
66 {
67 public:
68         MaskAuto(EDL *edl, MaskAutos *autos);
69         ~MaskAuto();
70         
71         int operator==(Auto &that);
72         int operator==(MaskAuto &that);
73         int identical(MaskAuto *src);
74         void load(FileXML *file);
75         void copy(int64_t start, int64_t end, FileXML *file, int default_auto);
76         void copy_from(Auto *src);
77         void copy_from(MaskAuto *src);
78 // Copy data but not position
79         void copy_data(MaskAuto *src);
80         void get_points(ArrayList<MaskPoint*> *points, 
81                 int submask);
82         void set_points(ArrayList<MaskPoint*> *points, 
83                 int submask);
84
85 // Copy parameters to this which differ between ref & src
86         void update_parameter(MaskAuto *ref, MaskAuto *src);
87
88         void dump();
89 // Retrieve submask with clamping
90         SubMask* get_submask(int number);
91 // Translates all submasks      
92         void translate_submasks(float translate_x, float translate_y);  
93
94
95         ArrayList<SubMask*> masks;
96 // These are constant for the entire track
97         int mode;
98         float feather;
99 // 0 - 100
100         int value;
101 };
102
103
104
105
106 #endif