synfig-core
1.0.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
modules
mod_gradient
lineargradient.h
Go to the documentation of this file.
1
/* === S Y N F I G ========================================================= */
26
/* === S T A R T =========================================================== */
27
28
#ifndef __SYNFIG_INTERPOLATION_LINEARGRADIENT_H
29
#define __SYNFIG_INTERPOLATION_LINEARGRADIENT_H
30
31
/* === H E A D E R S ======================================================= */
32
33
#include <
synfig/vector.h
>
34
#include <
synfig/layers/layer_composite.h
>
35
#include <
synfig/gradient.h
>
36
37
/* === M A C R O S ========================================================= */
38
39
/* === T Y P E D E F S ===================================================== */
40
41
/* === C L A S S E S & S T R U C T S ======================================= */
42
43
using namespace
synfig;
44
using namespace
std;
45
using namespace
etl;
46
47
class
LinearGradient
:
public
Layer_Composite
,
public
Layer_NoDeform
48
{
49
SYNFIG_LAYER_MODULE_EXT
50
51
private
:
53
ValueBase
param_p1,param_p2;
55
ValueBase
param_gradient;
57
ValueBase
param_loop;
59
ValueBase
param_zigzag;
60
61
struct
Params {
62
synfig::Point
p1;
63
synfig::Point
p2;
64
synfig::Point
diff;
65
synfig::Gradient
gradient;
66
bool
loop;
67
bool
zigzag;
68
inline
Params(): loop(
false
), zigzag(
false
) { }
69
void
calc_diff();
70
};
71
72
void
fill_params(Params ¶ms)
const
;
73
synfig::Color
color_func(
const
Params ¶ms,
const
synfig::Point
&x,
synfig::Real
supersample = 0.0)
const
;
74
synfig::Real
calc_supersample(
const
Params ¶ms,
synfig::Real
pw,
synfig::Real
ph)
const
;
75
76
bool
compile_gradient(cairo_pattern_t* pattern,
Gradient
gradient)
const
;
77
78
public
:
79
LinearGradient
();
80
81
virtual
bool
set_param(
const
String
¶m,
const
ValueBase
&value);
82
virtual
ValueBase
get_param(
const
String
¶m)
const
;
83
virtual
Color
get_color(
Context
context,
const
Point
&pos)
const
;
84
virtual
bool
accelerated_render(
Context
context,
Surface
*surface,
int
quality,
const
RendDesc
&renddesc,
ProgressCallback
*cb)
const
;
85
virtual
bool
accelerated_cairorender(
Context
context, cairo_t *cr,
int
quality,
const
RendDesc
&renddesc,
ProgressCallback
*cb)
const
;
86
87
synfig::Layer::Handle
hit_check(
synfig::Context
context,
const
synfig::Point
&point)
const
;
88
89
virtual
Vocab
get_param_vocab()
const
;
90
};
91
92
/* === E N D =============================================================== */
93
94
#endif
Generated on Mon Nov 16 2015 15:33:43 for synfig-core by
1.8.1.2