initial commit
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / unsharp / unsharp.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 UNSHARP_H
23 #define UNSHARP_H
24
25 #include <math.h>
26 #include <stdint.h>
27 #include <string.h>
28
29 #include "bchash.inc"
30 #include "filexml.inc"
31 #include "keyframe.inc"
32 #include "loadbalance.h"
33 #include "pluginvclient.h"
34 #include "unsharp.inc"
35 #include "unsharpwindow.inc"
36 #include "vframe.inc"
37
38
39
40 class UnsharpConfig
41 {
42 public:
43         UnsharpConfig();
44
45         int equivalent(UnsharpConfig &that);
46         void copy_from(UnsharpConfig &that);
47         void interpolate(UnsharpConfig &prev,
48                 UnsharpConfig &next,
49                 int64_t prev_frame,
50                 int64_t next_frame,
51                 int64_t current_frame);
52         float radius;
53         float amount;
54         int threshold;
55 };
56
57
58
59
60 class UnsharpMain : public PluginVClient
61 {
62 public:
63         UnsharpMain(PluginServer *server);
64         ~UnsharpMain();
65
66         PLUGIN_CLASS_MEMBERS(UnsharpConfig)
67         int process_buffer(VFrame *frame,
68                 int64_t start_position,
69                 double frame_rate);
70         int is_realtime();
71         void save_data(KeyFrame *keyframe);
72         void read_data(KeyFrame *keyframe);
73         void update_gui();
74
75         UnsharpEngine *engine;
76 };
77
78
79 class UnsharpPackage : public LoadPackage
80 {
81 public:
82         UnsharpPackage();
83         int y1, y2;
84 };
85
86 class UnsharpUnit : public LoadClient
87 {
88 public:
89         UnsharpUnit(UnsharpEngine *server, UnsharpMain *plugin);
90         ~UnsharpUnit();
91
92         void process_package(LoadPackage *package);
93
94         UnsharpEngine *server;
95         UnsharpMain *plugin;
96         VFrame *temp;
97 };
98
99 class UnsharpEngine : public LoadServer
100 {
101 public:
102         UnsharpEngine(UnsharpMain *plugin,
103                 int total_clients,
104                 int total_packages);
105         ~UnsharpEngine();
106         void init_packages();
107         LoadClient* new_client();
108         LoadPackage* new_package();
109         void do_unsharp(VFrame *src);
110         VFrame *src;
111
112         UnsharpMain *plugin;
113 };
114
115
116
117
118 #endif
119
120
121
122
123
124