|
|
248685 |
/* === S Y N F I G ========================================================= */
|
|
|
c7288b |
/*! \file synfig/rendering/primitive/transformationaffine.h
|
|
|
c7288b |
** \brief TransformationAffine Header
|
|
|
248685 |
**
|
|
|
248685 |
** $Id$
|
|
|
248685 |
**
|
|
|
248685 |
** \legal
|
|
|
da4398 |
** ......... ... 2015-2018 Ivan Mahonin
|
|
|
248685 |
**
|
|
|
248685 |
** This package is free software; you can redistribute it and/or
|
|
|
248685 |
** modify it under the terms of the GNU General Public License as
|
|
|
248685 |
** published by the Free Software Foundation; either version 2 of
|
|
|
248685 |
** the License, or (at your option) any later version.
|
|
|
248685 |
**
|
|
|
248685 |
** This package is distributed in the hope that it will be useful,
|
|
|
248685 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
248685 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
248685 |
** General Public License for more details.
|
|
|
248685 |
** \endlegal
|
|
|
248685 |
*/
|
|
|
248685 |
/* ========================================================================= */
|
|
|
248685 |
|
|
|
248685 |
/* === S T A R T =========================================================== */
|
|
|
248685 |
|
|
|
c7288b |
#ifndef __SYNFIG_RENDERING_TRANSFORMATIONAFFINE_H
|
|
|
c7288b |
#define __SYNFIG_RENDERING_TRANSFORMATIONAFFINE_H
|
|
|
248685 |
|
|
|
248685 |
/* === H E A D E R S ======================================================= */
|
|
|
248685 |
|
|
|
248685 |
#include <synfig matrix.h=""></synfig>
|
|
|
248685 |
|
|
|
248685 |
#include "transformation.h"
|
|
|
248685 |
|
|
|
248685 |
/* === M A C R O S ========================================================= */
|
|
|
248685 |
|
|
|
248685 |
/* === T Y P E D E F S ===================================================== */
|
|
|
248685 |
|
|
|
248685 |
/* === C L A S S E S & S T R U C T S ======================================= */
|
|
|
248685 |
|
|
|
248685 |
namespace synfig
|
|
|
248685 |
{
|
|
|
248685 |
namespace rendering
|
|
|
248685 |
{
|
|
|
248685 |
|
|
|
da4398 |
class TransformationAffine: public Transformation
|
|
|
248685 |
{
|
|
|
248685 |
public:
|
|
|
da4398 |
typedef etl::handle<transformationaffine> Handle;</transformationaffine>
|
|
|
248685 |
|
|
|
248685 |
Matrix matrix;
|
|
|
248685 |
|
|
|
da4398 |
TransformationAffine() { }
|
|
|
5e2754 |
explicit TransformationAffine(const Matrix &matrix): matrix(matrix) { }
|
|
|
f44ff0 |
|
|
|
f44ff0 |
static Vector calc_optimal_resolution(const Matrix2 &matrix);
|
|
|
f44ff0 |
static Bounds transform_bounds_affine(const Matrix &matrix, const Bounds &bounds);
|
|
|
da4398 |
|
|
|
248685 |
protected:
|
|
|
81df8d |
virtual Transformation* clone_vfunc() const;
|
|
|
81df8d |
virtual Transformation* create_inverted_vfunc() const;
|
|
|
f44ff0 |
virtual Point transform_vfunc(const Point &x) const;
|
|
|
f44ff0 |
virtual Matrix2 derivative_vfunc(const Point &x) const;
|
|
|
da4398 |
virtual Bounds transform_bounds_vfunc(const Bounds &bounds) const;
|
|
|
81df8d |
virtual bool can_merge_outer_vfunc(const Transformation &other) const;
|
|
|
81df8d |
virtual bool can_merge_inner_vfunc(const Transformation &other) const;
|
|
|
81df8d |
virtual void merge_outer_vfunc(const Transformation &other);
|
|
|
81df8d |
virtual void merge_inner_vfunc(const Transformation &other);
|
|
|
248685 |
};
|
|
|
248685 |
|
|
|
248685 |
} /* end namespace rendering */
|
|
|
248685 |
} /* end namespace synfig */
|
|
|
248685 |
|
|
|
248685 |
/* -- E N D ----------------------------------------------------------------- */
|
|
|
248685 |
|
|
|
248685 |
#endif
|