X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Flyr_std%2Fwarp.cpp;h=ec565966b65048bea90b814a1519993c0fecbab1;hb=e3f4437fedbdd74aebbf1675723978853dac8a8b;hp=3abf207843efd84cf516f623710cbe13771a8bb3;hpb=ff8f4acc7043d7b3874f006513ac4d8a3ea54690;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 3abf207..ec56596 100644 --- a/synfig-core/trunk/src/modules/lyr_std/warp.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/warp.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file warp.cpp -** \brief Template File +** \brief Implementation of the "Warp" layer ** ** $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 @@ -51,8 +52,8 @@ SYNFIG_LAYER_INIT(Warp); SYNFIG_LAYER_SET_NAME(Warp,"warp"); -SYNFIG_LAYER_SET_LOCAL_NAME(Warp,_("Warp")); -SYNFIG_LAYER_SET_CATEGORY(Warp,_("Distortions")); +SYNFIG_LAYER_SET_LOCAL_NAME(Warp,N_("Warp")); +SYNFIG_LAYER_SET_CATEGORY(Warp,N_("Distortions")); SYNFIG_LAYER_SET_VERSION(Warp,"0.1"); SYNFIG_LAYER_SET_CVS_ID(Warp,"$Id$"); @@ -516,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 && zset_wh(renddesc.get_w(),renddesc.get_h()); + surface->clear(); + return true; + } if(tl[0]>br[0]) { @@ -691,9 +706,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)) - { (*surface)[y][x]=context.get_color(tmp); - } else (*surface)[y][x]=source.cubic_sample(u,v); } @@ -727,12 +740,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); } @@ -765,15 +773,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) {