X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Flyr_std%2Fwarp.cpp;h=24624aec14eee285214b99bee7f6a721f5906eaa;hb=37600b4b217caa5e316984ec0b035c5e8f9698af;hp=2b567eb36d2dd4117fcfca9acbf822b34ef58b33;hpb=5ddcf36f04cfbd10fabda4e3c5633cb27cdd4c0a;p=synfig.git diff --git a/synfig-core/trunk/src/modules/lyr_std/warp.cpp b/synfig-core/trunk/src/modules/lyr_std/warp.cpp index 2b567eb..24624ae 100644 --- a/synfig-core/trunk/src/modules/lyr_std/warp.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/warp.cpp @@ -1,9 +1,12 @@ -/*! ======================================================================== -** Synfig -** Template File -** $Id: warp.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $ +/* === S Y N F I G ========================================================= */ +/*! \file warp.cpp +** \brief Template File ** +** $Id$ +** +** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -14,6 +17,7 @@ ** 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 =========================================================== ** @@ -51,7 +55,7 @@ SYNFIG_LAYER_SET_NAME(Warp,"warp"); SYNFIG_LAYER_SET_LOCAL_NAME(Warp,_("Warp")); SYNFIG_LAYER_SET_CATEGORY(Warp,_("Distortions")); SYNFIG_LAYER_SET_VERSION(Warp,"0.1"); -SYNFIG_LAYER_SET_CVS_ID(Warp,"$Id: warp.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $"); +SYNFIG_LAYER_SET_CVS_ID(Warp,"$Id$"); /* === P R O C E D U R E S ================================================= */ @@ -64,8 +68,8 @@ Warp::Warp(): src_br (2,-2), dest_tl (-1.8,2.1), dest_tr (1.8,2.1), - dest_br (2.2,-2), dest_bl (-2.2,-2), + dest_br (2.2,-2), clip (true) { sync(); @@ -513,7 +517,11 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren // Real trans_z[4]; Real z,minz(10000000000000.0f),maxz(0); - + //! \todo checking the 4 corners for 0<=z0 && z=source.get_w() || v>=source.get_h() || isnan(u) || isnan(v)) - { (*surface)[y][x]=context.get_color(tmp); - } else (*surface)[y][x]=source.cubic_sample(u,v); } @@ -724,12 +730,7 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren v=(tmp[1]-tl[1])*src_ph; if(u<0 || v<0 || u>=source.get_w() || v>=source.get_h() || isnan(u) || isnan(v)) - { - if(clip) - (*surface)[y][x]=Color::alpha(); - else - (*surface)[y][x]=context.get_color(tmp); - } + (*surface)[y][x]=context.get_color(tmp); else (*surface)[y][x]=source.linear_sample(u,v); } @@ -762,15 +763,10 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren v=(tmp[1]-tl[1])*src_ph; if(u<0 || v<0 || u>=source.get_w() || v>=source.get_h() || isnan(u) || isnan(v)) - { - if(clip) - (*surface)[y][x]=Color::alpha(); - else - (*surface)[y][x]=context.get_color(tmp); - } + (*surface)[y][x]=context.get_color(tmp); else - //pen.set_value(source[v][u]); - (*surface)[y][x]=source[floor_to_int(v)][floor_to_int(u)]; + //pen.set_value(source[v][u]); + (*surface)[y][x]=source[floor_to_int(v)][floor_to_int(u)]; } if(y&31==0 && cb) {