Credit Andrew - updating patches for FFmpeg 7.0 as needed since 6.1, now at 7.0,...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / motion-cv / motionwindow-cv.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * Copyright (C) 2003-2016 Cinelerra CV contributors
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #include "guicast.h"
24
25 class MotionCVMain;
26 class MotionCVWindow;
27 class MotionCVScan;
28 class RotateCVScan;
29
30 class MasterLayer : public BC_PopupMenu
31 {
32 public:
33         MasterLayer(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y);
34         int handle_event();
35         void create_objects();
36         static int calculate_w(MotionCVWindow *gui);
37         static int from_text(char *text);
38         static const char* to_text(int mode);
39         MotionCVMain *plugin;
40         MotionCVWindow *gui;
41 };
42
43 class Mode1 : public BC_PopupMenu
44 {
45 public:
46         Mode1(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y);
47         int handle_event();
48         void create_objects();
49         static int calculate_w(MotionCVWindow *gui);
50         static int from_text(char *text);
51         static const char* to_text(int mode);
52         MotionCVMain *plugin;
53         MotionCVWindow *gui;
54 };
55
56 class Mode2 : public BC_PopupMenu
57 {
58 public:
59         Mode2(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y);
60         int handle_event();
61         void create_objects();
62         static int calculate_w(MotionCVWindow *gui);
63         static int from_text(char *text);
64         static const char* to_text(int mode);
65         MotionCVMain *plugin;
66         MotionCVWindow *gui;
67 };
68
69 class Mode3 : public BC_PopupMenu
70 {
71 public:
72         Mode3(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y);
73         int handle_event();
74         void create_objects();
75         static int calculate_w(MotionCVWindow *gui);
76         static void from_text(int *horizontal_only, int *vertical_only, char *text);
77         static const char* to_text(int horizontal_only, int vertical_only);
78         MotionCVMain *plugin;
79         MotionCVWindow *gui;
80 };
81
82
83 class TrackSingleFrame : public BC_Radial
84 {
85 public:
86         TrackSingleFrame(MotionCVMain *plugin,
87                 MotionCVWindow *gui,
88                 int x,
89                 int y);
90         int handle_event();
91         MotionCVMain *plugin;
92         MotionCVWindow *gui;
93 };
94
95 class TrackFrameNumber : public BC_TextBox
96 {
97 public:
98         TrackFrameNumber(MotionCVMain *plugin,
99                 MotionCVWindow *gui,
100                 int x,
101                 int y);
102         int handle_event();
103         MotionCVMain *plugin;
104         MotionCVWindow *gui;
105 };
106
107 class TrackPreviousFrame : public BC_Radial
108 {
109 public:
110         TrackPreviousFrame(MotionCVMain *plugin,
111                 MotionCVWindow *gui,
112                 int x,
113                 int y);
114         int handle_event();
115         MotionCVMain *plugin;
116         MotionCVWindow *gui;
117 };
118
119 class PreviousFrameSameBlock : public BC_Radial
120 {
121 public:
122         PreviousFrameSameBlock(MotionCVMain *plugin,
123                 MotionCVWindow *gui,
124                 int x,
125                 int y);
126         int handle_event();
127         MotionCVMain *plugin;
128         MotionCVWindow *gui;
129 };
130
131 class GlobalRange : public BC_IPot
132 {
133 public:
134         GlobalRange(MotionCVMain *plugin,
135                 int x,
136                 int y,
137                 int *value);
138         int handle_event();
139         MotionCVMain *plugin;
140         int *value;
141 };
142
143 class RotationRange : public BC_IPot
144 {
145 public:
146         RotationRange(MotionCVMain *plugin,
147                 int x,
148                 int y);
149         int handle_event();
150         MotionCVMain *plugin;
151 };
152
153 class BlockSize : public BC_IPot
154 {
155 public:
156         BlockSize(MotionCVMain *plugin,
157                 int x,
158                 int y,
159                 int *value);
160         int handle_event();
161         MotionCVMain *plugin;
162         int *value;
163 };
164
165 class MotionCVBlockX : public BC_FPot
166 {
167 public:
168         MotionCVBlockX(MotionCVMain *plugin,
169                 MotionCVWindow *gui,
170                 int x,
171                 int y);
172         int handle_event();
173         MotionCVWindow *gui;
174         MotionCVMain *plugin;
175 };
176
177 class MotionCVBlockY : public BC_FPot
178 {
179 public:
180         MotionCVBlockY(MotionCVMain *plugin,
181                 MotionCVWindow *gui,
182                 int x,
183                 int y);
184         int handle_event();
185         MotionCVWindow *gui;
186         MotionCVMain *plugin;
187 };
188
189 class MotionCVBlockXText : public BC_TextBox
190 {
191 public:
192         MotionCVBlockXText(MotionCVMain *plugin,
193                 MotionCVWindow *gui,
194                 int x,
195                 int y);
196         int handle_event();
197         MotionCVWindow *gui;
198         MotionCVMain *plugin;
199 };
200
201 class MotionCVBlockYText : public BC_TextBox
202 {
203 public:
204         MotionCVBlockYText(MotionCVMain *plugin,
205                 MotionCVWindow *gui,
206                 int x,
207                 int y);
208         int handle_event();
209         MotionCVWindow *gui;
210         MotionCVMain *plugin;
211 };
212
213 class GlobalSearchPositions : public BC_PopupMenu
214 {
215 public:
216         GlobalSearchPositions(MotionCVMain *plugin,
217                 int x,
218                 int y,
219                 int w);
220         void create_objects();
221         int handle_event();
222         MotionCVMain *plugin;
223 };
224
225 class RotationSearchPositions : public BC_PopupMenu
226 {
227 public:
228         RotationSearchPositions(MotionCVMain *plugin,
229                 int x,
230                 int y,
231                 int w);
232         void create_objects();
233         int handle_event();
234         MotionCVMain *plugin;
235 };
236
237 class MotionCVMagnitude : public BC_IPot
238 {
239 public:
240         MotionCVMagnitude(MotionCVMain *plugin,
241                 int x,
242                 int y);
243         int handle_event();
244         MotionCVMain *plugin;
245 };
246
247 class MotionCVReturnSpeed : public BC_IPot
248 {
249 public:
250         MotionCVReturnSpeed(MotionCVMain *plugin,
251                 int x,
252                 int y);
253         int handle_event();
254         MotionCVMain *plugin;
255 };
256
257
258
259 class MotionCVDrawVectors : public BC_CheckBox
260 {
261 public:
262         MotionCVDrawVectors(MotionCVMain *plugin,
263                 MotionCVWindow *gui,
264                 int x,
265                 int y);
266         int handle_event();
267         MotionCVMain *plugin;
268         MotionCVWindow *gui;
269 };
270
271 class AddTrackedFrameOffset : public BC_CheckBox
272 {
273 public:
274         AddTrackedFrameOffset(MotionCVMain *plugin,
275                 MotionCVWindow *gui,
276                 int x,
277                 int y);
278         int handle_event();
279         MotionCVWindow *gui;
280         MotionCVMain *plugin;
281 };
282
283 class MotionCVTrackingFile : public BC_TextBox
284 {
285 public:
286         MotionCVTrackingFile(MotionCVMain *plugin, const char *filename,
287                 MotionCVWindow *gui, int x, int y);
288         int handle_event();
289         MotionCVMain *plugin;
290         MotionCVWindow *gui;
291 };
292
293 class MotionCVGlobal : public BC_CheckBox
294 {
295 public:
296         MotionCVGlobal(MotionCVMain *plugin,
297                 MotionCVWindow *gui,
298                 int x,
299                 int y);
300         int handle_event();
301         MotionCVWindow *gui;
302         MotionCVMain *plugin;
303 };
304
305 class MotionCVRotate : public BC_CheckBox
306 {
307 public:
308         MotionCVRotate(MotionCVMain *plugin,
309                 MotionCVWindow *gui,
310                 int x,
311                 int y);
312         int handle_event();
313         MotionCVWindow *gui;
314         MotionCVMain *plugin;
315 };
316
317
318
319 class MotionCVWindow : public PluginClientWindow
320 {
321 public:
322         MotionCVWindow(MotionCVMain *plugin);
323         ~MotionCVWindow();
324
325         void create_objects();
326         void update_mode();
327         char* get_radius_title();
328
329         GlobalRange *global_range_w;
330         GlobalRange *global_range_h;
331         RotationRange *rotation_range;
332         BlockSize *global_block_w;
333         BlockSize *global_block_h;
334         BlockSize *rotation_block_w;
335         BlockSize *rotation_block_h;
336         MotionCVBlockX *block_x;
337         MotionCVBlockY *block_y;
338         MotionCVBlockXText *block_x_text;
339         MotionCVBlockYText *block_y_text;
340         GlobalSearchPositions *global_search_positions;
341         RotationSearchPositions *rotation_search_positions;
342         MotionCVMagnitude *magnitude;
343         MotionCVReturnSpeed *return_speed;
344         Mode1 *mode1;
345         MotionCVDrawVectors *vectors;
346         MotionCVTrackingFile *tracking_file;
347         MotionCVGlobal *global;
348         MotionCVRotate *rotate;
349         AddTrackedFrameOffset *addtrackedframeoffset;
350         TrackSingleFrame *track_single;
351         TrackFrameNumber *track_frame_number;
352         TrackPreviousFrame *track_previous;
353         PreviousFrameSameBlock *previous_same;
354         MasterLayer *master_layer;
355         Mode2 *mode2;
356         Mode3 *mode3;
357         BC_Title *pef_title;
358
359         MotionCVMain *plugin;
360 };
361
362