X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fblur.cpp;h=2b481f03d660a82f2b39e3f33fe83c28acdf90d9;hb=7c70b39267a02a92da8293b4ff5759b3f4f738d9;hp=06026223af9ddbc7934a218687dca50d6d984236;hpb=28f28705612902c15cd0702cc891fba35bf2d2df;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/blur.cpp b/synfig-core/trunk/src/synfig/blur.cpp index 0602622..2b481f0 100644 --- a/synfig-core/trunk/src/synfig/blur.cpp +++ b/synfig-core/trunk/src/synfig/blur.cpp @@ -5,16 +5,17 @@ ** $Id: blur.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** 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 */ /* ========================================================================= */ @@ -616,24 +617,24 @@ bool Blur::operator ()(const Surface &surface, //horizontal part if(size[0]) { - int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1); - length=std::max(1,length); + Real length=abs((float)w/(resolution[0]))*size[0]*0.5+1; + length=std::max(1.0,length); //two box blurs produces: 1 2 1 - etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin()); - etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin()); + etl::hbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin()); + etl::hbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin()); } //else temp_surface2=worksurface; //vertical part if(size[1]) { - int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1); - length=std::max(1,length); + Real length=abs((float)h/(resolution[1]))*size[1]*0.5+1; + length=std::max(1.0,length); //two box blurs produces: 1 2 1 on the horizontal 1 2 1 - etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin()); - etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin()); + etl::vbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin()); + etl::vbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin()); } //else temp_surface2=temp_surface2; @@ -992,24 +993,24 @@ bool Blur::operator ()(const surface &surface, //horizontal part if(size[0]) { - int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1); - length=std::max(1,length); + Real length=abs((float)w/(resolution[0]))*size[0]*0.5+1; + length=std::max(1.0,length); //two box blurs produces: 1 2 1 - etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin()); - etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin()); + etl::hbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin()); + etl::hbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin()); } //else temp_surface2=worksurface; //vertical part if(size[1]) { - int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1); - length=std::max(1,length); + Real length=abs((float)h/(resolution[1]))*size[1]*0.5+1; + length=std::max(1.0,length); //two box blurs produces: 1 2 1 on the horizontal 1 2 1 - etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin()); - etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin()); + etl::vbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin()); + etl::vbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin()); } //else temp_surface2=temp_surface2;