FastLED 3.10.8
Loading...
Searching...
No Matches

◆ FL_DISABLE_WARNING() [2/3]

FL_DISABLE_WARNING_PUSH fl::FL_DISABLE_WARNING ( float- equal)

Definition at line 143 of file math.h.

150 {
151
152// Primary template for map_range_math
153template <typename T, typename U> struct map_range_math {
154 static U map(T value, T in_min, T in_max, U out_min, U out_max) FL_NO_EXCEPT {
155 if (in_min == in_max)
156 return out_min;
157 return out_min +
158 (value - in_min) * (out_max - out_min) / (in_max - in_min);
159 }
160};
161
162// Specialization for u8 -> u8
163template <> struct map_range_math<u8, u8> {
164 static u8 map(u8 value, u8 in_min, u8 in_max,
165 u8 out_min, u8 out_max) FL_NO_EXCEPT;
166};
167
168// Specialization for u16 -> u16
169template <> struct map_range_math<u16, u16> {
170 static u16 map(u16 value, u16 in_min, u16 in_max,
171 u16 out_min, u16 out_max) FL_NO_EXCEPT;
172};
173
174// Equality comparison helpers
175template <typename T> bool equals(T a, T b) FL_NO_EXCEPT { return a == b; }
176inline bool equals(float a, float b) FL_NO_EXCEPT { return fl::almost_equal(a, b); }
177inline bool equals(double d, double d2) FL_NO_EXCEPT { return fl::almost_equal(d, d2); }
178
179} // namespace map_range_detail
unsigned char u8
Definition stdint.h:131
unsigned char u8
Definition stdint.h:131
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
constexpr int type_rank< T >::value
constexpr bool almost_equal(T a, T b, U tolerance) FL_NO_EXCEPT
Definition math.h:98
MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > > map
Definition map.h:283
#define FL_NO_EXCEPT

References almost_equal(), fl::adl_barrier::equal(), FL_DISABLE_WARNING_FLOAT_CONVERSION, FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION, FL_DISABLE_WARNING_SIGN_CONVERSION, FL_NO_EXCEPT, and type_rank< T >::value.

+ Here is the call graph for this function: