X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fradialblur%2Fradialblur.C;h=28f532e3adc96e353401e5b27fe0f6dae34c7128;hb=5ac2037d8e5ab71a1915389cd08b458cfb60d64f;hp=7e536fecc534182ad42f4beb7b74ebe0e08e5230;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/radialblur/radialblur.C b/cinelerra-5.1/plugins/radialblur/radialblur.C index 7e536fec..28f532e3 100644 --- a/cinelerra-5.1/plugins/radialblur/radialblur.C +++ b/cinelerra-5.1/plugins/radialblur/radialblur.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * 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 @@ -50,10 +50,10 @@ public: 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; @@ -71,9 +71,9 @@ public: 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); @@ -85,9 +85,9 @@ public: 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(); @@ -156,8 +156,8 @@ public: 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(); @@ -201,7 +201,7 @@ RadialBlurConfig::RadialBlurConfig() int RadialBlurConfig::equivalent(RadialBlurConfig &that) { - return + return angle == that.angle && x == that.x && y == that.y && @@ -224,10 +224,10 @@ void RadialBlurConfig::copy_from(RadialBlurConfig &that) 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); @@ -256,13 +256,13 @@ void RadialBlurConfig::interpolate(RadialBlurConfig &prev, RadialBlurWindow::RadialBlurWindow(RadialBlurMain *plugin) : PluginClientWindow(plugin, - 230, - 340, - 230, - 340, + 230, + 340, + 230, + 340, 0) { - this->plugin = plugin; + this->plugin = plugin; } RadialBlurWindow::~RadialBlurWindow() @@ -312,10 +312,10 @@ void RadialBlurWindow::create_objects() -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) { @@ -336,9 +336,9 @@ int RadialBlurToggle::handle_event() -RadialBlurSize::RadialBlurSize(RadialBlurMain *plugin, - int x, - int y, +RadialBlurSize::RadialBlurSize(RadialBlurMain *plugin, + int x, + int y, int *output, int min, int max) @@ -366,7 +366,7 @@ int RadialBlurSize::handle_event() RadialBlurMain::RadialBlurMain(PluginServer *server) : PluginVClient(server) { - + engine = 0; temp = 0; rotate = 0; @@ -374,13 +374,13 @@ RadialBlurMain::RadialBlurMain(PluginServer *server) 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; } @@ -413,12 +413,9 @@ int RadialBlurMain::process_buffer(VFrame *frame, 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; @@ -519,9 +516,9 @@ int RadialBlurMain::handle_opengl() 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(); } @@ -534,9 +531,9 @@ int RadialBlurMain::handle_opengl() { 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(); @@ -545,11 +542,11 @@ int RadialBlurMain::handle_opengl() 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)); @@ -562,9 +559,9 @@ int RadialBlurMain::handle_opengl() 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); } @@ -596,7 +593,7 @@ RadialBlurPackage::RadialBlurPackage() } -RadialBlurUnit::RadialBlurUnit(RadialBlurEngine *server, +RadialBlurUnit::RadialBlurUnit(RadialBlurEngine *server, RadialBlurMain *plugin) : LoadClient(server) { @@ -780,8 +777,8 @@ void RadialBlurUnit::process_package(LoadPackage *package) -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)