FastLED 3.9.15
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.
33 Blend2d(const XYMap &xymap);
34 fl::string fxName() const override;
35 void add(Fx2dPtr layer, const Params &p = Params());
36 void add(Fx2d &layer, const Params &p = Params());
37 void draw(DrawContext context) override;
38 void clear();
42 void setGlobalBlurPasses(u8 blur_passes) {
43 mGlobalBlurPasses = blur_passes;
44 }
45 bool setParams(Fx2dPtr fx, const Params &p);
46 bool setParams(Fx2d &fx, const Params &p);
47
48 protected:
62};
63
64} // namespace fl
XYMap xymap
fl::shared_ptr< Frame > mFrameTransform
Definition blend.h:59
fl::string fxName() const override
Definition blend.cpp.hpp:26
Blend2d(const XYMap &xymap)
Definition blend.cpp.hpp:18
Blend2dParams Params
Definition blend.h:30
u8 mGlobalBlurAmount
Definition blend.h:60
void add(Fx2dPtr layer, const Params &p=Params())
Definition blend.cpp.hpp:38
bool setParams(Fx2dPtr fx, const Params &p)
void setGlobalBlurAmount(u8 blur_amount)
Definition blend.h:39
fl::shared_ptr< Frame > mFrame
Definition blend.h:58
u8 mGlobalBlurPasses
Definition blend.h:61
void draw(DrawContext context) override
Definition blend.cpp.hpp:56
vector< Entry > mLayers
Definition blend.h:57
void setGlobalBlurPasses(u8 blur_passes)
Definition blend.h:42
Fx2d(const XYMap &xyMap)
Definition fx2d.h:19
unsigned char u8
Definition stdint.h:131
u8 u8 fract8 blur_amount
Definition blur.h:186
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT
#define FASTLED_SHARED_PTR(type)
Definition shared_ptr.h:535
u8 blur_amount
Definition blend.h:51
Fx2dPtr fx
Definition blend.h:50
Entry() FL_NOEXCEPT=default
u8 blur_passes
Definition blend.h:52