34 template <
typename IntT, detail::enable_if_
integer_t<IntT> = 0>
39 template <
typename OtherFP>
40 constexpr u8x24(
const OtherFP& other,
113 return from_raw(a.mValue % b.mValue);
130 return a.mValue < b.mValue ? a : b;
134 return a.mValue > b.mValue ? a : b;
138 return a + (b - a) *
t;
142 return x < lo ? lo : (
x > hi ? hi :
x);
150 constexpr u8x24 zero(0.0f);
151 constexpr u8x24 one(1.0f);
152 constexpr u8x24 two(2.0f);
153 constexpr u8x24 three(3.0f);
154 u8x24 t =
clamp((
x - edge0) / (edge1 - edge0), zero, one);
155 return t *
t * (three - two *
t);
170 if (base.mValue == 0)
return u8x24();
171 constexpr u8x24 one(1.0f);
172 if (
exp.mValue == 0)
return one;
173 if (base == one)
return one;
176 constexpr u32 kOneRaw =
static_cast<u32
>(
SCALE);
177 if (base.mValue >= (kOneRaw - 2u) && base.mValue <= kOneRaw) {
196 : (v & 0x00000002u) ? r + 1
205 if (msb < 0)
return u8x24();
216 constexpr int IFRAC = 24;
217 constexpr u64 c0 = 24189248ULL;
218 constexpr i64 c1 = -11728384LL;
219 constexpr i64 c2 = 6098176LL;
220 constexpr i64 c3 = -1788416LL;
225 acc = c2 + ((acc * t24) >> IFRAC);
226 acc = c1 + ((acc * t24) >> IFRAC);
227 acc =
static_cast<i64>(c0) + ((acc * t24) >> IFRAC);
228 i64 frac_part = (acc * t24) >> IFRAC;
244 u32 int_pow =
static_cast<u32
>(
SCALE) << n;
247 constexpr int IFRAC = 24;
248 constexpr u64 d0 = 11629376ULL;
249 constexpr u64 d1 = 4038400ULL;
250 constexpr u64 d2 = 895232ULL;
251 constexpr u64 d3 = 214016ULL;
256 acc = d2 + ((acc * fr24) >> IFRAC);
257 acc = d1 + ((acc * fr24) >> IFRAC);
258 acc = d0 + ((acc * fr24) >> IFRAC);
259 constexpr u64 one24 = 1ULL << IFRAC;
260 u64 frac_pow24 = one24 + ((acc * fr24) >> IFRAC);
constexpr bool operator<(u8x24 b) const FL_NOEXCEPT
constexpr bool operator==(u8x24 b) const FL_NOEXCEPT
constexpr bool operator!=(u8x24 b) const FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 from_raw(u32 raw) FL_NOEXCEPT
constexpr u8x24(const OtherFP &other, typename fl::enable_if<(OtherFP::INT_BITS<=INT_BITS) &&(OtherFP::FRAC_BITS<=FRAC_BITS) &&(OtherFP::INT_BITS !=INT_BITS||OtherFP::FRAC_BITS !=FRAC_BITS), int >::type=0) FL_NOEXCEPT
constexpr FASTLED_FORCE_INLINE u8x24 operator+(u8x24 b) const FL_NOEXCEPT
static constexpr int _highest_bit_step(u32 v, int r) FL_NOEXCEPT
constexpr FASTLED_FORCE_INLINE u8x24 operator/(u8x24 b) const FL_NOEXCEPT
static constexpr int FRAC_BITS
constexpr u32 to_int() const FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 step(u8x24 edge, u8x24 x) FL_NOEXCEPT
constexpr FASTLED_FORCE_INLINE u8x24 operator<<(int shift) const FL_NOEXCEPT
constexpr float to_float() const FL_NOEXCEPT
static constexpr int INT_BITS
constexpr FASTLED_FORCE_INLINE u8x24 operator*(u8x24 b) const FL_NOEXCEPT
constexpr u8x24() FL_NOEXCEPT=default
constexpr u8x24(u32 raw, RawTag) FL_NOEXCEPT
static FASTLED_FORCE_INLINE u8x24 exp2_fp(u8x24 x) FL_NOEXCEPT
static FASTLED_FORCE_INLINE u8x24 smoothstep(u8x24 edge0, u8x24 edge1, u8x24 x) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 fract(u8x24 x) FL_NOEXCEPT
constexpr FASTLED_FORCE_INLINE u8x24 operator*(u32 scalar) const FL_NOEXCEPT
static FASTLED_FORCE_INLINE u8x24 pow(u8x24 base, u8x24 exp) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 lerp(u8x24 a, u8x24 b, u8x24 t) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 sqrt(u8x24 x) FL_NOEXCEPT
constexpr FASTLED_FORCE_INLINE u8x24 operator>>(int shift) const FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 ceil(u8x24 x) FL_NOEXCEPT
constexpr u8x24(IntT n) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 mod(u8x24 a, u8x24 b) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 min(u8x24 a, u8x24 b) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 rsqrt(u8x24 x) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE int highest_bit(u32 v) FL_NOEXCEPT
static FASTLED_FORCE_INLINE u8x24 log2_fp(u8x24 x) FL_NOEXCEPT
static constexpr i32 SCALE
friend constexpr u8x24 operator*(u32 scalar, u8x24 fp) FL_NOEXCEPT
constexpr bool operator<=(u8x24 b) const FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 max(u8x24 a, u8x24 b) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 clamp(u8x24 x, u8x24 lo, u8x24 hi) FL_NOEXCEPT
constexpr bool operator>(u8x24 b) const FL_NOEXCEPT
constexpr FASTLED_FORCE_INLINE u8x24 operator-(u8x24 b) const FL_NOEXCEPT
constexpr bool operator>=(u8x24 b) const FL_NOEXCEPT
constexpr u32 raw() const FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE u8x24 floor(u8x24 x) FL_NOEXCEPT
#define constexpr
Declares that it is possible to evaluate a value at compile time, introduced in C++11.
expected< T, E > result
Alias for expected (Rust-style naming)
enable_if< is_fixed_point< T >::value, T >::type exp(T x) FL_NOEXCEPT
FL_OPTIMIZE_FUNCTION constexpr u32 isqrt64(u64 x) FL_NOEXCEPT
Base definition for an LED controller.
#define FL_OPTIMIZATION_LEVEL_O3_BEGIN
#define FASTLED_FORCE_INLINE
#define FL_OPTIMIZATION_LEVEL_O3_END