synfig-core
1.0.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
synfig
layers
layer_composite.h
Go to the documentation of this file.
1
/* === S Y N F I G ========================================================= */
22
/* ========================================================================= */
23
24
/* === S T A R T =========================================================== */
25
26
#ifndef __SYNFIG_LAYER_COMPOSITE_H
27
#define __SYNFIG_LAYER_COMPOSITE_H
28
29
/* === H E A D E R S ======================================================= */
30
31
#include <
synfig/layer.h
>
32
#include <
synfig/color.h
>
33
#include <
synfig/cairo_operators.h
>
34
35
/* === M A C R O S ========================================================= */
36
37
/* === T Y P E D E F S ===================================================== */
38
39
/* === C L A S S E S & S T R U C T S ======================================= */
40
41
namespace
synfig {
42
43
class
Layer_NoDeform
{};
44
45
49
class
Layer_Composite
:
public
Layer
50
{
51
private
:
53
ValueBase
param_amount;
55
ValueBase
param_blend_method;
56
57
protected
:
59
Layer_Composite
(
Real
amount=1.0,
Color::BlendMethod
blend_method=
Color::BLEND_COMPOSITE
);
60
64
bool
converted_blend_
;
67
bool
transparent_color_
;
68
69
public
:
71
float
get_amount
()
const
{
return
param_amount.
get
(
Real
()); }
73
Layer_Composite
&
set_amount
(
float
x) { param_amount.
set
(x);
return
*
this
; }
75
Color::BlendMethod
get_blend_method
()
const
{
return
Color::BlendMethod
((param_blend_method.
get
(
int
()))); }
77
Layer_Composite
&
set_blend_method
(
Color::BlendMethod
x) { param_blend_method.
set
(
int
(x));
return
*
this
; }
79
virtual
bool
is_solid_color
()
const
{
return
param_amount.
get
(
Real
())==1.0f && param_blend_method.
get
(
int
())==
Color::BLEND_STRAIGHT
; }
81
bool
is_disabled
()
const
{
return
param_amount.
get
(
Real
())==0.0f; }
83
virtual
Vocab
get_param_vocab
()
const
;
85
virtual
bool
set_param
(
const
String
¶m,
const
ValueBase
&value);
87
virtual
ValueBase
get_param
(
const
String
¶m)
const
;
90
virtual
Rect
get_full_bounding_rect
(
Context
context)
const
;
92
virtual
bool
accelerated_render
(
Context
context,
Surface
*surface,
int
quality,
const
RendDesc
&renddesc,
ProgressCallback
*cb)
const
;
93
virtual
bool
accelerated_cairorender
(
Context
context, cairo_t *cr,
int
quality,
const
RendDesc
&renddesc,
ProgressCallback
*cb)
const
;
94
};
// END of class Layer_Composite
95
96
};
// END of namespace synfig
97
98
/* === E N D =============================================================== */
99
100
#endif
Generated on Mon Nov 16 2015 15:33:42 for synfig-core by
1.8.1.2