A toolkit for working with phylogenetic data.
 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 100 of file gradient.hpp.

Public Member Functions

 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
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 ( 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.

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 130 of file gradient.hpp.

~SvgGradientLinear ( )
SvgGradientLinear ( SvgGradientLinear const &  )

Member Function Documentation

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

Definition at line 125 of file gradient.cpp.

void validate ( ) const

Definition at line 69 of file gradient.cpp.

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

Definition at line 82 of file gradient.cpp.

Member Typedef Documentation

Definition at line 108 of file gradient.hpp.

Member Enumeration Documentation

enum SpreadMethod

Definition at line 110 of file gradient.hpp.

Member Data Documentation

std::string id

Definition at line 163 of file gradient.hpp.

SvgPoint point_1

Definition at line 165 of file gradient.hpp.

SvgPoint point_2

Definition at line 166 of file gradient.hpp.

Definition at line 168 of file gradient.hpp.

std::vector< SvgGradientStop > stops

Definition at line 170 of file gradient.hpp.

SvgTransform transform

Definition at line 171 of file gradient.hpp.

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