FastLED
3.9.15
Loading...
Searching...
No Matches
fx2d.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
fl/stl/stdint.h
"
4
5
#include "
fl/stl/shared_ptr.h
"
// For FASTLED_SHARED_PTR macros
6
#include "
fl/math/xymap.h
"
7
#include "
fl/fx/fx.h
"
8
9
namespace
fl
{
10
11
FASTLED_SHARED_PTR
(
Fx2d
);
12
13
// Abstract base class for 2D effects that use a grid, which is defined
14
// by an XYMap.
15
class
Fx2d
:
public
Fx
{
16
public
:
17
// XYMap holds either a function or a look up table to map x, y coordinates
18
// to a 1D index.
19
Fx2d
(
const
XYMap
&
xyMap
) :
Fx
(
xyMap
.getTotal()),
mXyMap
(
xyMap
) {}
20
u16
xyMap
(u16
x
, u16
y
)
const
{
21
return
mXyMap
.mapToIndex(
x
,
y
);
22
}
23
u16
getHeight
()
const
{
return
mXyMap
.getHeight(); }
24
u16
getWidth
()
const
{
return
mXyMap
.getWidth(); }
25
void
setXYMap
(
const
XYMap
&
xyMap
) {
mXyMap
=
xyMap
; }
26
XYMap
&
getXYMap
() {
return
mXyMap
; }
27
const
XYMap
&
getXYMap
()
const
{
return
mXyMap
; }
28
29
protected
:
30
XYMap
mXyMap
;
31
};
32
33
}
// namespace fl
fl::Fx2d::setXYMap
void setXYMap(const XYMap &xyMap)
Definition
fx2d.h:25
fl::Fx2d::mXyMap
XYMap mXyMap
Definition
fx2d.h:30
fl::Fx2d::getXYMap
XYMap & getXYMap()
Definition
fx2d.h:26
fl::Fx2d::getXYMap
const XYMap & getXYMap() const
Definition
fx2d.h:27
fl::Fx2d::Fx2d
Fx2d(const XYMap &xyMap)
Definition
fx2d.h:19
fl::Fx2d::getWidth
u16 getWidth() const
Definition
fx2d.h:24
fl::Fx2d::getHeight
u16 getHeight() const
Definition
fx2d.h:23
fl::Fx2d::xyMap
u16 xyMap(u16 x, u16 y) const
Definition
fx2d.h:20
fl::Fx2d
Definition
fx2d.h:15
fl::Fx::Fx
Fx(u16 numLeds)
Definition
fx.h:23
fl::XYMap
Definition
xymap.h:41
fx.h
fl::x
x
Definition
transposition.cpp.hpp:24
fl::y
y
Definition
transposition.cpp.hpp:23
fl
Base definition for an LED controller.
Definition
crgb.hpp:179
FASTLED_SHARED_PTR
#define FASTLED_SHARED_PTR(type)
Definition
shared_ptr.h:535
shared_ptr.h
stdint.h
xymap.h
fl
fx
fx2d.h
Generated on Tue Jun 16 2026 00:06:59 for FastLED by
1.13.2