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 96 of file xymap.h.

96 {
97 x = fl::clamp<int>(x, 0, width - 1);
98 y = fl::clamp<int>(y, 0, height - 1);
99 return mapToIndex((u16)x, (u16)y);
100 }
u16 mapToIndex(const u16 &x, const u16 &y) const FL_NOEXCEPT
u16 width
Definition xymap.h:128
u16 height
Definition xymap.h:129
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NOEXCEPT

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

+ Here is the call graph for this function: