Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::FilterEffect Struct Reference

Filter effect container, which can contain a reference to another filter effect, or a filter effect itself (of any type). More...

#include "donner/svg/components/filter/FilterEffect.h"

Classes

struct  Blur
 Blur effect, which applies a gaussian blur with the given standard deviation. More...
 
struct  ElementReference
 Reference to another filter effect, from a url() More...
 
struct  None
 No effect. More...
 

Public Types

using Type = std::variant<None, Blur, ElementReference>
 Variant containing all supported effects.
 

Public Member Functions

 FilterEffect (Type value)
 Construct a filter effect from a pre-constructed filter.
 
constexpr FilterEffect (None)
 Construct an empty filter, which applies no effect, as a constexpr constructor.
 
bool operator== (const FilterEffect &other) const
 Equality operator.
 
template<typename T >
bool is () const
 Returns true if this filter effect is of type T.
 
template<typename T >
T & get () &
 Returns the filter effect as type T, asserting that the filter effect is of type T.
 
template<typename T >
const T & get () const &
 Returns the filter effect as type T, asserting that the filter effect is of type T.
 
template<typename T >
T && get () &&
 Returns the filter effect as type T, asserting that the filter effect is of type T.
 

Public Attributes

Type value
 Filter effect variant value, contains the current effect.
 

Friends

std::ostream & operator<< (std::ostream &os, const FilterEffect &filter)
 Ostream output operator.
 

Detailed Description

Filter effect container, which can contain a reference to another filter effect, or a filter effect itself (of any type).

Constructor & Destructor Documentation

◆ FilterEffect()

donner::svg::FilterEffect::FilterEffect ( Type value)
inline

Construct a filter effect from a pre-constructed filter.

Parameters
valueFilter effect to assign.

Member Function Documentation

◆ get() [1/3]

template<typename T >
T & donner::svg::FilterEffect::get ( ) &
inline

Returns the filter effect as type T, asserting that the filter effect is of type T.

Template Parameters
TType to get.

◆ get() [2/3]

template<typename T >
T && donner::svg::FilterEffect::get ( ) &&
inline

Returns the filter effect as type T, asserting that the filter effect is of type T.

Template Parameters
TType to get.

◆ get() [3/3]

template<typename T >
const T & donner::svg::FilterEffect::get ( ) const &
inline

Returns the filter effect as type T, asserting that the filter effect is of type T.

Template Parameters
TType to get.

◆ is()

template<typename T >
bool donner::svg::FilterEffect::is ( ) const
inline

Returns true if this filter effect is of type T.

Template Parameters
TType to check.

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