|
|
d46c23 |
/* === S Y N F I G ========================================================= */
|
|
|
d46c23 |
/*! \file synfig/rendering/common/task/tasktransformation.h
|
|
|
d46c23 |
** \brief TaskTransformation Header
|
|
|
d46c23 |
**
|
|
|
d46c23 |
** $Id$
|
|
|
d46c23 |
**
|
|
|
d46c23 |
** \legal
|
|
|
da4398 |
** ......... ... 2015-2018 Ivan Mahonin
|
|
|
d46c23 |
**
|
|
|
d46c23 |
** This package is free software; you can redistribute it and/or
|
|
|
d46c23 |
** modify it under the terms of the GNU General Public License as
|
|
|
d46c23 |
** published by the Free Software Foundation; either version 2 of
|
|
|
d46c23 |
** the License, or (at your option) any later version.
|
|
|
d46c23 |
**
|
|
|
d46c23 |
** This package is distributed in the hope that it will be useful,
|
|
|
d46c23 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
d46c23 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
d46c23 |
** General Public License for more details.
|
|
|
d46c23 |
** \endlegal
|
|
|
d46c23 |
*/
|
|
|
d46c23 |
/* ========================================================================= */
|
|
|
d46c23 |
|
|
|
d46c23 |
/* === S T A R T =========================================================== */
|
|
|
d46c23 |
|
|
|
d46c23 |
#ifndef __SYNFIG_RENDERING_TASKTRANSFORMATION_H
|
|
|
d46c23 |
#define __SYNFIG_RENDERING_TASKTRANSFORMATION_H
|
|
|
d46c23 |
|
|
|
d46c23 |
/* === H E A D E R S ======================================================= */
|
|
|
d46c23 |
|
|
|
d46c23 |
#include "../../task.h"
|
|
|
da4398 |
#include "../../primitive/transformationaffine.h"
|
|
|
d46c23 |
|
|
|
d46c23 |
/* === M A C R O S ========================================================= */
|
|
|
d46c23 |
|
|
|
d46c23 |
/* === T Y P E D E F S ===================================================== */
|
|
|
d46c23 |
|
|
|
d46c23 |
/* === C L A S S E S & S T R U C T S ======================================= */
|
|
|
d46c23 |
|
|
|
d46c23 |
namespace synfig
|
|
|
d46c23 |
{
|
|
|
d46c23 |
namespace rendering
|
|
|
d46c23 |
{
|
|
|
d46c23 |
|
|
|
da4398 |
|
|
|
da4398 |
//! Interface for tasks which works identically while placed before or after transformation
|
|
|
da4398 |
class TaskInterfaceTransformationPass
|
|
|
da4398 |
{
|
|
|
da4398 |
public:
|
|
|
da4398 |
virtual ~TaskInterfaceTransformationPass() { }
|
|
|
da4398 |
};
|
|
|
da4398 |
|
|
|
da4398 |
|
|
|
da4398 |
class TaskInterfaceTransformation
|
|
|
da4398 |
{
|
|
|
da4398 |
public:
|
|
|
da4398 |
virtual ~TaskInterfaceTransformation() { }
|
|
|
3ae388 |
virtual Transformation::Handle get_transformation() const
|
|
|
da4398 |
{ return Transformation::Handle(); }
|
|
|
da4398 |
};
|
|
|
da4398 |
|
|
|
da4398 |
|
|
|
da4398 |
class TaskTransformation: public Task, public TaskInterfaceTransformation
|
|
|
d46c23 |
{
|
|
|
d46c23 |
public:
|
|
|
67f12d |
typedef etl::handle<tasktransformation> Handle;</tasktransformation>
|
|
|
da4398 |
static Token token;
|
|
|
5e2754 |
virtual Token::Handle get_token() const { return token.handle(); }
|
|
|
67f12d |
|
|
|
da4398 |
Color::Interpolation interpolation;
|
|
|
da4398 |
Vector supersample;
|
|
|
d46c23 |
|
|
|
81df8d |
TaskTransformation();
|
|
|
81df8d |
|
|
|
81df8d |
//! returns true then task just do transformation of first sub-task only
|
|
|
81df8d |
//! without supersampling and any drawings.
|
|
|
81df8d |
//! so this task may be fully merged into other suitable transformation task
|
|
|
81df8d |
virtual bool is_simple() const;
|
|
|
741d4d |
|
|
|
ae6532 |
virtual int get_pass_subtask_index() const;
|
|
|
78f7a3 |
|
|
|
d46c23 |
const Task::Handle& sub_task() const { return Task::sub_task(0); }
|
|
|
943a07 |
Task::Handle& sub_task() { return Task::sub_task(0); }
|
|
|
da4398 |
|
|
|
da4398 |
virtual Rect calc_bounds() const;
|
|
|
da4398 |
virtual void set_coords_sub_tasks();
|
|
|
da4398 |
};
|
|
|
da4398 |
|
|
|
da4398 |
|
|
|
da4398 |
class TaskTransformationAffine: public TaskTransformation
|
|
|
da4398 |
{
|
|
|
da4398 |
public:
|
|
|
da4398 |
typedef etl::handle<tasktransformationaffine> Handle;</tasktransformationaffine>
|
|
|
da4398 |
static Token token;
|
|
|
5e2754 |
virtual Token::Handle get_token() const { return token.handle(); }
|
|
|
da4398 |
|
|
|
da4398 |
Holder<transformationaffine> transformation;</transformationaffine>
|
|
|
da4398 |
|
|
|
3ae388 |
virtual Transformation::Handle get_transformation() const
|
|
|
da4398 |
{ return transformation.handle(); }
|
|
|
78f7a3 |
|
|
|
ae6532 |
virtual int get_pass_subtask_index() const;
|
|
|
d46c23 |
};
|
|
|
d46c23 |
|
|
|
da4398 |
|
|
|
d46c23 |
} /* end namespace rendering */
|
|
|
d46c23 |
} /* end namespace synfig */
|
|
|
d46c23 |
|
|
|
d46c23 |
/* -- E N D ----------------------------------------------------------------- */
|
|
|
d46c23 |
|
|
|
d46c23 |
#endif
|