A toolkit for working with phylogenetic data.
v0.24.0
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 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 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() [1/4]

SvgGradientLinear ( )
default

◆ SvgGradientLinear() [2/4]

SvgGradientLinear ( std::string const &  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()

~SvgGradientLinear ( )
default

◆ SvgGradientLinear() [3/4]

SvgGradientLinear ( SvgGradientLinear const &  )
default

◆ SvgGradientLinear() [4/4]

Member Function Documentation

◆ add_stop()

SvgGradientLinear & add_stop ( SvgGradientStop const &  stop)

Definition at line 180 of file gradient.cpp.

◆ empty()

bool empty ( ) const

Definition at line 186 of file gradient.cpp.

◆ operator=() [1/2]

SvgGradientLinear& operator= ( SvgGradientLinear const &  )
default

◆ operator=() [2/2]

SvgGradientLinear& operator= ( SvgGradientLinear &&  )
default

◆ set_stops()

SvgGradientLinear & set_stops ( std::map< double, Color > const &  ranges)

Definition at line 169 of file gradient.cpp.

◆ validate()

void validate ( ) const

Definition at line 77 of file gradient.cpp.

◆ write()

void write ( std::ostream &  out,
size_t  indent = 0 
) const

Definition at line 121 of file gradient.cpp.

Member Typedef Documentation

◆ self_type

Definition at line 110 of file gradient.hpp.

Member Enumeration Documentation

◆ SpreadMethod

enum SpreadMethod
strong
Enumerator
kPad 
kRepeat 
kReflect 

Definition at line 112 of file gradient.hpp.

Member Data Documentation

◆ id

std::string id

Definition at line 168 of file gradient.hpp.

◆ point_1

SvgPoint point_1

Definition at line 170 of file gradient.hpp.

◆ point_2

SvgPoint point_2

Definition at line 171 of file gradient.hpp.

◆ spread_method

Definition at line 173 of file gradient.hpp.

◆ stops

std::vector< SvgGradientStop > stops

Definition at line 175 of file gradient.hpp.

◆ transform

SvgTransform transform

Definition at line 176 of file gradient.hpp.


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