FastLED
3.9.15
Loading...
Searching...
No Matches
◆
mapToIndex()
[1/2]
uint16_t fl::XYMap::mapToIndex
(
const uint16_t &
x
,
const uint16_t &
y
) const
Definition at line
97
of file
xymap.cpp
.
97
{
98
uint16_t index;
99
switch
(
type
) {
100
case
kSerpentine
: {
101
uint16_t xx =
x
%
width
;
102
uint16_t yy =
y
%
height
;
103
index =
xy_serpentine
(xx, yy,
width
,
height
);
104
break
;
105
}
106
case
kLineByLine
: {
107
uint16_t xx =
x
%
width
;
108
uint16_t yy =
y
%
height
;
109
index =
xy_line_by_line
(xx, yy,
width
,
height
);
110
break
;
111
}
112
case
kFunction
:
113
index =
xyFunction
(
x
,
y
,
width
,
height
);
114
break
;
115
case
kLookUpTable
:
116
index =
mLookUpTable
->getData()[
y
*
width
+
x
];
117
break
;
118
default
:
119
return
0;
120
}
121
return
index +
mOffset
;
122
}
x
uint32_t x[NUM_LAYERS]
Definition
Fire2023.ino:82
y
uint32_t y[NUM_LAYERS]
Definition
Fire2023.ino:83
XYMap::mOffset
uint16_t mOffset
Definition
xymap.h:125
XYMap::width
uint16_t width
Definition
xymap.h:121
XYMap::kSerpentine
@ kSerpentine
Definition
xymap.h:45
XYMap::kFunction
@ kFunction
Definition
xymap.h:45
XYMap::kLineByLine
@ kLineByLine
Definition
xymap.h:45
XYMap::kLookUpTable
@ kLookUpTable
Definition
xymap.h:45
XYMap::height
uint16_t height
Definition
xymap.h:122
XYMap::mLookUpTable
fl::LUT16Ptr mLookUpTable
Definition
xymap.h:124
XYMap::type
XyMapType type
Definition
xymap.h:120
fl::XYMap::xyFunction
XYFunction xyFunction
Definition
xymap.h:123
fl::xy_serpentine
FASTLED_FORCE_INLINE uint16_t xy_serpentine(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
Definition
xymap.h:17
fl::xy_line_by_line
FASTLED_FORCE_INLINE uint16_t xy_line_by_line(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
Definition
xymap.h:27
XYMap
Generated on Sat May 24 2025 22:44:24 for FastLED by
1.13.2