remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / plugins / photoscale / photoscale.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2011 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 PHOTOSCALE_H
23 #define PHOTOSCALE_H
24
25 class PhotoScaleMain;
26 class PhotoScaleEngine;
27 class PhotoScaleWindow;
28
29 #include "bchash.inc"
30 #include "guicast.h"
31 #include "loadbalance.h"
32 #include "mutex.h"
33 #include "overlayframe.h"
34 #include "pluginvclient.h"
35 #include "thread.h"
36 #include "vframe.inc"
37
38
39
40
41 class PhotoScaleSizeText : public BC_TextBox
42 {
43 public:
44         PhotoScaleSizeText(PhotoScaleMain *plugin,
45                 PhotoScaleWindow *gui,
46                 int x,
47                 int y,
48                 int w,
49                 int *output);
50         ~PhotoScaleSizeText();
51         int handle_event();
52         PhotoScaleMain *plugin;
53         PhotoScaleWindow *gui;
54         int *output;
55 };
56
57 class PhotoScaleFile : public BC_Radial
58 {
59 public:
60         PhotoScaleFile(PhotoScaleMain *plugin,
61                 PhotoScaleWindow *gui,
62                 int x,
63                 int y);
64         int handle_event();
65         PhotoScaleMain *plugin;
66         PhotoScaleWindow *gui;
67 };
68
69 class PhotoScaleScan : public BC_Radial
70 {
71 public:
72         PhotoScaleScan(PhotoScaleMain *plugin,
73                 PhotoScaleWindow *gui,
74                 int x,
75                 int y);
76         int handle_event();
77         PhotoScaleMain *plugin;
78         PhotoScaleWindow *gui;
79 };
80
81 class PhotoScaleWindow : public PluginClientWindow
82 {
83 public:
84         PhotoScaleWindow(PhotoScaleMain *plugin);
85         ~PhotoScaleWindow();
86
87         void create_objects();
88
89         PhotoScaleMain *plugin;
90 // Output size w, h
91         PhotoScaleSizeText *output_size[2];
92         PhotoScaleFile *file;
93         PhotoScaleScan *scan;
94 };
95
96
97
98
99
100 class PhotoScaleSwapExtents : public BC_Button
101 {
102 public:
103         PhotoScaleSwapExtents(PhotoScaleMain *plugin,
104                 PhotoScaleWindow *gui,
105                 int x,
106                 int y);
107         int handle_event();
108         PhotoScaleMain *plugin;
109         PhotoScaleWindow *gui;
110 };
111
112
113
114
115
116
117
118 class PhotoScaleConfig
119 {
120 public:
121         PhotoScaleConfig();
122
123         int equivalent(PhotoScaleConfig &that);
124         void copy_from(PhotoScaleConfig &that);
125         void interpolate(PhotoScaleConfig &prev,
126                 PhotoScaleConfig &next,
127                 int64_t prev_frame,
128                 int64_t next_frame,
129                 int64_t current_frame);
130
131 // Output size
132         int width, height;
133         int use_file;
134 };
135
136
137
138
139
140
141
142 class PhotoScaleEngine : public LoadServer
143 {
144 public:
145         PhotoScaleEngine(PhotoScaleMain *plugin, int cpus);
146         ~PhotoScaleEngine();
147
148         void init_packages();
149         LoadClient* new_client();
150         LoadPackage* new_package();
151         PhotoScaleMain *plugin;
152
153         int top_border;
154         int bottom_border;
155         int left_border;
156         int right_border;
157 };
158
159
160 class PhotoScalePackage : public LoadPackage
161 {
162 public:
163         PhotoScalePackage();
164         int side;
165 };
166
167
168
169 class PhotoScaleUnit : public LoadClient
170 {
171 public:
172         PhotoScaleUnit(PhotoScaleEngine *server);
173         ~PhotoScaleUnit();
174         void process_package(LoadPackage *package);
175         PhotoScaleEngine *server;
176 };
177
178
179
180
181
182 class PhotoScaleMain : public PluginVClient
183 {
184 public:
185         PhotoScaleMain(PluginServer *server);
186         ~PhotoScaleMain();
187
188 // required for all realtime plugins
189         int process_buffer(VFrame *frame,
190                 int64_t start_position,
191                 double frame_rate);
192         int is_realtime();
193         void save_data(KeyFrame *keyframe);
194         void read_data(KeyFrame *keyframe);
195         void update_gui();
196
197         PLUGIN_CLASS_MEMBERS(PhotoScaleConfig)
198
199         int need_reconfigure;
200
201 private:
202         PhotoScaleEngine *engine;
203         OverlayFrame *overlayer;
204         VFrame *input_frame;
205 };
206
207
208
209 #endif