1 /* === S Y N F I G ========================================================= */
2 /*! \file layer_composite.h
3 ** \brief Composite Layer Class Implementation
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2007 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === S T A R T =========================================================== */
26 #ifndef __SYNFIG_LAYER_COMPOSITE_H
27 #define __SYNFIG_LAYER_COMPOSITE_H
29 /* === H E A D E R S ======================================================= */
34 /* === M A C R O S ========================================================= */
36 /* === T Y P E D E F S ===================================================== */
38 /* === C L A S S E S & S T R U C T S ======================================= */
42 class Layer_NoDeform {};
45 /*! \class Layer_Composite
46 ** \brief Base class for layers that put stuff on top of lower layers
48 class Layer_Composite : public Layer
54 Color::BlendMethod blend_method_;
60 Color::BlendMethod blend_method=Color::BLEND_COMPOSITE
63 blend_method_ (blend_method)
68 float get_amount()const { return amount_; }
70 Layer_Composite& set_amount(float x) { amount_=x; return *this; }
72 Color::BlendMethod get_blend_method()const { return blend_method_; }
74 Layer_Composite& set_blend_method(Color::BlendMethod x) { blend_method_=x; return *this; }
76 virtual bool is_solid_color()const { return amount_==1.0f && blend_method_==Color::BLEND_STRAIGHT; }
78 bool is_disabled()const { return amount_==0.0f; }
80 virtual Vocab get_param_vocab()const;
82 virtual bool set_param(const String ¶m, const ValueBase &value);
84 virtual ValueBase get_param(const String ¶m)const;
86 virtual Rect get_full_bounding_rect(Context context)const;
88 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
89 }; // END of class Layer_Composite
91 }; // END of namespace synfig
93 /* === E N D =============================================================== */