remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / plugins / edge / edge.h
1 /*
2  * CINELERRA
3  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21
22
23 #ifndef EDGE_H
24 #define EDGE_H
25
26 #include "loadbalance.h"
27 #include "pluginvclient.h"
28
29 class EdgeEngine;
30 class Edge;
31
32 class EdgeConfig
33 {
34 public:
35         EdgeConfig();
36
37         int equivalent(EdgeConfig &that);
38         void copy_from(EdgeConfig &that);
39         void interpolate(EdgeConfig &prev,
40                 EdgeConfig &next,
41                 long prev_frame,
42                 long next_frame,
43                 long current_frame);
44         void limits();
45
46
47         int amount;
48 };
49
50 class EdgePackage : public LoadPackage
51 {
52 public:
53         EdgePackage();
54         int y1;
55         int y2;
56 };
57
58 class EdgeUnit : public LoadClient
59 {
60 public:
61         EdgeUnit(EdgeEngine *server);
62         ~EdgeUnit();
63         float edge_detect(float *data, float max, int do_max);
64         void process_package(LoadPackage *package);
65         EdgeEngine *server;
66 };
67
68
69 class EdgeEngine : public LoadServer
70 {
71 public:
72         EdgeEngine(Edge *plugin,
73                 int total_clients,
74                 int total_packages);
75         ~EdgeEngine();
76
77         void init_packages();
78         void process(VFrame *dst, VFrame *src);
79
80         LoadClient* new_client();
81         LoadPackage* new_package();
82         VFrame *src, *dst;
83         Edge *plugin;
84 };
85
86
87 class Edge : public PluginVClient
88 {
89 public:
90         Edge(PluginServer *server);
91         ~Edge();
92 // required for all realtime plugins
93         PLUGIN_CLASS_MEMBERS2(EdgeConfig)
94         int is_realtime();
95         void update_gui();
96         void save_data(KeyFrame *keyframe);
97         void read_data(KeyFrame *keyframe);
98         int process_buffer(VFrame *frame,
99                 int64_t start_position,
100                 double frame_rate);
101
102         EdgeEngine *engine;
103         VFrame *temp;
104 };
105
106
107
108 #endif
109
110
111