FastLED 3.9.15
Loading...
Searching...
No Matches
viz_base.h
Go to the documentation of this file.
1#pragma once
2#include "fl/stl/noexcept.h"
3
4// IAnimartrix2Viz: abstract base class for all Animartrix2 visualizers.
5//
6// By default visualizers have no member variables — draw() bodies are identical
7// to the former free functions. Stateful visualizers (e.g. Chasing_Spirals_SIMD)
8// declare their cache as private members so state is owned per-instance rather
9// than as a global singleton.
10//
11// Lifetime is managed by Animartrix2 via fl::unique_ptr<IAnimartrix2Viz>:
12// a new instance is constructed when the selected animation changes, and the
13// previous instance (with its cached state) is automatically destroyed.
14
15namespace fl {
16
18public:
19 virtual ~IAnimartrix2Viz() FL_NOEXCEPT = default;
20 virtual void draw(Context &ctx) = 0;
21};
22
23} // namespace fl
virtual void draw(Context &ctx)=0
virtual ~IAnimartrix2Viz() FL_NOEXCEPT=default
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT