FastLED 3.10.8
Loading...
Searching...
No Matches
blend.h
Go to the documentation of this file.
1/*
2Fx2d class that allows to blend multiple Fx2d layers together.
3The bottom layer is always drawn at full capacity. Upper layers
4are blended by the the max luminance of the components.
5*/
6
7#pragma once
8
9#include "fl/stl/stdint.h"
10
11#include "fl/fx/fx2d.h"
12#include "fl/stl/noexcept.h"
13
14// Forward declarations to reduce header overhead
15namespace fl {
16class Frame;
17class XYMap;
18template<typename T> // IWYU pragma: keep
19class vector; // IWYU pragma: keep
20
25
27
28class Blend2d : public Fx2d {
29 public:
31 // Note that if this xymap is non rectangular then it's recommended that the
32 // Fx2d layers that are added should be rectangular.
34 fl::string fxName() const FL_NO_EXCEPT override;
35 void add(Fx2dPtr layer, const Params &p = Params()) FL_NO_EXCEPT;
36 void add(Fx2d &layer, const Params &p = Params()) FL_NO_EXCEPT;
37 void draw(DrawContext context) FL_NO_EXCEPT override;
38 void clear() FL_NO_EXCEPT;
40 mGlobalBlurAmount = blur_amount;
41 }
43 mGlobalBlurPasses = blur_passes;
44 }
45 bool setParams(Fx2dPtr fx, const Params &p) FL_NO_EXCEPT;
46 bool setParams(Fx2d &fx, const Params &p) FL_NO_EXCEPT;
47
48 protected:
62};
63
64} // namespace fl
XYMap xymap
fl::string fxName() const FL_NO_EXCEPT override
Definition blend.cpp.hpp:27
void add(Fx2dPtr layer, const Params &p=Params()) FL_NO_EXCEPT
Definition blend.cpp.hpp:39
void draw(DrawContext context) FL_NO_EXCEPT override
Definition blend.cpp.hpp:57
fl::shared_ptr< Frame > mFrameTransform
Definition blend.h:59
Blend2dParams Params
Definition blend.h:30
u8 mGlobalBlurAmount
Definition blend.h:60
void clear() FL_NO_EXCEPT
bool setParams(Fx2dPtr fx, const Params &p) FL_NO_EXCEPT
fl::shared_ptr< Frame > mFrame
Definition blend.h:58
u8 mGlobalBlurPasses
Definition blend.h:61
Blend2d(const XYMap &xymap) FL_NO_EXCEPT
Definition blend.cpp.hpp:19
void setGlobalBlurAmount(u8 blur_amount) FL_NO_EXCEPT
Definition blend.h:39
void setGlobalBlurPasses(u8 blur_passes) FL_NO_EXCEPT
Definition blend.h:42
vector< Entry > mLayers
Definition blend.h:57
Fx2d(const XYMap &xyMap) FL_NO_EXCEPT
Definition fx2d.h:20
unsigned char u8
Definition stdint.h:131
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
Base definition for an LED controller.
#define FASTLED_SHARED_PTR(type)
Definition shared_ptr.h:577
u8 blur_amount
Definition blend.h:51
Entry() FL_NO_EXCEPT=default
Fx2dPtr fx
Definition blend.h:50
u8 blur_passes
Definition blend.h:52