add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / interpolate / interpolate.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 INTERPOLATEPIXELS_H
23 #define INTERPOLATEPIXELS_H
24
25 class InterpolatePixelsMain;
26
27 #define TOTAL_PATTERNS 2
28
29 #include "bchash.h"
30 #include "loadbalance.h"
31 #include "mutex.h"
32 #include "pluginvclient.h"
33 #include <sys/types.h>
34
35 class InterpolatePixelsConfig
36 {
37 public:
38         InterpolatePixelsConfig();
39     int equivalent(InterpolatePixelsConfig &that);
40     void copy_from(InterpolatePixelsConfig &that);
41     void interpolate(InterpolatePixelsConfig &prev,
42         InterpolatePixelsConfig &next,
43         int64_t prev_position,
44         int64_t next_position,
45         int64_t current_position);
46         int x, y;
47 };
48
49 class InterpolatePixelsThread;
50 class InterpolatePixelsWindow;
51 class InterpolatePixelsEngine;
52
53 class InterpolatePixelsOffset : public BC_ISlider
54 {
55 public:
56         InterpolatePixelsOffset(InterpolatePixelsWindow *window,
57                 int x,
58                 int y,
59                 int *output);
60         ~InterpolatePixelsOffset();
61
62         int handle_event();
63         InterpolatePixelsWindow *window;
64         int *output;
65 };
66
67 class InterpolatePixelsWindow : public PluginClientWindow
68 {
69 public:
70         InterpolatePixelsWindow(InterpolatePixelsMain *client);
71         ~InterpolatePixelsWindow();
72
73         void create_objects();
74
75         InterpolatePixelsMain *client;
76         InterpolatePixelsOffset *x_offset;
77         InterpolatePixelsOffset *y_offset;
78 };
79
80
81 class InterpolatePixelsMain : public PluginVClient
82 {
83 public:
84         InterpolatePixelsMain(PluginServer *server);
85         ~InterpolatePixelsMain();
86
87         PLUGIN_CLASS_MEMBERS(InterpolatePixelsConfig);
88
89 // required for all realtime plugins
90         int process_buffer(VFrame *frame,
91                 int64_t start_position,
92                 double frame_rate);
93         int is_realtime();
94         void update_gui();
95         void save_data(KeyFrame *keyframe);
96         void read_data(KeyFrame *keyframe);
97         int handle_opengl();
98
99         InterpolatePixelsEngine *engine;
100         VFrame *out_temp, *out_frame;
101 };
102
103
104 class InterpolatePixelsPackage : public LoadPackage
105 {
106 public:
107         InterpolatePixelsPackage();
108         int y1, y2;
109 };
110
111 class InterpolatePixelsUnit : public LoadClient
112 {
113 public:
114         InterpolatePixelsUnit(InterpolatePixelsEngine *server, InterpolatePixelsMain *plugin);
115         void process_package(LoadPackage *package);
116         InterpolatePixelsEngine *server;
117         InterpolatePixelsMain *plugin;
118 };
119
120 class InterpolatePixelsEngine : public LoadServer
121 {
122 public:
123         InterpolatePixelsEngine(InterpolatePixelsMain *plugin);
124         void init_packages();
125         LoadClient* new_client();
126         LoadPackage* new_package();
127         InterpolatePixelsMain *plugin;
128         float color_matrix[9];
129 };
130
131
132 #endif