/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "bcdisplayinfo.h"
{
public:
WhirlConfig();
-
+
void copy_from(WhirlConfig &src);
int equivalent(WhirlConfig &src);
- void interpolate(WhirlConfig &prev,
- WhirlConfig &next,
- long prev_frame,
- long next_frame,
+ void interpolate(WhirlConfig &prev,
+ WhirlConfig &next,
+ long prev_frame,
+ long next_frame,
long current_frame);
-
+
float angle;
float pinch;
float radius;
void process_package(LoadPackage *package);
WhirlEngine *server;
WhirlEffect *plugin;
-
+
};
EQUIV(this->radius, src.radius);
}
-void WhirlConfig::interpolate(WhirlConfig &prev,
- WhirlConfig &next,
- long prev_frame,
- long next_frame,
+void WhirlConfig::interpolate(WhirlConfig &prev,
+ WhirlConfig &next,
+ long prev_frame,
+ long next_frame,
long current_frame)
{
double next_scale = (double)(current_frame - prev_frame) / (next_frame - prev_frame);
WhirlWindow::WhirlWindow(WhirlEffect *plugin)
- : PluginClientWindow(plugin,
- 220,
- 200,
- 220,
- 200,
+ : PluginClientWindow(plugin,
+ 220,
+ 200,
+ 220,
+ 200,
0)
{
this->plugin = plugin;
WhirlAngle::WhirlAngle(WhirlEffect *plugin, int x, int y)
- : BC_FSlider(x,
- y,
+ : BC_FSlider(x,
+ y,
0,
200,
- 200,
- (float)0,
+ 200,
+ (float)0,
(float)360,
plugin->config.angle)
{
WhirlPinch::WhirlPinch(WhirlEffect *plugin, int x, int y)
- : BC_FSlider(x,
- y,
+ : BC_FSlider(x,
+ y,
0,
200,
- 200,
- (float)0,
- (float)MAXPINCH,
+ 200,
+ (float)0,
+ (float)MAXPINCH,
plugin->config.pinch)
{
this->plugin = plugin;
WhirlRadius::WhirlRadius(WhirlEffect *plugin, int x, int y)
- : BC_FSlider(x,
- y,
+ : BC_FSlider(x,
+ y,
0,
200,
- 200,
- (float)0,
- (float)MAXRADIUS,
+ 200,
+ (float)0,
+ (float)MAXRADIUS,
plugin->config.radius)
{
this->plugin = plugin;
need_reconfigure = 1;
engine = 0;
temp_frame = 0;
-
+
}
WhirlEffect::~WhirlEffect()
{
-
+
if(engine) delete engine;
if(temp_frame) delete temp_frame;
}
-const char* WhirlEffect::plugin_title() { return _("Whirl"); }
+const char* WhirlEffect::plugin_title() { return N_("Whirl"); }
int WhirlEffect::is_realtime() { return 1; }
FileXML output;
// cause data to be stored directly in text
- output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+ output.set_shared_output(keyframe->xbuf);
output.tag.set_title("WHIRL");
output.tag.set_property("ANGLE", config.angle);
{
FileXML input;
- input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+ input.set_shared_input(keyframe->xbuf);
int result = 0;
this->input = input;
this->output = output;
- if(EQUIV(config.angle, 0) ||
+ if(EQUIV(config.angle, 0) ||
(EQUIV(config.radius, 0) && EQUIV(config.pinch, 0)))
{
if(input->get_rows()[0] != output->get_rows()[0])
{
if(input->get_rows()[0] == output->get_rows()[0])
{
- if(!temp_frame) temp_frame = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- input->get_color_model(),
- -1);
+ if(!temp_frame) temp_frame = new VFrame(input->get_w(), input->get_h(),
+ input->get_color_model(), 0);
temp_frame->copy_from(input);
this->input = temp_frame;
}
double scale_y;
-//printf("WhirlUnit::process_package 1 %f %f %f\n",
+//printf("WhirlUnit::process_package 1 %f %f %f\n",
// plugin->config.angle, plugin->config.pinch, plugin->config.radius);
if(w < h)
{
case BC_YUVA16161616:
WHIRL_MACRO(uint16_t, 0xffff, 4);
break;
-
+
}
}
pkg->row1 = plugin->input->get_h() * i / LoadServer::get_total_packages();
pkg->row2 = plugin->input->get_h() * (i + 1) / LoadServer::get_total_packages();
}
-
+
}
LoadClient* WhirlEngine::new_client()