X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_filter%2Fradialblur.cpp;h=1e966b9e2e3a9bed3cda37ad78f1dacff78a7375;hb=cc54c38609ee9745ad678e5e9b9d7d2912be9c95;hp=7471a539fc275a11b5d95f15461923031f903520;hpb=16b3beced25134bef064705568ecb893a6be4e79;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_filter/radialblur.cpp b/synfig-core/trunk/src/modules/mod_filter/radialblur.cpp index 7471a53..1e966b9 100644 --- a/synfig-core/trunk/src/modules/mod_filter/radialblur.cpp +++ b/synfig-core/trunk/src/modules/mod_filter/radialblur.cpp @@ -1,18 +1,20 @@ -/*! ======================================================================== -** Sinfg -** Template File -** $Id: radialblur.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $ +/* === S Y N F I G ========================================================= */ +/*! \file radialblur.cpp +** \brief Template Header ** -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package 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. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package 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. +** \endlegal ** ** === N O T E S =========================================================== ** @@ -28,15 +30,15 @@ #endif #include "radialblur.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #endif @@ -45,12 +47,12 @@ /* === G L O B A L S ======================================================= */ -SINFG_LAYER_INIT(RadialBlur); -SINFG_LAYER_SET_NAME(RadialBlur,"radial_blur"); -SINFG_LAYER_SET_LOCAL_NAME(RadialBlur,_("Radial Blur")); -SINFG_LAYER_SET_CATEGORY(RadialBlur,_("Blurs")); -SINFG_LAYER_SET_VERSION(RadialBlur,"0.1"); -SINFG_LAYER_SET_CVS_ID(RadialBlur,"$Id: radialblur.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $"); +SYNFIG_LAYER_INIT(RadialBlur); +SYNFIG_LAYER_SET_NAME(RadialBlur,"radial_blur"); +SYNFIG_LAYER_SET_LOCAL_NAME(RadialBlur,_("Radial Blur")); +SYNFIG_LAYER_SET_CATEGORY(RadialBlur,_("Blurs")); +SYNFIG_LAYER_SET_VERSION(RadialBlur,"0.1"); +SYNFIG_LAYER_SET_CVS_ID(RadialBlur,"$Id$"); /* === P R O C E D U R E S ================================================= */ @@ -75,8 +77,8 @@ RadialBlur::set_param(const String & param, const ValueBase &value) IMPORT(origin); IMPORT(size); IMPORT(fade_out); - - return Layer_Composite::set_param(param,value); + + return Layer_Composite::set_param(param,value); } ValueBase @@ -85,18 +87,18 @@ RadialBlur::get_param(const String ¶m)const EXPORT(origin); EXPORT(size); EXPORT(fade_out); - + EXPORT_NAME(); EXPORT_VERSION(); - - return Layer_Composite::get_param(param); + + return Layer_Composite::get_param(param); } Layer::Vocab RadialBlur::get_param_vocab()const { Layer::Vocab ret(Layer_Composite::get_param_vocab()); - + ret.push_back(ParamDesc("origin") .set_local_name(_("Origin")) .set_description(_("Point where you want the origin to be")) @@ -111,7 +113,7 @@ RadialBlur::get_param_vocab()const ret.push_back(ParamDesc("fade_out") .set_local_name(_("Fade Out")) ); - + return ret; } @@ -127,14 +129,14 @@ RadialBlur::accelerated_render(Context context,Surface *surface,int quality, con { if(cb && !cb->amount_complete(0,10000)) return false; - + Surface tmp_surface; - + if(!context.accelerated_render(surface,quality,renddesc,cb)) return false; tmp_surface=*surface; - + int x,y; const Point tl(renddesc.get_tl()); @@ -147,17 +149,17 @@ RadialBlur::accelerated_render(Context context,Surface *surface,int quality, con apen.set_alpha(get_amount()); apen.set_blend_method(get_blend_method()); - + int steps(5); - + if(quality>=9)steps=20; else if(quality>=5)steps=30; else if(quality>=4)steps=60; else if(quality>=3)steps=100; else steps=120; - + Surface::value_prep_type cooker; - + for(y=0,pos[1]=tl[1];y 0) ? 1 : -1; dy = abs(y1 - y0); @@ -216,7 +218,7 @@ RadialBlur::accelerated_render(Context context,Surface *surface,int quality, con poolsize+=1; } } - + while (e >= 0) { y0 += sy; @@ -234,7 +236,7 @@ RadialBlur::accelerated_render(Context context,Surface *surface,int quality, con Point begin,end; begin=pos; end=(pos-origin)*(1.0f-size)+origin; - + Color pool(Color::alpha()); float f,poolsize(0); int i; @@ -243,7 +245,7 @@ RadialBlur::accelerated_render(Context context,Surface *surface,int quality, con { Point loc((end-begin)*f+begin-tl); loc[0]/=pw;loc[1]/=ph; - + if(fade_out) pool+=tmp_surface.linear_sample(loc[0],loc[1])*(i-steps),poolsize+=(i-steps); else