pixled-lib  1.0
Public Member Functions | List of all members
pixled::animation::Sequence Class Reference

#include <animation.h>

Inheritance diagram for pixled::animation::Sequence:
Inheritance graph
[legend]
Collaboration diagram for pixled::animation::Sequence:
Collaboration graph
[legend]

Public Member Functions

 Sequence ()
 
 Sequence (std::vector< SequenceItem > sequence)
 
template<typename Anim >
Sequenceadd (Anim &&animation, time duration)
 
color operator() (led l, time t) const override
 
Sequencecopy () const override
 

Additional Inherited Members

- Public Types inherited from pixled::base::Function< color >
typedef color Type
 

Detailed Description

Defines a sequence of animations.

Examples
pixled/animation/sequence.cpp.

Constructor & Destructor Documentation

◆ Sequence() [1/2]

pixled::animation::Sequence::Sequence ( )
inline

Initializes an emty Sequence.

Sequence items can be added later using the add() method.

◆ Sequence() [2/2]

pixled::animation::Sequence::Sequence ( std::vector< SequenceItem sequence)
inline

Sequence constructor.

The sequence can be conveniently specified using initializer lists:

Sequence seq({
{anim1, 10},
{anim2, 15},
{anim1, 10},
{anim3, 20}
});
Sequence()
Definition: animation.h:212

Sequence items can also be added later using the add() method.

Parameters
sequencea SequenceItem list describing the sequence.

Member Function Documentation

◆ add()

template<typename Anim >
Sequence& pixled::animation::Sequence::add ( Anim &&  animation,
time  duration 
)
inline

Adds an item to the Sequence.

Sequence sequence;
sequence
.add(anim1, 10)
.add(anim2, 15)
.add(anim1, 10)
.add(anim3, 20);
Template Parameters
Animautomatically deduced
Parameters
animationAn Animation, passed by lvalue or rvalue
durationAnimation duration in the Sequence
Returns
reference to the current sequence

◆ operator()()

color pixled::animation::Sequence::operator() ( led  l,
time  t 
) const
overridevirtual

Computes the value of this Function for led l at time t.

Parameters
lled
ttime
Returns
Result of this Function, evaluated on led l at time t. Notice that evaluating a function usually requires the recursive evaluation of other Functions (that are actually parameters of this function) until a Constant is reached for example.

Implements pixled::base::Function< color >.

◆ copy()

Sequence * pixled::animation::Sequence::copy ( ) const
overridevirtual

Returns a dynamically allocated copy of this function.

Returns
copy of this function

Implements pixled::base::Function< color >.


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