/*
* 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 <math.h>
int equivalent(RadialBlurConfig &that);
void copy_from(RadialBlurConfig &that);
- void interpolate(RadialBlurConfig &prev,
- RadialBlurConfig &next,
- long prev_frame,
- long next_frame,
+ void interpolate(RadialBlurConfig &prev,
+ RadialBlurConfig &next,
+ long prev_frame,
+ long next_frame,
long current_frame);
int x;
class RadialBlurSize : public BC_ISlider
{
public:
- RadialBlurSize(RadialBlurMain *plugin,
- int x,
- int y,
+ RadialBlurSize(RadialBlurMain *plugin,
+ int x,
+ int y,
int *output,
int min,
int max);
class RadialBlurToggle : public BC_CheckBox
{
public:
- RadialBlurToggle(RadialBlurMain *plugin,
- int x,
- int y,
+ RadialBlurToggle(RadialBlurMain *plugin,
+ int x,
+ int y,
int *output,
char *string);
int handle_event();
class RadialBlurEngine : public LoadServer
{
public:
- RadialBlurEngine(RadialBlurMain *plugin,
- int total_clients,
+ RadialBlurEngine(RadialBlurMain *plugin,
+ int total_clients,
int total_packages);
void init_packages();
LoadClient* new_client();
int RadialBlurConfig::equivalent(RadialBlurConfig &that)
{
- return
+ return
angle == that.angle &&
x == that.x &&
y == that.y &&
a = that.a;
}
-void RadialBlurConfig::interpolate(RadialBlurConfig &prev,
- RadialBlurConfig &next,
- long prev_frame,
- long next_frame,
+void RadialBlurConfig::interpolate(RadialBlurConfig &prev,
+ RadialBlurConfig &next,
+ long prev_frame,
+ long next_frame,
long current_frame)
{
double next_scale = (double)(current_frame - prev_frame) / (next_frame - prev_frame);
RadialBlurWindow::RadialBlurWindow(RadialBlurMain *plugin)
: PluginClientWindow(plugin,
- 230,
- 340,
- 230,
- 340,
+ 230,
+ 340,
+ 230,
+ 340,
0)
{
- this->plugin = plugin;
+ this->plugin = plugin;
}
RadialBlurWindow::~RadialBlurWindow()
-RadialBlurToggle::RadialBlurToggle(RadialBlurMain *plugin,
- int x,
- int y,
- int *output,
+RadialBlurToggle::RadialBlurToggle(RadialBlurMain *plugin,
+ int x,
+ int y,
+ int *output,
char *string)
: BC_CheckBox(x, y, *output, string)
{
-RadialBlurSize::RadialBlurSize(RadialBlurMain *plugin,
- int x,
- int y,
+RadialBlurSize::RadialBlurSize(RadialBlurMain *plugin,
+ int x,
+ int y,
int *output,
int min,
int max)
RadialBlurMain::RadialBlurMain(PluginServer *server)
: PluginVClient(server)
{
-
+
engine = 0;
temp = 0;
rotate = 0;
RadialBlurMain::~RadialBlurMain()
{
-
+
if(engine) delete engine;
if(temp) delete temp;
delete rotate;
}
-const char* RadialBlurMain::plugin_title() { return _("Radial Blur"); }
+const char* RadialBlurMain::plugin_title() { return N_("Radial Blur"); }
int RadialBlurMain::is_realtime() { return 1; }
this->output = frame;
- if(!temp) temp = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ if(!temp)
+ temp = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
temp->copy_from(frame);
this->input = temp;
glDrawBuffer(GL_BACK);
if(!config.r || !config.g || !config.b || !config.a)
{
- glColor4f(config.r ? 0 : 1,
- config.g ? 0 : 1,
- config.b ? 0 : 1,
+ glColor4f(config.r ? 0 : 1,
+ config.g ? 0 : 1,
+ config.b ? 0 : 1,
config.a ? 0 : 1);
get_output()->draw_texture();
}
{
get_output()->set_opengl_state(VFrame::TEXTURE);
glClear(GL_COLOR_BUFFER_BIT);
- glColor4f(config.r ? 1 : 0,
- config.g ? 1 : 0,
- config.b ? 1 : 0,
+ glColor4f(config.r ? 1 : 0,
+ config.g ? 1 : 0,
+ config.b ? 1 : 0,
config.a ? 1 : 0);
float w = get_output()->get_w();
double current_angle = (double)config.angle *
- i /
- config.steps -
+ i /
+ config.steps -
(double)config.angle / 2;
- if(!rotate) rotate = new AffineEngine(PluginClient::smp + 1,
+ if(!rotate) rotate = new AffineEngine(PluginClient::smp + 1,
PluginClient::smp + 1);
rotate->set_in_pivot((int)(config.x * w / 100),
(int)(config.y * h / 100));
glAccum(GL_ACCUM, fraction);
glEnable(GL_TEXTURE_2D);
- glColor4f(config.r ? 1 : 0,
- config.g ? 1 : 0,
- config.b ? 1 : 0,
+ glColor4f(config.r ? 1 : 0,
+ config.g ? 1 : 0,
+ config.b ? 1 : 0,
config.a ? 1 : 0);
}
}
-RadialBlurUnit::RadialBlurUnit(RadialBlurEngine *server,
+RadialBlurUnit::RadialBlurUnit(RadialBlurEngine *server,
RadialBlurMain *plugin)
: LoadClient(server)
{
-RadialBlurEngine::RadialBlurEngine(RadialBlurMain *plugin,
- int total_clients,
+RadialBlurEngine::RadialBlurEngine(RadialBlurMain *plugin,
+ int total_clients,
int total_packages)
: LoadServer(total_clients, total_packages)
// : LoadServer(1, 1)