/*! ========================================================================
-** 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 ===========================================================
**
#endif
#include "warp.h"
-#include <sinfg/string.h>
-#include <sinfg/time.h>
-#include <sinfg/context.h>
-#include <sinfg/paramdesc.h>
-#include <sinfg/renddesc.h>
-#include <sinfg/surface.h>
-#include <sinfg/value.h>
-#include <sinfg/valuenode.h>
-#include <sinfg/transform.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
+#include <synfig/context.h>
+#include <synfig/paramdesc.h>
+#include <synfig/renddesc.h>
+#include <synfig/surface.h>
+#include <synfig/value.h>
+#include <synfig/valuenode.h>
+#include <synfig/transform.h>
#include <ETL/misc>
#endif
/* === 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 ================================================= */
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);
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));
;
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
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());
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();