FastLED 3.9.15
Loading...
Searching...
No Matches
fl::fixed_point_base< Derived, IntBits, FracBits > Class Template Reference

Detailed Description

template<typename Derived, int IntBits, int FracBits>
class fl::fixed_point_base< Derived, IntBits, FracBits >

Definition at line 28 of file base.h.

#include <base.h>

Classes

struct  RawTag
 

Public Types

using intermediate_type = typename traits::intermediate_type
 
using poly_intermediate_type = typename traits::poly_intermediate_type
 
using raw_type = typename traits::raw_type
 
using traits = fixed_point_traits<IntBits, FracBits>
 
using unsigned_intermediate_type = typename traits::unsigned_intermediate_type
 
using unsigned_raw_type = typename traits::unsigned_raw_type
 

Public Member Functions

constexpr fixed_point_base () FL_NOEXCEPT=default
 
constexpr fixed_point_base (float f)
 
constexpr fixed_point_base (raw_type raw, RawTag)
 
constexpr FASTLED_FORCE_INLINE Derived abs () const
 
FASTLED_FORCE_INLINE Derived acos () const
 
FASTLED_FORCE_INLINE Derived asin () const
 
FASTLED_FORCE_INLINE Derived atan () const
 
constexpr FASTLED_FORCE_INLINE Derived ceil () const
 
FASTLED_FORCE_INLINE Derived cos () const
 
constexpr FASTLED_FORCE_INLINE Derived floor () const
 
constexpr FASTLED_FORCE_INLINE Derived fract () const
 
constexpr bool operator!= (Derived b) const
 
constexpr FASTLED_FORCE_INLINE Derived operator* (Derived b) const
 
constexpr FASTLED_FORCE_INLINE Derived operator* (raw_type scalar) const
 
constexpr FASTLED_FORCE_INLINE Derived operator+ (Derived b) const
 
constexpr FASTLED_FORCE_INLINE Derived operator- () const
 
constexpr FASTLED_FORCE_INLINE Derived operator- (Derived b) const
 
constexpr FASTLED_FORCE_INLINE Derived operator/ (Derived b) const
 
constexpr bool operator< (Derived b) const
 
constexpr bool operator<= (Derived b) const
 
constexpr bool operator== (Derived b) const
 
constexpr bool operator> (Derived b) const
 
constexpr bool operator>= (Derived b) const
 
constexpr FASTLED_FORCE_INLINE Derived operator>> (int shift) const
 
constexpr raw_type raw () const
 
constexpr FASTLED_FORCE_INLINE Derived rsqrt () const
 
constexpr FASTLED_FORCE_INLINE int sign () const
 
FASTLED_FORCE_INLINE Derived sin () const
 
constexpr FASTLED_FORCE_INLINE Derived sqrt () const
 
constexpr float to_float () const
 
constexpr raw_type to_int () const
 

Static Public Member Functions

static constexpr FASTLED_FORCE_INLINE Derived abs (Derived x)
 
static FASTLED_FORCE_INLINE Derived acos (Derived x)
 
static FASTLED_FORCE_INLINE Derived asin (Derived x)
 
static FASTLED_FORCE_INLINE Derived atan (Derived x)
 
static FASTLED_FORCE_INLINE Derived atan2 (Derived y, Derived x)
 
static constexpr FASTLED_FORCE_INLINE Derived ceil (Derived x)
 
static constexpr FASTLED_FORCE_INLINE Derived clamp (Derived x, Derived lo, Derived hi)
 
static FASTLED_FORCE_INLINE Derived cos (Derived angle)
 
static constexpr FASTLED_FORCE_INLINE Derived floor (Derived x)
 
static constexpr FASTLED_FORCE_INLINE Derived fract (Derived x)
 
static constexpr FASTLED_FORCE_INLINE Derived from_raw (raw_type raw)
 
static constexpr FASTLED_FORCE_INLINE Derived lerp (Derived a, Derived b, Derived t)
 
static constexpr FASTLED_FORCE_INLINE Derived mod (Derived a, Derived b)
 
static FASTLED_FORCE_INLINE Derived pow (Derived base, Derived exp)
 
static constexpr FASTLED_FORCE_INLINE Derived rsqrt (Derived x)
 
static constexpr FASTLED_FORCE_INLINE int sign (Derived x)
 
static FASTLED_FORCE_INLINE Derived sin (Derived angle)
 
static FASTLED_FORCE_INLINE void sincos (Derived angle, Derived &out_sin, Derived &out_cos)
 
static FASTLED_FORCE_INLINE Derived smoothstep (Derived edge0, Derived edge1, Derived x)
 
static constexpr FASTLED_FORCE_INLINE Derived sqrt (Derived x)
 
static constexpr FASTLED_FORCE_INLINE Derived step (Derived edge, Derived x)
 

Static Public Attributes

static constexpr int FRAC_BITS = FracBits
 
static constexpr int INT_BITS = IntBits
 

Protected Attributes

raw_type mValue = 0
 

Static Private Member Functions

static constexpr int _highest_bit_step (u32 v, int r)
 
static constexpr FASTLED_FORCE_INLINE u32 angle_to_a24 (Derived angle)
 
static FASTLED_FORCE_INLINE Derived atan_unit (Derived t)
 
static FASTLED_FORCE_INLINE Derived exp2_fp (Derived x)
 
template<typename PolyType>
static FASTLED_FORCE_INLINE Derived exp2_horner (raw_type int_pow, PolyType fr_ifrac, PolyType d0, PolyType d1, PolyType d2, PolyType d3, fl::false_type)
 
template<typename PolyType>
static FASTLED_FORCE_INLINE Derived exp2_horner (raw_type int_pow, PolyType fr_ifrac, PolyType d0, PolyType d1, PolyType d2, PolyType d3, fl::true_type)
 
static constexpr FASTLED_FORCE_INLINE int highest_bit (u32 v)
 
static FASTLED_FORCE_INLINE Derived log2_fp (Derived x)
 
template<typename PolyType>
static FASTLED_FORCE_INLINE Derived log2_horner (raw_type int_part, PolyType t_ifrac, PolyType c0, PolyType c1, PolyType c2, PolyType c3, fl::false_type)
 
template<typename PolyType>
static FASTLED_FORCE_INLINE Derived log2_horner (raw_type int_part, PolyType t_ifrac, PolyType c0, PolyType c1, PolyType c2, PolyType c3, fl::true_type)
 
static constexpr FASTLED_FORCE_INLINE Derived sqrt_impl (Derived x, fl::false_type)
 
static constexpr FASTLED_FORCE_INLINE Derived sqrt_impl (Derived x, fl::true_type)
 

Static Private Attributes

static constexpr i32 RAD_TO_24 = 2670177
 

Friends

constexpr Derived operator* (raw_type scalar, Derived fp)
 

The documentation for this class was generated from the following file: