|
Carlos Lopez |
a09598 |
/* === S Y N F I G ========================================================= */
|
|
Carlos Lopez |
a09598 |
/*! \file warp.h
|
|
Carlos Lopez |
a09598 |
** \brief Header file for implementation of the "Warp" layer
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** $Id$
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** \legal
|
|
Carlos Lopez |
a09598 |
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
|
|
Carlos Lopez |
e83454 |
** Copyright (c) 2012-2013 Carlos Lรณpez
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** This package is free software; you can redistribute it and/or
|
|
Carlos Lopez |
a09598 |
** modify it under the terms of the GNU General Public License as
|
|
Carlos Lopez |
a09598 |
** published by the Free Software Foundation; either version 2 of
|
|
Carlos Lopez |
a09598 |
** the License, or (at your option) any later version.
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** This package is distributed in the hope that it will be useful,
|
|
Carlos Lopez |
a09598 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Carlos Lopez |
a09598 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Carlos Lopez |
a09598 |
** General Public License for more details.
|
|
Carlos Lopez |
a09598 |
** \endlegal
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** === N O T E S ===========================================================
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** ========================================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === S T A R T =========================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#ifndef __SYNFIG_WARP_H
|
|
Carlos Lopez |
a09598 |
#define __SYNFIG_WARP_H
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === H E A D E R S ======================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#include <synfig vector.h=""></synfig>
|
|
Carlos Lopez |
a09598 |
#include <synfig angle.h=""></synfig>
|
|
Carlos Lopez |
a09598 |
#include <synfig layer.h=""></synfig>
|
|
Carlos Lopez |
a09598 |
#include <synfig rect.h=""></synfig>
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === M A C R O S ========================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === T Y P E D E F S ===================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === C L A S S E S & S T R U C T S ======================================= */
|
|
Carlos Lopez |
a09598 |
|
|
|
144d3f |
namespace synfig
|
|
|
144d3f |
{
|
|
|
144d3f |
namespace modules
|
|
|
144d3f |
{
|
|
|
9f3c68 |
namespace lyr_std
|
|
|
9f3c68 |
{
|
|
|
9f3c68 |
|
|
Carlos Lopez |
a09598 |
class Warp_Trans;
|
|
Carlos Lopez |
a09598 |
|
|
|
cf1df9 |
class Warp: public Layer
|
|
Carlos Lopez |
a09598 |
{
|
|
Carlos Lopez |
a09598 |
SYNFIG_LAYER_MODULE_EXT
|
|
Carlos Lopez |
a09598 |
friend class Warp_Trans;
|
|
Carlos Lopez |
a09598 |
private:
|
|
Carlos Lopez |
3a7fde |
//! Parameters: (Point)
|
|
Carlos Lopez |
3a7fde |
ValueBase param_src_tl;
|
|
Carlos Lopez |
3a7fde |
ValueBase param_src_br;
|
|
Carlos Lopez |
3a7fde |
ValueBase param_dest_tl;
|
|
Carlos Lopez |
3a7fde |
ValueBase param_dest_tr;
|
|
Carlos Lopez |
3a7fde |
ValueBase param_dest_bl;
|
|
Carlos Lopez |
3a7fde |
ValueBase param_dest_br;
|
|
Carlos Lopez |
3a7fde |
//! Parameter: (bool)
|
|
Carlos Lopez |
3a7fde |
ValueBase param_clip;
|
|
|
9abc9e |
//! Parameter: (int)
|
|
|
9abc9e |
ValueBase param_interpolation;
|
|
Carlos Lopez |
a09598 |
|
|
|
cf1df9 |
bool valid;
|
|
|
cf1df9 |
bool affine;
|
|
|
cf1df9 |
Matrix matrix;
|
|
|
cf1df9 |
Matrix back_matrix;
|
|
|
cf1df9 |
bool clip;
|
|
|
cf1df9 |
Rect clip_rect;
|
|
Carlos Lopez |
a09598 |
|
|
|
cf1df9 |
Point transform(const Point &x) const;
|
|
|
cf1df9 |
Point back_transform(const Point &x) const;
|
|
Carlos Lopez |
a09598 |
|
|
|
cf1df9 |
Rect transform(const Rect &x) const;
|
|
|
cf1df9 |
Rect back_transform(const Rect &x) const;
|
|
|
cf1df9 |
|
|
Carlos Lopez |
a09598 |
public:
|
|
Carlos Lopez |
a09598 |
void sync();
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
Warp();
|
|
Carlos Lopez |
a09598 |
~Warp();
|
|
Carlos Lopez |
a09598 |
|
|
|
cf1df9 |
virtual Rect get_bounding_rect() const;
|
|
|
cf1df9 |
virtual Rect get_full_bounding_rect(Context context) const;
|
|
Carlos Lopez |
a09598 |
|
|
|
9f3c68 |
virtual bool set_param(const String & param, const ValueBase &value);
|
|
|
cf1df9 |
virtual ValueBase get_param(const String & param) const;
|
|
|
cf1df9 |
virtual Vocab get_param_vocab() const;
|
|
|
cf1df9 |
|
|
|
cf1df9 |
virtual Color get_color(Context context, const Point &pos) const;
|
|
|
cf1df9 |
virtual Layer::Handle hit_check(Context context, const Point &point) const;
|
|
|
cf1df9 |
virtual etl::handle<transform> get_transform() const;</transform>
|
|
|
b30506 |
|
|
|
b30506 |
protected:
|
|
|
cf1df9 |
virtual rendering::Task::Handle build_rendering_task_vfunc(Context context)const;
|
|
Carlos Lopez |
a09598 |
};
|
|
Carlos Lopez |
a09598 |
|
|
|
144d3f |
}; // END of namespace lyr_std
|
|
|
144d3f |
}; // END of namespace modules
|
|
|
144d3f |
}; // END of namespace synfig
|
|
|
9f3c68 |
|
|
Carlos Lopez |
a09598 |
/* === E N D =============================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#endif
|