X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Flyr_std%2Fwarp.cpp;h=71c57f2f5d83d4fa25deed4cb305e3dd77bb1fa4;hb=49b7555d9c8ae6590a56b5dcc82f34ee8b025e34;hp=24c42c7ab26db54e70c736df1a400d10151446c5;hpb=16b3beced25134bef064705568ecb893a6be4e79;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 24c42c7..71c57f2 100644 --- a/synfig-core/trunk/src/modules/lyr_std/warp.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/warp.cpp @@ -1,18 +1,19 @@ /*! ======================================================================== -** Sinfg +** Synfig ** Template File ** $Id: warp.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $ ** -** 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. ** ** === N O T E S =========================================================== ** @@ -28,15 +29,15 @@ #endif #include "warp.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #endif @@ -45,12 +46,12 @@ /* === G L O B A L S ======================================================= */ -SINFG_LAYER_INIT(Warp); -SINFG_LAYER_SET_NAME(Warp,"warp"); -SINFG_LAYER_SET_LOCAL_NAME(Warp,_("Warp")); -SINFG_LAYER_SET_CATEGORY(Warp,_("Distortions")); -SINFG_LAYER_SET_VERSION(Warp,"0.1"); -SINFG_LAYER_SET_CVS_ID(Warp,"$Id: warp.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $"); +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_VERSION(Warp,"0.1"); +SYNFIG_LAYER_SET_CVS_ID(Warp,"$Id: warp.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $"); /* === P R O C E D U R E S ================================================= */ @@ -409,14 +410,14 @@ class Warp_Trans : public Transform public: Warp_Trans(const Warp* x):Transform(x->get_guid()),layer(x) { } - sinfg::Vector perform(const sinfg::Vector& x)const + synfig::Vector perform(const synfig::Vector& x)const { return layer->transform_backward(x); //Point pos(x-layer->origin); //return Point(layer->cos_val*pos[0]-layer->sin_val*pos[1],layer->sin_val*pos[0]+layer->cos_val*pos[1])+layer->origin; } - sinfg::Vector unperform(const sinfg::Vector& x)const + synfig::Vector unperform(const synfig::Vector& x)const { return layer->transform_forward(x); @@ -430,8 +431,8 @@ Warp::get_transform()const return new Warp_Trans(this); } -sinfg::Layer::Handle -Warp::hit_check(sinfg::Context context, const sinfg::Point &p)const +synfig::Layer::Handle +Warp::hit_check(synfig::Context context, const synfig::Point &p)const { Point newpos(transform_forward(p)); @@ -588,8 +589,8 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren ; swap(tl[1],br[1]);*/ - //sinfg::warning("given window: [%f,%f]-[%f,%f] %dx%d",tl[0],tl[1],br[0],br[1],renddesc.get_w(),renddesc.get_h()); - //sinfg::warning("Projected: [%f,%f]-[%f,%f]",bounding_rect.get_min()[0],bounding_rect.get_min()[1],bounding_rect.get_max()[0],bounding_rect.get_max()[1]); + //synfig::warning("given window: [%f,%f]-[%f,%f] %dx%d",tl[0],tl[1],br[0],br[1],renddesc.get_w(),renddesc.get_h()); + //synfig::warning("Projected: [%f,%f]-[%f,%f]",bounding_rect.get_min()[0],bounding_rect.get_min()[1],bounding_rect.get_max()[0],bounding_rect.get_max()[1]); // If we are clipping, then go ahead and clip to the // source rectangle @@ -641,7 +642,7 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren desc.set_br(br); desc.set_wh(ceil_to_int(src_pw*(br[0]-tl[0])),ceil_to_int(src_ph*(br[1]-tl[1]))); - //sinfg::warning("surface to render: [%f,%f]-[%f,%f] %dx%d",desc.get_tl()[0],desc.get_tl()[1],desc.get_br()[0],desc.get_br()[1],desc.get_w(),desc.get_h()); + //synfig::warning("surface to render: [%f,%f]-[%f,%f] %dx%d",desc.get_tl()[0],desc.get_tl()[1],desc.get_br()[0],desc.get_br()[1],desc.get_w(),desc.get_h()); if(desc.get_w()==0 && desc.get_h()==0) { surface->set_wh(renddesc.get_w(),renddesc.get_h()); @@ -786,13 +787,13 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren return true; } -sinfg::Rect +synfig::Rect Warp::get_bounding_rect()const { return Rect::full_plane(); } -sinfg::Rect +synfig::Rect Warp::get_full_bounding_rect(Context context)const { // return Rect::full_plane();