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
36 #include "mwindow.inc"
40 #include "overlayframe.h"
41 #include "pluginvclient.h"
51 void copy_from(ScaleConfig &src);
52 int equivalent(ScaleConfig &src);
53 void interpolate(ScaleConfig &prev,
57 int64_t current_frame);
60 float x_factor, y_factor;
66 class ScaleXFactor : public BC_TumbleTextBox
69 ScaleXFactor(ScaleWin *win, ScaleMain *client, int x, int y);
78 class ScaleWidth : public BC_TumbleTextBox
81 ScaleWidth(ScaleWin *win, ScaleMain *client, int x, int y);
90 class ScaleYFactor : public BC_TumbleTextBox
93 ScaleYFactor(ScaleWin *win, ScaleMain *client, int x, int y);
102 class ScaleHeight : public BC_TumbleTextBox
105 ScaleHeight(ScaleWin *win, ScaleMain *client, int x, int y);
114 class ScaleUseScale : public BC_Radial
117 ScaleUseScale(ScaleWin *win, ScaleMain *client, int x, int y);
125 class ScaleUseSize : public BC_Radial
128 ScaleUseSize(ScaleWin *win, ScaleMain *client, int x, int y);
136 class ScaleConstrain : public BC_CheckBox
139 ScaleConstrain(ScaleMain *client, int x, int y);
146 class ScaleWin : public PluginClientWindow
149 ScaleWin(ScaleMain *client);
152 void create_objects();
155 ScaleXFactor *x_factor;
156 ScaleYFactor *y_factor;
159 FrameSizePulldown *pulldown;
160 ScaleUseScale *use_scale;
161 ScaleUseSize *use_size;
162 ScaleConstrain *constrain;
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