#include <genesis/utils/formats/svg/gradient.hpp>
Definition at line 102 of file gradient.hpp.
Public Member Functions | |
SvgGradientLinear ()=default | |
SvgGradientLinear (std::string const &id, SvgPoint point_1=SvgPoint(0.0, 0.0), SvgPoint point_2=SvgPoint(1.0, 0.0)) | |
Construct a gradient, with an ID and a vector determining its direction. More... | |
SvgGradientLinear (SvgGradientLinear &&)=default | |
SvgGradientLinear (SvgGradientLinear const &)=default | |
~SvgGradientLinear ()=default | |
SvgGradientLinear & | add_stop (SvgGradientStop const &stop) |
bool | empty () const |
SvgGradientLinear & | operator= (SvgGradientLinear &&)=default |
SvgGradientLinear & | operator= (SvgGradientLinear const &)=default |
SvgGradientLinear & | set_stops (std::map< double, Color > const &ranges) |
void | validate () const |
void | write (std::ostream &out, size_t indent=0) const |
Public Types | |
using | self_type = SvgGradientLinear |
enum | SpreadMethod { kPad, kRepeat, kReflect } |
Public Attributes | |
std::string | id |
SvgPoint | point_1 |
SvgPoint | point_2 |
SpreadMethod | spread_method = SpreadMethod::kPad |
std::vector< SvgGradientStop > | stops |
SvgTransform | transform |
|
default |
|
inline |
Construct a gradient, with an ID and a vector determining its direction.
The coordinates of the two points need to be in the range [ 0.0, 1.0 ], as they are interpreted as percentages. This is what most SVG tools expect, so we stick to this convention.
By default, the points are set to a horizontal gradient spanning 0-100%.
Definition at line 134 of file gradient.hpp.
|
default |
|
default |
|
default |
SvgGradientLinear & add_stop | ( | SvgGradientStop const & | stop | ) |
Definition at line 180 of file gradient.cpp.
bool empty | ( | ) | const |
Definition at line 186 of file gradient.cpp.
|
default |
|
default |
SvgGradientLinear & set_stops | ( | std::map< double, Color > const & | ranges | ) |
Definition at line 169 of file gradient.cpp.
void validate | ( | ) | const |
Definition at line 77 of file gradient.cpp.
void write | ( | std::ostream & | out, |
size_t | indent = 0 |
||
) | const |
Definition at line 121 of file gradient.cpp.
using self_type = SvgGradientLinear |
Definition at line 110 of file gradient.hpp.
|
strong |
Enumerator | |
---|---|
kPad | |
kRepeat | |
kReflect |
Definition at line 112 of file gradient.hpp.
std::string id |
Definition at line 168 of file gradient.hpp.
SvgPoint point_1 |
Definition at line 170 of file gradient.hpp.
SvgPoint point_2 |
Definition at line 171 of file gradient.hpp.
SpreadMethod spread_method = SpreadMethod::kPad |
Definition at line 173 of file gradient.hpp.
std::vector< SvgGradientStop > stops |
Definition at line 175 of file gradient.hpp.
SvgTransform transform |
Definition at line 176 of file gradient.hpp.