4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 // the simplest plugin possible
35 class ScaleXFactorText;
36 class ScaleXFactorSlider;
37 class ScaleYFactorText;
38 class ScaleYFactorSlider;
40 class ScaleWidthSlider;
41 class ScaleHeightText;
42 class ScaleHeightSlider;
47 #define RESET_DEFAULT_SETTINGS 10
49 #define RESET_X_FACTOR 1
50 #define RESET_Y_FACTOR 2
52 #define RESET_HEIGHT 4
54 #define MIN_FACTOR 0.00
55 #define MAX_FACTOR 10.00
56 #define MAX_WIDTH 16384
57 #define MAX_HEIGHT 9216
62 #include "mwindow.inc"
66 #include "overlayframe.h"
67 #include "pluginvclient.h"
76 void reset(int clear);
77 void copy_from(ScaleConfig &src);
78 int equivalent(ScaleConfig &src);
79 void interpolate(ScaleConfig &prev,
83 int64_t current_frame);
86 float x_factor, y_factor;
95 class ScaleUseScale : public BC_Radial
98 ScaleUseScale(ScaleWin *win, ScaleMain *client, int x, int y);
106 class ScaleUseSize : public BC_Radial
109 ScaleUseSize(ScaleWin *win, ScaleMain *client, int x, int y);
117 class ScaleConstrain : public BC_CheckBox
120 ScaleConstrain(ScaleWin *win, ScaleMain *client, int x, int y);
128 class ScaleWin : public PluginClientWindow
131 ScaleWin(ScaleMain *client);
134 void create_objects();
135 void update(int clear);
137 void update_scale_size_enable();
141 FrameSizePulldown *pulldown;
142 ScaleUseScale *use_scale;
143 ScaleUseSize *use_size;
144 ScaleConstrain *constrain;
146 ScaleXFactorText *x_factor_text;
147 ScaleXFactorSlider *x_factor_slider;
148 ScaleClr *x_factor_clr;
150 ScaleYFactorText *y_factor_text;
151 ScaleYFactorSlider *y_factor_slider;
152 ScaleClr *y_factor_clr;
154 ScaleWidthText *width_text;
155 ScaleWidthSlider *width_slider;
158 ScaleHeightText *height_text;
159 ScaleHeightSlider *height_slider;
160 ScaleClr *height_clr;
167 class ScaleMain : public PluginVClient
170 ScaleMain(PluginServer *server);
173 // required for all realtime plugins
174 PLUGIN_CLASS_MEMBERS(ScaleConfig)
175 int process_buffer(VFrame *frame,
176 int64_t start_position,
178 void calculate_transfer(VFrame *frame,
190 void save_data(KeyFrame *keyframe);
191 void read_data(KeyFrame *keyframe);
192 void set_type(int type);
195 PluginServer *server;
196 OverlayFrame *overlayer; // To scale images
199 class ScaleXFactorText : public BC_TumbleTextBox
202 ScaleXFactorText(ScaleWin *win, ScaleMain *client,
212 class ScaleXFactorSlider : public BC_FSlider
215 ScaleXFactorSlider(ScaleWin *win, ScaleMain *client,
216 int x, int y, int w);
217 ~ScaleXFactorSlider();
223 class ScaleYFactorText : public BC_TumbleTextBox
226 ScaleYFactorText(ScaleWin *win, ScaleMain *client,
236 class ScaleYFactorSlider : public BC_FSlider
239 ScaleYFactorSlider(ScaleWin *win, ScaleMain *client,
240 int x, int y, int w);
241 ~ScaleYFactorSlider();
247 class ScaleWidthText : public BC_TumbleTextBox
250 ScaleWidthText(ScaleWin *win, ScaleMain *client,
260 class ScaleWidthSlider : public BC_ISlider
263 ScaleWidthSlider(ScaleWin *win, ScaleMain *client,
264 int x, int y, int w);
271 class ScaleHeightText : public BC_TumbleTextBox
274 ScaleHeightText(ScaleWin *win, ScaleMain *client,
284 class ScaleHeightSlider : public BC_ISlider
287 ScaleHeightSlider(ScaleWin *win, ScaleMain *client,
288 int x, int y, int w);
289 ~ScaleHeightSlider();
296 class ScaleClr : public BC_Button
299 ScaleClr(ScaleWin *win, ScaleMain *client,
300 int x, int y, int clear);
308 class ScaleReset : public BC_GenericButton
311 ScaleReset(ScaleWin *win, ScaleMain *client, int x, int y);