bg/clr color tweaks, clear borders rework, fc31 depends
[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         void reset(int clear);
45
46         int equivalent(UnsharpConfig &that);
47         void copy_from(UnsharpConfig &that);
48         void interpolate(UnsharpConfig &prev,
49                 UnsharpConfig &next,
50                 int64_t prev_frame,
51                 int64_t next_frame,
52                 int64_t current_frame);
53         float radius;
54         float amount;
55         int threshold;
56 };
57
58
59
60
61 class UnsharpMain : public PluginVClient
62 {
63 public:
64         UnsharpMain(PluginServer *server);
65         ~UnsharpMain();
66
67         PLUGIN_CLASS_MEMBERS(UnsharpConfig)
68         int process_buffer(VFrame *frame,
69                 int64_t start_position,
70                 double frame_rate);
71         int is_realtime();
72         void save_data(KeyFrame *keyframe);
73         void read_data(KeyFrame *keyframe);
74         void update_gui();
75
76         UnsharpEngine *engine;
77 };
78
79
80 class UnsharpPackage : public LoadPackage
81 {
82 public:
83         UnsharpPackage();
84         int y1, y2;
85 };
86
87 class UnsharpUnit : public LoadClient
88 {
89 public:
90         UnsharpUnit(UnsharpEngine *server, UnsharpMain *plugin);
91         ~UnsharpUnit();
92
93         void process_package(LoadPackage *package);
94
95         UnsharpEngine *server;
96         UnsharpMain *plugin;
97         VFrame *temp;
98 };
99
100 class UnsharpEngine : public LoadServer
101 {
102 public:
103         UnsharpEngine(UnsharpMain *plugin,
104                 int total_clients,
105                 int total_packages);
106         ~UnsharpEngine();
107         void init_packages();
108         LoadClient* new_client();
109         LoadPackage* new_package();
110         void do_unsharp(VFrame *src);
111         VFrame *src;
112
113         UnsharpMain *plugin;
114 };
115
116
117
118
119 #endif
120
121
122
123
124
125