A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SvgGradientLinear Struct Reference

#include <genesis/utils/formats/svg/gradient.hpp>

Detailed Description

Definition at line 102 of file gradient.hpp.

Public Member Functions

 SvgGradientLinear ()=default
 
 SvgGradientLinear (std::string 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 const &)=default
 
 SvgGradientLinear (SvgGradientLinear &&)=default
 
 ~SvgGradientLinear ()=default
 
SvgGradientLinearadd_stop (SvgGradientStop const &stop)
 
bool empty () const
 
SvgGradientLinearoperator= (SvgGradientLinear const &)=default
 
SvgGradientLinearoperator= (SvgGradientLinear &&)=default
 
SvgGradientLinearset_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< SvgGradientStopstops
 
SvgTransform transform
 

Constructor & Destructor Documentation

SvgGradientLinear ( )
default
SvgGradientLinear ( std::string  id,
SvgPoint  point_1 = SvgPoint( 0.0, 0.0 ),
SvgPoint  point_2 = SvgPoint( 1.0, 0.0 ) 
)
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.

~SvgGradientLinear ( )
default
SvgGradientLinear ( SvgGradientLinear const &  )
default

Member Function Documentation

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.

SvgGradientLinear& operator= ( SvgGradientLinear const &  )
default
SvgGradientLinear& operator= ( SvgGradientLinear &&  )
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.

Member Typedef Documentation

Definition at line 110 of file gradient.hpp.

Member Enumeration Documentation

enum SpreadMethod
strong
Enumerator
kPad 
kRepeat 
kReflect 

Definition at line 112 of file gradient.hpp.

Member Data Documentation

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.

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.


The documentation for this struct was generated from the following files: