prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / overlayframe.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 OVERLAYFRAME_H
23 #define OVERLAYFRAME_H
24
25 #include "loadbalance.h"
26 #include "overlayframe.inc"
27 #include "vframe.inc"
28
29 #define DIRECT_COPY 0
30 #define BILINEAR 1
31 #define BICUBIC 2
32 #define LANCZOS 3
33
34 class OverlayKernel
35 {
36 public:
37         OverlayKernel(int interpolation_type);
38         ~OverlayKernel();
39
40         float *lookup;
41         float width;
42         int n;
43         int type;
44 };
45
46 class DirectEngine;
47
48 class DirectPackage : public LoadPackage
49 {
50 public:
51         DirectPackage();
52
53         int out_row1, out_row2;
54 };
55
56 class NNEngine;
57
58 class NNPackage : public LoadPackage
59 {
60 public:
61         NNPackage();
62
63         int out_row1, out_row2;
64 };
65
66 class SampleEngine;
67
68 class SamplePackage : public LoadPackage
69 {
70 public:
71         SamplePackage();
72
73         int out_col1, out_col2;
74 };
75
76
77 class DirectUnit : public LoadClient
78 {
79 public:
80         DirectUnit(DirectEngine *server);
81         ~DirectUnit();
82
83         void process_package(LoadPackage *package);
84         DirectEngine *engine;
85 };
86
87 class NNUnit : public LoadClient
88 {
89 public:
90         NNUnit(NNEngine *server);
91         ~NNUnit();
92
93         void process_package(LoadPackage *package);
94
95         NNEngine *engine;
96 };
97
98 class SampleUnit : public LoadClient
99 {
100 public:
101         SampleUnit(SampleEngine *server);
102         ~SampleUnit();
103
104         void process_package(LoadPackage *package);
105
106         SampleEngine *engine;
107 };
108
109
110 class DirectEngine : public LoadServer
111 {
112 public:
113         DirectEngine(int cpus);
114         ~DirectEngine();
115
116         void init_packages();
117         LoadClient* new_client();
118         LoadPackage* new_package();
119
120         VFrame *output;
121         VFrame *input;
122         int in_x1;
123         int in_y1;
124         int out_x1;
125         int out_x2;
126         int out_y1;
127         int out_y2;
128         float alpha;
129         int mode;
130 };
131
132 class NNEngine : public LoadServer
133 {
134 public:
135         NNEngine(int cpus);
136         ~NNEngine();
137
138         void init_packages();
139         LoadClient* new_client();
140         LoadPackage* new_package();
141
142         VFrame *output;
143         VFrame *input;
144         float in_x1;
145         float in_x2;
146         float in_y1;
147         float in_y2;
148         float out_x1;
149         float out_x2;
150         int out_x1i;
151         int out_x2i;
152         float out_y1;
153         float out_y2;
154         float alpha;
155         int mode;
156
157         int *in_lookup_x;
158         int *in_lookup_y;
159 };
160
161 class SampleEngine : public LoadServer
162 {
163 public:
164         SampleEngine(int cpus);
165         ~SampleEngine();
166
167         void init_packages();
168         LoadClient* new_client();
169         LoadPackage* new_package();
170
171         VFrame *output;
172         VFrame *input;
173         OverlayKernel *kernel;
174
175         int col_out1;
176         int col_out2;
177         int row_in;
178
179         float in1;
180         float in2;
181         float out1;
182         float out2;
183
184         float alpha;
185         int mode;
186
187         int *lookup_sx0;
188         int *lookup_sx1;
189         int *lookup_sk;
190         float *lookup_wacc;
191         int kd;
192 };
193
194 class OverlayFrame
195 {
196 public:
197         OverlayFrame(int cpus = 1);
198         virtual ~OverlayFrame();
199
200         int overlay(VFrame *output,
201                 VFrame *input,
202                 float in_x1,
203                 float in_y1,
204                 float in_x2,
205                 float in_y2,
206                 float out_x1,
207                 float out_y1,
208                 float out_x2,
209                 float out_y2,
210                 float alpha,
211                 int mode,
212                 int interpolation_type);
213
214         DirectEngine *direct_engine;
215         NNEngine *nn_engine;
216         SampleEngine *sample_engine;
217
218         VFrame *temp_frame;
219         int cpus;
220         OverlayKernel *kernel[4];
221 };
222
223 #endif