FastLED 3.9.15
Loading...
Searching...
No Matches

◆ mapToIndex() [2/2]

template<typename IntType, typename = fl::enable_if_t<!fl::is_integral<IntType>::value>>
u16 fl::XYMap::mapToIndex ( IntType x,
IntType y ) const
inline

Definition at line 95 of file xymap.h.

95 {
96 x = fl::clamp<int>(x, 0, width - 1);
97 y = fl::clamp<int>(y, 0, height - 1);
98 return mapToIndex((u16)x, (u16)y);
99 }
int y
Definition simple.h:93
int x
Definition simple.h:92
u16 width
Definition xymap.h:127
u16 mapToIndex(const u16 &x, const u16 &y) const
Definition xymap.cpp:95
u16 height
Definition xymap.h:128
FASTLED_FORCE_INLINE T clamp(T value, T min, T max)
Definition clamp.h:10

References fl::clamp(), height, mapToIndex(), width, x, and y.

+ Here is the call graph for this function: