FastLED 3.10.8
Loading...
Searching...
No Matches
fl::detail Namespace Reference

Detailed Description

Compile-time linker keep-alive hook for a single fl::Bus.

SFINAE helpers for detecting a static ENCODER member on timing structs.

Used by the legacy FastLED.addLeds<..., fl::Bus B>(...) template path (see #2460). When B != Bus::AUTO, naming BusTraits<B>::instance here is what makes --gc-sections retain the named driver's translation unit even though the legacy controller body never invokes the singleton directly. The Bus::AUTO specialization is a no-op so calls without an explicit Bus param remain byte-for-byte identical to pre-#2460 code.

Namespaces

namespace  anonymous_namespace{allocator.cpp.hpp}
 
namespace  anonymous_namespace{five_bit_semantics.cpp.hpp}
 
namespace  anonymous_namespace{rgbw.cpp.hpp}
 
namespace  anonymous_namespace{rgbww.cpp.hpp}
 
namespace  anonymous_namespace{runtime_rpc_binding.cpp.hpp}
 
namespace  anonymous_namespace{singleton.cpp.hpp}
 
namespace  anonymous_namespace{wait_spin_budget.cpp.hpp}
 
namespace  gamma_constexpr
 
namespace  runtime_rpc
 

Classes

struct  ActiveLoggerRegistry
 Active logger registry for iteration (flush operations) Only tracks loggers that have been instantiated via template access. More...
 
class  AlphaTrimmedMeanImpl
 
struct  array_delete
 
class  AsyncLoggerServiceTask
 Auto-instantiating task for async logger servicing Registers itself with fl::task::Scheduler when first accessed Only instantiated if at least one async logger is used (linker removes if unused) More...
 
class  AttackDecayFilterImpl
 
struct  AudioLoggerInfo
 
struct  BackgroundFlushState
 
class  BilateralFilterImpl
 
class  BiquadFilterImpl
 
struct  BusKeepAliveImpl
 
struct  BusKeepAliveImpl< fl::Bus::AUTO, Which >
 
struct  CallableHolderBase
 
class  CascadedEMAImpl
 
struct  control_block_alignment
 
struct  ControlBlock
 
struct  ControlBlockBase
 
class  DCBlockerImpl
 
struct  default_delete
 
struct  DeviceInfoResolver
 
struct  DeviceInfoResolver< Bus::AUTO, Which >
 
struct  DeviceInfoResolver< Bus::BIT_BANG, Which >
 
union  DoubleBits
 
struct  enable_clockless_for
 enable_clockless<Traits>() only for the clockless chipset family. More...
 
struct  enable_clockless_for< ClocklessChipset, Traits >
 
class  ErasedInvoker
 
class  ErasedSchemaGenerator
 
class  ExponentialSmootherImpl
 
struct  flat_map_ops
 
struct  FlexIOLoggerInfo
 
union  FloatBits
 
class  GaussianFilterImpl
 
struct  get_encoder
 
struct  get_encoder< CHIPSET, true >
 
class  HampelFilterImpl
 
struct  has_copy_ctor
 
struct  has_copy_ctor< T, decltype(void(T(fl::declval< const T & >())))>
 
struct  has_default_ctor
 
struct  has_default_ctor< T, decltype(void(T()))>
 
struct  has_move_ctor
 
struct  has_move_ctor< T, decltype(void(T(fl::declval< T && >())))>
 
struct  int_to_fixed
 
struct  int_to_fixed< IntBits, FracBits, false >
 
struct  int_to_fixed< IntBits, FracBits, true >
 
struct  integer_digits10_helper
 
struct  integer_digits_helper
 
struct  integer_max_helper
 
struct  integer_max_helper< T, false >
 
struct  integer_max_helper< T, true >
 
struct  integer_min_helper
 
struct  integer_min_helper< T, false >
 
struct  integer_min_helper< T, true >
 
struct  InterruptLoggerInfo
 
struct  is_comparable_to_nullptr
 
struct  is_dereferenceable
 
struct  is_fl_fixed_point
 
struct  is_fl_fixed_point< T, decltype(static_cast< void >(T::INT_BITS), static_cast< void >(T::FRAC_BITS), static_cast< void >(fl::declval< const T & >().raw()), static_cast< void >(T::from_raw(fl::declval< const T & >().raw())), void())>
 
struct  is_member_data_pointer
 
struct  is_member_data_pointer< T C::* >
 
struct  is_non_bool_integer
 
struct  is_pointer_like
 
struct  is_pointer_like< fl::unique_ptr< T, Deleter > >
 
struct  is_pointer_like< T * >
 
struct  is_reference
 
struct  is_reference< T & >
 
struct  is_reference< T && >
 
struct  is_swappable
 
struct  is_swappable< T, decltype(void(fl::declval< T & >()=fl::declval< T && >()))>
 
struct  JsonToType
 
struct  JsonToType< bool, void >
 
struct  JsonToType< fl::ConstCharPtrWrapper, void >
 
struct  JsonToType< fl::ConstSpanWrapper< T >, void >
 
struct  JsonToType< fl::json, void >
 
struct  JsonToType< fl::string, void >
 
struct  JsonToType< fl::vector< fl::u8 >, void >
 
struct  JsonToType< fl::vector< T >, void >
 
struct  JsonToType< T, typename fl::enable_if< fl::is_floating_point< T >::value >::type >
 
struct  JsonToType< T, typename fl::enable_if< fl::is_integral< T >::value &&!fl::is_same< T, bool >::value >::type >
 
class  KalmanFilterImpl
 
class  LeakyIntegratorImpl
 
class  log_literal
 
class  log_seed
 
struct  LutArray
 
struct  make_shared_tag
 
union  max_align_with_ld
 
union  max_align_without_ld
 
class  MedianFilterImpl
 
class  memorybuf
 
class  MethodBuilder
 
struct  MethodSchema
 
struct  MethodSchema< R(Args...)>
 
struct  MethodSchema< void(Args...)>
 
class  MovingAverageImpl
 
struct  no_op_deleter
 
struct  no_tracking_tag
 
struct  ObjectFLEDLoggerInfo
 
class  OneEuroFilterImpl
 
struct  OnlyIf
 type exists only when B is true: a self-contained enable_if so the binder below can key on a constant that only PixelController declares. More...
 
struct  OnlyIf< true >
 
struct  ParlioLoggerInfo
 Info providers for each logger category Used to supply category name, define name, and enabled status. More...
 
class  posix_filebuf
 
struct  resolve_bus
 Resolve a possibly-Bus::AUTO template argument to the concrete platform default for the given Chipset family. More...
 
struct  resolve_bus< Bus::AUTO, Chipset >
 
class  ResponseAwareInvoker
 Invoker for response-aware RPC methods. More...
 
class  ResponseAwareInvoker< R(Args...)>
 
class  ResponseAwareInvoker< void(Args...)>
 
struct  RgbwNoEncoder
 Tag for constructing an inactive Rgbw without linking the RGBW encoder. More...
 
struct  RgbwwNoEncoder
 Tag for constructing an inactive Rgbww without linking the RGBWW encoder. More...
 
struct  RmtLoggerInfo
 
struct  RpcEntry
 
struct  RpcTypeOps
 
struct  RpcTypeOpsFor
 
struct  RpcTypeOpsFor< void >
 
class  RuntimeRpcBinding
 
class  SavitzkyGolayFilterImpl
 
class  ScaledPixelIteratorRGB
 Input iterator adapter for PixelIterator yielding 3-byte pixel data. More...
 
class  ScaledPixelIteratorRGB16
 Input iterator adapter for PixelIterator yielding 16-bit RGB pixel data. More...
 
class  ScaledPixelIteratorRGBW
 Input iterator adapter for PixelIterator yielding 4-byte pixel data. More...
 
class  ScaledPixelIteratorRGBWW
 Input iterator adapter yielding 5-byte RGBWW pixels (issue #2558). More...
 
class  slab_lock_guard
 RAII guard for slab_mutex. More...
 
class  slab_mutex
 Single-threaded MCUs: no-op. More...
 
class  SpectralVarianceImpl
 Multi-channel EMA with per-bin relative deviation measurement. More...
 
struct  SpiLoggerInfo
 
class  TriangularFilterImpl
 
struct  TypedCallableHolder
 
class  TypedInvoker
 
class  TypedInvoker< R(Args...)>
 
class  TypedInvoker< void(Args...)>
 
class  TypedSchemaGenerator
 
struct  TypeSchema
 
struct  TypeSchema< bool, void >
 
struct  TypeSchema< fl::string, void >
 
struct  TypeSchema< T, typename fl::enable_if< fl::is_floating_point< T >::value >::type >
 
struct  TypeSchema< T, typename fl::enable_if< fl::is_integral< T >::value &&!fl::is_same< T, bool >::value >::type >
 
struct  TypeSchema< void, void >
 
struct  TypeTag
 
struct  TypeToJson
 
struct  TypeToJson< fl::json >
 
struct  TypeToJson< fl::string >
 
struct  TypeToJson< fl::u16 >
 
struct  TypeToJson< fl::u32 >
 
struct  TypeToJson< fl::vector< fl::u8 > >
 
struct  TypeToJson< fl::vector< T > >
 
struct  TypeToJson< void >
 
struct  use_pointer_syntax
 
class  WeightedMovingAverageImpl
 

Typedefs

template<typename T>
using enable_if_integer_t
 
using flat_map_less_thunk_t
 
typedef const void * pgm_p
 
using RgbwConvertFn
 Per-pixel RGBW conversion: raw source-order RGB + premixed scale -> 4 wire bytes.
 
using RgbwwConvertFn
 
using RpcDestroyFn = void (*)(void* user_fn)
 
using RpcTrampolineFn
 
using variant_copy_fn = void (*)(void* , const void* )
 
using variant_destroy_fn = void (*)(void* )
 
using variant_move_fn = void (*)(void* , void* )
 

Enumerations

enum  { kDequeInitialMapCapacity = 4 }
 
enum  { kUnorderedMapLinearProbeOnlyThreshold = 8 , kUnorderedMapQuadraticProbingTries = 8 }
 
enum class  HexIntWidth : u8 { Width8 = 8 , Width16 = 16 , Width32 = 32 , Width64 = 64 }
 Integer width classification for hex conversion. More...
 
enum class  log_kind : fl::u8 { WARN = 0 , ERROR = 1 , INFO = 2 }
 

Functions

FL_ALWAYS_INLINE void advanceDitherFrame () FL_NO_EXCEPT
 Advance temporal dithering once per logical frame, not once per controller.
 
void * aligned_alloc_via_malloc (fl::size_t alignment, fl::size_t size) FL_NO_EXCEPT
 Portable over-allocate-and-align used by aligned_alloc on bare-metal targets; free only with aligned_free_via_malloc (#4817).
 
void aligned_free_via_malloc (void *ptr) FL_NO_EXCEPT
 
template<typename Logger, fl::size N>
void async_log_emit_auto (Logger &logger, const log_literal< N > &body) FL_NO_EXCEPT
 
template<typename Logger>
void async_log_emit_auto (Logger &logger, fl::sstream &&body) FL_NO_EXCEPT
 
template<typename Logger>
void async_log_emit_auto (Logger &logger, fl::sstream &body) FL_NO_EXCEPT
 
void FL_IRAM async_log_flush_timer_isr (void *user_data) FL_NO_EXCEPT
 
template<typename F>
F atan2_full_ (F y, F x) FL_NO_EXCEPT
 
template<typename F>
F atan_full_ (F u) FL_NO_EXCEPT
 
template<typename F>
F atan_poly_unit_ (F u) FL_NO_EXCEPT
 
DeviceRuntime availableRuntime () FL_NO_EXCEPT
 
template<Bus B, fl::u8 Which = 0>
int bus_register_one () FL_NO_EXCEPT
 Helper used by enableDrivers<Bus...>() to expand the parameter pack.
 
template<typename InfoProvider>
void checkLoggerEnabled () FL_NO_EXCEPT
 Check if logger is enabled and print error once if not.
 
bool & colorProfileStrictMode () FL_NO_EXCEPT
 
template<typename F>
F cos_poly_quarterturn_ (F x) FL_NO_EXCEPT
 
template<typename F>
F cos_reduce_ (F x) FL_NO_EXCEPT
 
constexpr fl::u32 cycles_from_ns (fl::u32 ns, fl::u32 hz) FL_NO_EXCEPT
 Convert nanoseconds to CPU cycles.
 
constexpr fl::u32 cycles_from_ns_default (fl::u32 ns) FL_NO_EXCEPT
 Compute cycles using default CPU frequency (compile-time)
 
SourceProfile & defaultSourceProfile () FL_NO_EXCEPT
 
void delay_impl (u32 ms, bool run_async=true) FL_NO_EXCEPT
 Internal delay implementation used by the public fl::delay wrapper.
 
FL_NO_INLINE fl::size deque_grow_map_capacity (fl::size current_map_capacity, fl::size min_required_chunks) FL_NO_EXCEPT
 
u8 ditherFrame () FL_NO_EXCEPT
 Return the temporal-dither phase shared by all controllers in this frame.
 
template<typename T>
fl::enable_if< fl::is_floating_point< T >::value, T >::type div_by_count (T sum, fl::size count)
 
template<typename T>
fl::enable_if< fl::is_integral< T >::value, T >::type div_by_count (T sum, fl::size count)
 
template<typename T>
fl::enable_if<!fl::is_floating_point< T >::value &&!fl::is_integral< T >::value, T >::type div_by_count (T sum, fl::size count)
 
i32 dotRowQ16 (const i32(&row)[3], const i32(&v)[3]) FL_NO_EXCEPT
 One s16.16 matrix row against a vector, rounded and saturated.
 
template<typename Traits>
void enable_clockless () FL_NO_EXCEPT
 
template<typename Traits>
auto enable_clockless_impl (int) FL_NO_EXCEPT -> decltype(Traits::enableClockless(), void())
 Call Traits::enableClockless() when the bus provides one.
 
template<typename Traits>
void enable_clockless_impl (long) FL_NO_EXCEPT
 
void enable_rgbw_conversion () FL_NO_EXCEPT
 Installs the RGBW pixel conversion used by PixelIterator.
 
void enable_rgbw_power_estimate () FL_NO_EXCEPT
 Lets the power limiter charge a controller's RGBW conversion.
 
void enable_rgbww_conversion () FL_NO_EXCEPT
 Installs the RGBWW pixel conversion (see enable_rgbw_conversion, #4795).
 
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION u8 encodeUart2Bits (u8 two_bits) FL_NO_EXCEPT
 Legacy 2-bit encoding using hardcoded WS2812 LUT (backward compat)
 
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION u8 encodeUart2Bits (u8 two_bits, const Wave10Lut &lut) FL_NO_EXCEPT
 Encode 2 LED bits to 1 UART byte using a Wave10 LUT.
 
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void encodeUartByte (u8 led_byte, u8 *output) FL_NO_EXCEPT
 Legacy byte encoding using hardcoded WS2812 LUT (backward compat)
 
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void encodeUartByte (u8 led_byte, u8 *output, const Wave10Lut &lut) FL_NO_EXCEPT
 Encode 1 LED byte to 4 UART bytes using a Wave10 LUT.
 
double exp_reduced_ (double x) FL_NO_EXCEPT
 
float exp_reduced_ (float x) FL_NO_EXCEPT
 
void five_bit_hd_solve16 (fl::u16 r16, fl::u16 g16, fl::u16 b16, fl::u8 min_field, CRGB *out, fl::u8 *out_field) FL_NO_EXCEPT
 
void five_bit_hd_solve16 (u16 r16, u16 g16, u16 b16, u8 min_field, CRGB *out, u8 *out_field) FL_NO_EXCEPT
 
template<typename FP>
float fixed_point_to_float (FP value) FL_NO_EXCEPT
 
bool fixed_raw_from_ieee754_bits (u32 bits, int frac_bits, i64 *out) FL_NO_EXCEPT
 
FL_FIXED_POINT_DIVIDE_INLINE int fixedPointLeadingZeros (u32 value) FL_NO_EXCEPT
 Leading zeros of a non-zero 32-bit value; 32 for zero.
 
FL_NO_INLINE fl::size flat_map_lower_bound_idx (const void *data, fl::size n, const void *key, const flat_map_ops &ops) FL_NO_EXCEPT
 
FL_NO_INLINE fl::size flat_map_upper_bound_idx (const void *data, fl::size n, const void *key, const flat_map_ops &ops) FL_NO_EXCEPT
 
template<typename T>
fl::enable_if< has_copy_ctor< T >::value, void(*)(void *, constvoid *)>::type get_copy_construct_fn () FL_NO_EXCEPT
 
template<typename T>
fl::enable_if<!has_copy_ctor< T >::value, void(*)(void *, constvoid *)>::type get_copy_construct_fn () FL_NO_EXCEPT
 
template<typename T>
fl::enable_if< has_default_ctor< T >::value, void(*)(void *)>::type get_default_construct_fn () FL_NO_EXCEPT
 
template<typename T>
fl::enable_if<!has_default_ctor< T >::value, void(*)(void *)>::type get_default_construct_fn () FL_NO_EXCEPT
 
template<size_t Size>
constexpr HexIntWidth get_hex_int_width () FL_NO_EXCEPT
 Compile-time integer width determination (default - triggers error)
 
template<>
constexpr HexIntWidth get_hex_int_width< 1 > () FL_NO_EXCEPT
 Specialization for 1-byte types (int8_t, uint8_t, char, etc.)
 
template<>
constexpr HexIntWidth get_hex_int_width< 2 > () FL_NO_EXCEPT
 Specialization for 2-byte types (int16_t, uint16_t, short, etc.)
 
template<>
constexpr HexIntWidth get_hex_int_width< 4 > () FL_NO_EXCEPT
 Specialization for 4-byte types (int32_t, uint32_t, int, etc.)
 
template<>
constexpr HexIntWidth get_hex_int_width< 8 > () FL_NO_EXCEPT
 Specialization for 8-byte types (i64, u64, long long, etc.)
 
template<typename T>
fl::enable_if< has_move_ctor< T >::value, void(*)(void *, void *)>::type get_move_construct_fn () FL_NO_EXCEPT
 
template<typename T>
fl::enable_if<!has_move_ctor< T >::value, void(*)(void *, void *)>::type get_move_construct_fn () FL_NO_EXCEPT
 
template<typename T>
fl::enable_if< is_swappable< T >::value, void(*)(void *, void *)>::type get_swap_fn () FL_NO_EXCEPT
 
template<typename T>
fl::enable_if<!is_swappable< T >::value, void(*)(void *, void *)>::type get_swap_fn () FL_NO_EXCEPT
 
fl::u32 getWaitSpinBudgetUs () FL_NO_EXCEPT
 Get the current tiered-wait spin budget (microseconds).
 
u8 & hdFieldFloor () FL_NO_EXCEPT
 Backing store for CFastLED::setHdFieldFloor().
 
template<typename Iterator, typename Compare>
void heap_sort (Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
 
template<typename Iterator, typename Compare>
void heapify (Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
 
fl::string hex (u64 value, HexIntWidth width, bool is_negative, bool uppercase, bool pad_to_width) FL_NO_EXCEPT
 Internal hex conversion function (implementation in charconv.cpp)
 
u32 ieee754_bits_from_fixed_raw (i64 raw, int frac_bits) FL_NO_EXCEPT
 
u32 ieee754_bits_from_scaled_u64 (u32 sign, u64 magnitude, int binary_exp) FL_NO_EXCEPT
 
template<typename IntT>
constexpr bool in_unsigned_range (IntT n, u32 max_u) FL_NO_EXCEPT
 
template<typename Iterator, typename Compare>
void insertion_sort (Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
 
template<typename T>
constexpr int integer_digits10_func () FL_NO_EXCEPT
 
template<typename T>
constexpr int integer_digits_func () FL_NO_EXCEPT
 
void integer_out_of_range_for_fixed_point_type () FL_NO_EXCEPT
 
template<typename To, typename From>
To json_bit_copy (const From &value) FL_NO_EXCEPT
 
FL_NO_INLINE TypeConversionResult json_convert_to_bool_core (const json_value &val, bool *out_value) FL_NO_EXCEPT
 
FL_NO_INLINE TypeConversionResult json_convert_to_float_core (const json_value &val, float *out_value) FL_NO_EXCEPT
 
FL_NO_INLINE TypeConversionResult json_convert_to_i64_core (const json_value &val, fl::i64 *out_value) FL_NO_EXCEPT
 
FL_NO_INLINE TypeConversionResult json_convert_to_string_core (const json_value &val, fl::string *out_value) FL_NO_EXCEPT
 
float json_double_to_float (double value) FL_NO_EXCEPT
 
double json_float_to_double (float value) FL_NO_EXCEPT
 
int json_floor_log2_u64 (u64 value) FL_NO_EXCEPT
 
u64 json_ieee754_double_bits_from_float_bits (u32 bits) FL_NO_EXCEPT
 
u32 json_ieee754_float_bits_from_double_bits (u64 bits) FL_NO_EXCEPT
 
u32 json_ieee754_float_bits_from_scaled_u64 (u32 sign, u64 magnitude, int binary_exp) FL_NO_EXCEPT
 
u32 json_round_shift_right_u64 (u64 value, int shift) FL_NO_EXCEPT
 
template<typename F>
F ldexp_loop_ (F value, int exp) FL_NO_EXCEPT
 
FL_NO_INLINE void log_emit (log_kind kind, const char *file, int line, fl::sstream &body) FL_NO_EXCEPT
 
template<fl::size N>
void log_emit_auto (log_kind kind, const char *file, int line, const log_literal< N > &body) FL_NO_EXCEPT
 
void log_emit_auto (log_kind kind, const char *file, int line, fl::sstream &&body) FL_NO_EXCEPT
 
void log_emit_auto (log_kind kind, const char *file, int line, fl::sstream &body) FL_NO_EXCEPT
 
FL_NO_INLINE void log_emit_literal (log_kind kind, const char *file, int line, const char *body) FL_NO_EXCEPT
 
FL_NO_INLINE void log_emit_newline () FL_NO_EXCEPT
 
FL_NO_INLINE void log_emit_prefix (log_kind kind, const char *file, int line) FL_NO_EXCEPT
 
FL_NO_INLINE const char * log_kind_name (log_kind kind) FL_NO_EXCEPT
 
template<typename F>
F log_natural_ (F value) FL_NO_EXCEPT
 
template<typename Iterator, typename T, typename Compare>
Iterator lower_bound_impl (Iterator first, Iterator last, const T &value, Compare comp) FL_NO_EXCEPT
 
template<typename Fn, fl::size... Is>
constexpr LutArray< u16, sizeof...(Is)> make_lut_u16 (fl::index_sequence< Is... >) FL_NO_EXCEPT
 
template<typename Fn, fl::size... Is>
constexpr LutArray< u8, sizeof...(Is)> make_lut_u8 (fl::index_sequence< Is... >) FL_NO_EXCEPT
 
DeviceInfo makeInfo (Bus bus, fl::u8 which, const char *vendor, const char *device, const char *notes="") FL_NO_EXCEPT
 
json makeJsonRpcError (int code, const fl::string &message, const json &id) FL_NO_EXCEPT
 
DeviceInfo makeNoop (Bus bus, fl::u8 which, const char *notes="") FL_NO_EXCEPT
 
template<typename R, typename... Args>
fl::shared_ptr< RuntimeRpcBinding > makeRuntimeRpcBinding (fl::function< R(Args...)> fn) FL_NO_EXCEPT
 
template<typename Iterator, typename Compare>
Iterator median_of_three (Iterator first, Iterator middle, Iterator last, Compare comp) FL_NO_EXCEPT
 
template<typename Iterator, typename Compare>
void merge_inplace (Iterator first, Iterator middle, Iterator last, Compare comp) FL_NO_EXCEPT
 
template<typename Iterator, typename Compare>
void mergesort_impl (Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
 
void not_null_assert_failed (const char *message) FL_NO_EXCEPT
 
template<typename Iterator, typename Compare>
Iterator partition (Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
 
template<typename T>
constexpr variant_copy_fn pick_variant_copy_fn () FL_NO_EXCEPT
 
template<typename T>
constexpr variant_destroy_fn pick_variant_destroy_fn () FL_NO_EXCEPT
 
template<typename T>
constexpr variant_move_fn pick_variant_move_fn () FL_NO_EXCEPT
 
template<fl::size N>
void print_emit_auto (const log_literal< N > &body) FL_NO_EXCEPT
 
void print_emit_auto (fl::sstream &&body) FL_NO_EXCEPT
 
void print_emit_auto (fl::sstream &body) FL_NO_EXCEPT
 
void printLoggerDisabledError (const char *category_name, const char *define_name) FL_NO_EXCEPT
 Print error message for disabled logger (non-template helper) Called from checkLoggerEnabled template function IMPORTANT: This must NOT be inline - needs external linkage for cross-TU calls.
 
void qsort_impl (char *base, size_t nmemb, size_t size, qsort_compare_fn compar) FL_NO_EXCEPT
 
void qsort_swap (char *a, char *b, size_t size) FL_NO_EXCEPT
 
template<typename Iterator, typename Compare>
void quicksort_impl (Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
 
RgbwConvertFn rgbw_conversion () FL_NO_EXCEPT
 Null until enable_rgbw_conversion() has run.
 
RgbwwConvertFn rgbww_conversion () FL_NO_EXCEPT
 
template<typename Iterator>
void rotate_impl (Iterator first, Iterator middle, Iterator last) FL_NO_EXCEPT
 
u32 round_shift_right_u64 (u64 value, int shift) FL_NO_EXCEPT
 
i64 roundedDivideQ16 (i64 numerator, i64 denominator) FL_NO_EXCEPT
 The s16.16 building blocks the bind-time builders share.
 
double scale_pow2_ (double p, int k) FL_NO_EXCEPT
 
float scale_pow2_ (float p, int k) FL_NO_EXCEPT
 
void setWaitSpinBudgetUs (fl::u32 budget_us) FL_NO_EXCEPT
 Set the tiered-wait spin budget (microseconds).
 
template<typename Iterator, typename Compare>
void sift_down (Iterator first, Iterator start, Iterator end, Compare comp) FL_NO_EXCEPT
 
template<typename F>
F sin_poly_quarterturn_ (F x) FL_NO_EXCEPT
 
template<typename F>
F sin_reduce_ (F x) FL_NO_EXCEPT
 
void * singleton_registry_get (const char *key) FL_NO_EXCEPT
 
void singleton_registry_set (const char *key, void *value) FL_NO_EXCEPT
 
void * slab_allocator_registry_get (fl::size block_size, fl::size slab_size) FL_NO_EXCEPT
 
void slab_allocator_registry_set (fl::size block_size, fl::size slab_size, void *allocator) FL_NO_EXCEPT
 
template<typename To, typename From>
To soft_bit_copy (const From &value) FL_NO_EXCEPT
 
u32 soft_float_bits_from_scaled_u64 (u32 sign, u64 magnitude, int binary_exp) FL_NO_EXCEPT
 
int soft_floor_log2_u64 (u64 value) FL_NO_EXCEPT
 
u32 soft_round_shift_right_u64 (u64 value, int shift) FL_NO_EXCEPT
 
void span_invalid_pointer_range () FL_NO_EXCEPT
 
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void spread_transpose16_symbol (const u8 l[16], u8 out[16]) FL_NO_EXCEPT
 Transpose one symbol of 16 lanes (16 input bytes) into 16 output bytes: 8 pulses × 2 bytes, low byte = lanes 0-7, high byte = lanes 8-15, pulse order 7..0 (out[0] = pulse 7 low).
 
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void spread_transpose8_symbol (const u8 l[8], u8 out[8]) FL_NO_EXCEPT
 Transpose one symbol of 8 lanes (8 input bytes) into 8 output bytes: 8 pulses × 1 byte (bit L = lane L), pulse order 7..0 (out[0] = pulse 7).
 
FASTLED_FORCE_INLINE u32 spreadA (u8 v) FL_NO_EXCEPT
 Pulses 7,6,5,4 of v (byte j = bit (7-j)). Depends only on the high nibble.
 
FASTLED_FORCE_INLINE u32 spreadB (u8 v) FL_NO_EXCEPT
 Pulses 3,2,1,0 of v (byte j = bit (3-j)). Depends only on the low nibble.
 
template<typename F>
F sqrt_newton_ (F value) FL_NO_EXCEPT
 
template<typename T>
constexpr bool test_encoder (...) FL_NO_EXCEPT
 
template<typename T>
constexpr auto test_encoder (int) FL_NO_EXCEPT -> decltype(T::ENCODER, true)
 
void to_string (const fl::u16 *bit_data, fl::u32 bit_count, string *dst) FL_NO_EXCEPT
 
template<typename T>
void typed_copy_thunk (void *dst, const void *src) FL_NO_EXCEPT
 
template<typename T>
void typed_destroy_thunk (void *storage) FL_NO_EXCEPT
 
template<typename T>
void typed_move_thunk (void *dst, void *src) FL_NO_EXCEPT
 
DeviceRuntime unavailableRuntime () FL_NO_EXCEPT
 
FL_NO_INLINE fl::size unordered_map_probe_idx (fl::size h, fl::size i, fl::size mask, fl::size cap) FL_NO_EXCEPT
 
template<typename TSrcPalette, typename TDestPalette>
void UpscalePaletteInterpolated (const TSrcPalette &srcpal, TDestPalette &destpal) FL_NO_EXCEPT
 
template<typename TSrcPalette, typename TDestPalette>
void UpscalePaletteRepeat (const TSrcPalette &srcpal, TDestPalette &destpal) FL_NO_EXCEPT
 
void variant_noop_destroy (void *) FL_NO_EXCEPT
 
template<fl::size N>
void variant_trivial_copy_n (void *dst, const void *src) FL_NO_EXCEPT
 
template<fl::size N>
void variant_trivial_move_n (void *dst, void *src) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave3_convert_byte_to_wave3byte (u8 byte_value, const Wave3BitExpansionLut &lut, Wave3Byte *output) FL_NO_EXCEPT
 Convert one byte to a Wave3Byte using the nibble LUT.
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave3_transpose_16 (const Wave3Byte lane_waves[16], u8 output[16 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
 Transpose 16 lanes of Wave3Byte data via the spread-LUT path (#2533).
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave3_transpose_2 (const Wave3Byte lane_waves[2], u8 output[2 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
 Transpose 2 lanes of Wave3Byte data into interleaved format.
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave3_transpose_4 (const Wave3Byte lane_waves[4], u8 output[4 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
 Transpose 4 lanes of Wave3Byte data.
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave3_transpose_8 (const Wave3Byte lane_waves[8], u8 output[8 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
 Transpose 8 lanes of Wave3Byte data via the spread-LUT path (#2533).
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_convert_byte_to_wave8byte (u8 byte_value, const Wave8BitExpansionLut &lut, Wave8Byte *output) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_expand_byte (u8 byte_value, const Wave8ByteExpansionLut &lut, Wave8Byte *output) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_16 (const Wave8Byte lane_waves[16], u8 output[16 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_16_bf1 (const u8 lanes[16], u8 W0, u8 W1, u8 output[16 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_16x2_pipe2 (const Wave8Byte lane_waves_a[16], const Wave8Byte lane_waves_b[16], u8 output_a[16 *sizeof(Wave8Byte)], u8 output_b[16 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_16x4_bf1_pipe4 (const u8 lanes_a[16], const u8 lanes_b[16], const u8 lanes_c[16], const u8 lanes_d[16], u8 W0, u8 W1, u8 output_a[16 *sizeof(Wave8Byte)], u8 output_b[16 *sizeof(Wave8Byte)], u8 output_c[16 *sizeof(Wave8Byte)], u8 output_d[16 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_16x4_pipe4 (const Wave8Byte lane_waves_a[16], const Wave8Byte lane_waves_b[16], const Wave8Byte lane_waves_c[16], const Wave8Byte lane_waves_d[16], u8 output_a[16 *sizeof(Wave8Byte)], u8 output_b[16 *sizeof(Wave8Byte)], u8 output_c[16 *sizeof(Wave8Byte)], u8 output_d[16 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_2 (const Wave8Byte lane_waves[2], u8 output[2 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_2_bf1 (const u8 lanes[2], u8 W0, u8 W1, u8 output[2 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_4 (const Wave8Byte lane_waves[4], u8 output[4 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_4_bf1 (const u8 lanes[4], u8 W0, u8 W1, u8 output[4 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_8 (const Wave8Byte lane_waves[8], u8 output[8 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
FL_IRAM FL_OPTIMIZE_FUNCTION void wave8_transpose_8_bf1 (const u8 lanes[8], u8 W0, u8 W1, u8 output[8 *sizeof(Wave8Byte)]) FL_NO_EXCEPT
 
bool xyzColumnQ16 (const i32(&xy)[2], i32 luminance, i64(&column)[3]) FL_NO_EXCEPT
 XYZ of chromaticity xy at luminance luminance, all s16.16; false for a non-positive or out-of-simplex chromaticity or a non-positive luminance.
 

Variables

u8 gDitherFrame
 
const float kBradford [3][3]
 ICC linear Bradford cone-response matrix.
 
const float kBradfordInverse [3][3]
 Its inverse, precomputed.
 
const i32 kBradfordInverseQ16 [3][3]
 
const i32 kBradfordQ16 [3][3]
 The two matrices above in s16.16, rounded from the float32 values, so the bind-time build needs no float (FastLED#4458).
 
constexpr u32 kSpreadNibble [16]
 kSpreadNibble[n] places the 4 bits of nibble n at bit 0 of 4 separate bytes: byte0 = bit3(n), byte1 = bit2(n), byte2 = bit1(n), byte3 = bit0(n).
 
constexpr u8 kTranspose2_4_LUT [4]
 4-lane LUT: Spreads 2 bits into 4-lane interleaved positions (2-bit → byte).
 
constexpr u8 kTranspose4_16_LUT [16]
 2-lane LUT: Spreads 4 bits into 2-lane interleaved positions (nibble → byte).
 

◆ fl::detail::integer_max_helper

struct fl::detail::integer_max_helper
+ Inheritance diagram for fl::detail::integer_max_helper< T, IsSigned >:

◆ fl::detail::integer_min_helper

struct fl::detail::integer_min_helper
+ Inheritance diagram for fl::detail::integer_min_helper< T, IsSigned >:

◆ fl::detail::LutArray

struct fl::detail::LutArray
+ Inheritance diagram for fl::detail::LutArray< T, N >:
Class Members
T values[N]

◆ fl::detail::make_shared_tag

struct fl::detail::make_shared_tag

◆ fl::detail::max_align_with_ld

union fl::detail::max_align_with_ld
Class Members
long double ld
long long ll
void * p

◆ fl::detail::max_align_without_ld

union fl::detail::max_align_without_ld
Class Members
double d
long long ll
void * p

◆ fl::detail::MethodSchema

struct fl::detail::MethodSchema
+ Inheritance diagram for fl::detail::MethodSchema< Sig >:

◆ fl::detail::no_tracking_tag

struct fl::detail::no_tracking_tag

◆ fl::detail::OnlyIf

struct fl::detail::OnlyIf
+ Inheritance diagram for fl::detail::OnlyIf< B >:

◆ fl::detail::OnlyIf< true >

struct fl::detail::OnlyIf< true >
+ Inheritance diagram for fl::detail::OnlyIf< true >:
+ Collaboration diagram for fl::detail::OnlyIf< true >:
Class Members
typedef void type

◆ fl::detail::ResponseAwareInvoker

class fl::detail::ResponseAwareInvoker
+ Inheritance diagram for fl::detail::ResponseAwareInvoker< Sig >:

◆ fl::detail::RgbwNoEncoder

struct fl::detail::RgbwNoEncoder

◆ fl::detail::RgbwwNoEncoder

struct fl::detail::RgbwwNoEncoder

◆ fl::detail::RpcEntry

struct fl::detail::RpcEntry
+ Collaboration diagram for fl::detail::RpcEntry:
Class Members
string mDescription
shared_ptr< ErasedInvoker > mInvoker
bool mIsResponseAware = false
RpcMode mMode = fl::RpcMode::SYNC
function< void(ResponseSend &, const json &)> mResponseAwareFn
shared_ptr< ErasedSchemaGenerator > mSchemaGenerator
vector< string > mTags
shared_ptr< CallableHolderBase > mTypedCallable
const void * mTypeTag = nullptr

◆ fl::detail::RpcTypeOps

struct fl::detail::RpcTypeOps
+ Collaboration diagram for fl::detail::RpcTypeOps:
Class Members
TypeConversionResult(*)(const json &src, void *dst) decode
void(*)(void *p) default_construct
void(*)(void *p) destroy
json(*)(const void *src) encode
size storage_align
size storage_size

◆ fl::detail::TypedInvoker

class fl::detail::TypedInvoker
+ Inheritance diagram for fl::detail::TypedInvoker< Sig >:

Typedef Documentation

◆ enable_if_integer_t

template<typename T>
using fl::detail::enable_if_integer_t
Initial value:

Definition at line 28 of file traits.h.

◆ flat_map_less_thunk_t

using fl::detail::flat_map_less_thunk_t
Initial value:
bool (*)(const void* ctx,
const void* a, const void* b)

Definition at line 46 of file flat_map_basic.h.

◆ pgm_p

typedef const void* fl::detail::pgm_p

Definition at line 174 of file cstring.h.

◆ RgbwConvertFn

using fl::detail::RgbwConvertFn
Initial value:
void (*)(const Rgbw& rgbw, const u8 (&raw)[3],
const u8 (&premix)[3], const u8 (&order)[3],
u8* b0, u8* b1, u8* b2, u8* b3)
Rgbw rgbw
unsigned char u8
Definition stdint.h:131

Per-pixel RGBW conversion: raw source-order RGB + premixed scale -> 4 wire bytes.

order[i] is the source channel of wire RGB byte i.

Definition at line 220 of file rgbw.h.

◆ RgbwwConvertFn

using fl::detail::RgbwwConvertFn
Initial value:
void (*)(const Rgbww& rgbww, const fl::u8 (&raw)[3],
const fl::u8 (&premix)[3], const fl::u8 (&order)[3],
fl::u8* b0, fl::u8* b1, fl::u8* b2,
fl::u8* b3, fl::u8* b4)
unsigned char u8
Definition s16x16x4.h:132

Definition at line 67 of file rgbww.h.

◆ RpcDestroyFn

using fl::detail::RpcDestroyFn = void (*)(void* user_fn)

Definition at line 111 of file runtime_rpc_binding.h.

◆ RpcTrampolineFn

using fl::detail::RpcTrampolineFn
Initial value:
void (*)(void* user_fn,
void* result_slot,
void* const* arg_slots)

Definition at line 106 of file runtime_rpc_binding.h.

◆ variant_copy_fn

using fl::detail::variant_copy_fn = void (*)(void* , const void* )

Definition at line 49 of file variant.h.

◆ variant_destroy_fn

using fl::detail::variant_destroy_fn = void (*)(void* )

Definition at line 48 of file variant.h.

◆ variant_move_fn

using fl::detail::variant_move_fn = void (*)(void* , void* )

Definition at line 50 of file variant.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kDequeInitialMapCapacity 

Definition at line 28 of file deque_basic.h.

28 {
30};
@ kDequeInitialMapCapacity
Definition deque_basic.h:29

◆ anonymous enum

anonymous enum
Enumerator
kUnorderedMapLinearProbeOnlyThreshold 
kUnorderedMapQuadraticProbingTries 

Definition at line 44 of file unordered_map_basic.h.

◆ HexIntWidth

enum class fl::detail::HexIntWidth : u8
strong

Integer width classification for hex conversion.

Enumerator
Width8 
Width16 
Width32 
Width64 

Definition at line 42 of file charconv.h.

42 : u8 {
43 Width8 = 8,
44 Width16 = 16,
45 Width32 = 32,
46 Width64 = 64
47};
unsigned char u8
Definition stdint.h:131

◆ log_kind

enum class fl::detail::log_kind : fl::u8
strong
Enumerator
WARN 
ERROR 
INFO 

Definition at line 179 of file log.h.

179 : fl::u8 {
180 WARN = 0,
181 ERROR = 1,
182 INFO = 2,
183};
@ ERROR
Definition ServerReal.h:44

Function Documentation

◆ advanceDitherFrame()

FL_ALWAYS_INLINE void fl::detail::advanceDitherFrame ( )

Advance temporal dithering once per logical frame, not once per controller.

Definition at line 19 of file dither_frame.h.

19 {
21}

References advanceDitherFrame(), FL_ALWAYS_INLINE, fl::FL_NO_EXCEPT, and gDitherFrame.

Referenced by advanceDitherFrame(), and fl::EngineEvents::onBeginFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aligned_alloc_via_malloc()

void * fl::detail::aligned_alloc_via_malloc ( fl::size_t alignment,
fl::size_t size )

Portable over-allocate-and-align used by aligned_alloc on bare-metal targets; free only with aligned_free_via_malloc (#4817).

Definition at line 27 of file cstdlib.cpp.hpp.

27 {
28 if (alignment < sizeof(void *)) {
29 alignment = sizeof(void *);
30 }
31 if ((alignment & (alignment - 1)) != 0) {
32 return nullptr; // alignment must be a power of two
33 }
34 const fl::size_t overhead = alignment - 1 + sizeof(void *);
35 if (size > static_cast<fl::size_t>(-1) - overhead) {
36 return nullptr; // size + overhead would wrap
37 }
38 void *raw = ::malloc(size + overhead);
39 if (raw == nullptr) {
40 return nullptr;
41 }
42 const fl::uptr start = fl::reinterpret_cast_<fl::uptr>(raw) + sizeof(void *);
43 const fl::uptr aligned = (start + alignment - 1) & ~(fl::uptr(alignment) - 1);
44 void **slot = fl::reinterpret_cast_<void **>(aligned);
45 slot[-1] = raw;
46 return slot;
47}
FASTLED_FORCE_INLINE void * malloc(size_t size) FL_NO_EXCEPT
Definition malloc.h:21
To reinterpret_cast_(const From &from) FL_NO_EXCEPT
Definition bit_cast.h:88
fl::size size_t
Definition s16x16x4.h:223

References fl::FL_NO_EXCEPT, fl::malloc(), and fl::reinterpret_cast_().

Referenced by fl::libc_impl::aligned_alloc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aligned_free_via_malloc()

void fl::detail::aligned_free_via_malloc ( void * ptr)

Definition at line 49 of file cstdlib.cpp.hpp.

49 {
50 if (ptr != nullptr) {
51 ::free(static_cast<void **>(ptr)[-1]); // original malloc block
52 }
53}
FASTLED_FORCE_INLINE void free(void *ptr) FL_NO_EXCEPT
Definition malloc.h:23

References fl::FL_NO_EXCEPT, and fl::free().

Referenced by fl::aligned_free().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ async_log_emit_auto() [1/3]

template<typename Logger, fl::size N>
void fl::detail::async_log_emit_auto ( Logger & logger,
const log_literal< N > & body )
inline

Definition at line 277 of file log.h.

278 {
279 logger.push(body.c_str());
280}
const char * c_str() const FL_NO_EXCEPT
Definition log.h:216

References fl::FL_NO_EXCEPT.

◆ async_log_emit_auto() [2/3]

template<typename Logger>
void fl::detail::async_log_emit_auto ( Logger & logger,
fl::sstream && body )
inline

Definition at line 289 of file log.h.

290 {
291 logger.push(body.str());
292}
string str() const FL_NO_EXCEPT
Definition strstream.h:43

References fl::FL_NO_EXCEPT.

◆ async_log_emit_auto() [3/3]

template<typename Logger>
void fl::detail::async_log_emit_auto ( Logger & logger,
fl::sstream & body )
inline

Definition at line 283 of file log.h.

284 {
285 logger.push(body.str());
286}

References fl::FL_NO_EXCEPT.

◆ async_log_flush_timer_isr()

void FL_IRAM fl::detail::async_log_flush_timer_isr ( void * user_data)

Definition at line 46 of file async_logger.cpp.hpp.

46 {
47 BackgroundFlushState* state = static_cast<BackgroundFlushState*>(user_data);
48 state->mNeedsFlush = true;
49 // Debug: Toggle a counter to verify ISR is firing (visible in debugger)
50 static volatile fl::u32 isr_fire_count = 0;
51 isr_fire_count = isr_fire_count + 1;
52 }
TestState state

References FL_IRAM, fl::FL_NO_EXCEPT, and state.

Referenced by fl::AsyncLogger::enableBackgroundFlush().

+ Here is the caller graph for this function:

◆ atan2_full_()

template<typename F>
F fl::detail::atan2_full_ ( F y,
F x )
inline

Definition at line 561 of file math.cpp.hpp.

561 {
562 const F kPi = F(3.14159265358979323846);
563 const F kPiHalf = F(1.57079632679489661923);
564 // x == 0 special case: angle is ±π/2 (sign of y), or 0 when both are 0.
565 if (x == F(0)) {
566 if (y > F(0)) return kPiHalf;
567 if (y < F(0)) return -kPiHalf;
568 return F(0);
569 }
570 F a = atan_full_(y / x);
571 if (x < F(0)) {
572 a += (y >= F(0)) ? kPi : -kPi;
573 }
574 return a;
575}
F atan_full_(F u) FL_NO_EXCEPT
Definition math.cpp.hpp:549

References atan_full_(), fl::FL_NO_EXCEPT, fl::x, and fl::y.

Referenced by fl::atan2_impl_double(), and fl::atan2_impl_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ atan_full_()

template<typename F>
F fl::detail::atan_full_ ( F u)
inline

Definition at line 549 of file math.cpp.hpp.

549 {
550 const F kPiHalf = F(1.57079632679489661923);
551 // Reduce to |u| <= 1 via the reciprocal identity.
552 if (u > F(1)) {
553 return kPiHalf - atan_poly_unit_(F(1) / u);
554 } else if (u < F(-1)) {
555 return -kPiHalf - atan_poly_unit_(F(1) / u);
556 }
557 return atan_poly_unit_(u);
558}
F atan_poly_unit_(F u) FL_NO_EXCEPT
Definition math.cpp.hpp:536

References atan_poly_unit_(), and fl::FL_NO_EXCEPT.

Referenced by fl::asin_impl_double(), fl::asin_impl_float(), atan2_full_(), fl::atan_impl_double(), and fl::atan_impl_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ atan_poly_unit_()

template<typename F>
F fl::detail::atan_poly_unit_ ( F u)
inline

Definition at line 536 of file math.cpp.hpp.

536 {
537 // Polynomial approximation of atan on [-1, 1].
538 // Coefficients from Padé-style minimax fit; max abs error ~1.5e-3.
539 const F u2 = u * u;
540 return u * (F(0.99997726) +
541 u2 * (F(-0.33262347) +
542 u2 * (F(0.19354346) +
543 u2 * (F(-0.11643287) +
544 u2 * (F(0.05265332) +
545 u2 * F(-0.01172120))))));
546}

References fl::FL_NO_EXCEPT.

Referenced by atan_full_().

+ Here is the caller graph for this function:

◆ availableRuntime()

DeviceRuntime fl::detail::availableRuntime ( )
inline

Definition at line 59 of file bus_info.h.

59 {
60 return DeviceRuntime{true, false, true, false, ""};
61}

References fl::FL_NO_EXCEPT.

Referenced by fl::detail::DeviceInfoResolver< Bus::AUTO, Which >::get(), and makeInfo().

+ Here is the caller graph for this function:

◆ bus_register_one()

template<Bus B, fl::u8 Which = 0>
int fl::detail::bus_register_one ( )
inline

Helper used by enableDrivers<Bus...>() to expand the parameter pack.

Each call ODR-uses BusTraits<B>::registerWithManager(), which lazily constructs the driver singleton AND registers it with ChannelManager.

Definition at line 84 of file bus_traits.h.

84 {
85 // Explicitly enabling a bus makes it eligible for clockless channels too.
88 return 0;
89}
void enable_clockless() FL_NO_EXCEPT
Definition bus_traits.h:64
Primary template — intentionally undefined.
Definition bus_traits.h:31

References enable_clockless(), and fl::FL_NO_EXCEPT.

Referenced by fl::enableDriver(), and fl::enableDrivers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLoggerEnabled()

template<typename InfoProvider>
void fl::detail::checkLoggerEnabled ( )
inline

Check if logger is enabled and print error once if not.

Template Parameters
InfoProviderType providing category name, define name, and enabled status

Definition at line 80 of file async_logger.h.

80 {
81 if (!InfoProvider::isEnabled()) {
82 static bool error_printed = false;
83 if (!error_printed) {
84 error_printed = true;
85 printLoggerDisabledError(InfoProvider::categoryName(), InfoProvider::defineName());
86 }
87 }
88 }
void printLoggerDisabledError(const char *category_name, const char *define_name) FL_NO_EXCEPT
Print error message for disabled logger (non-template helper) Called from checkLoggerEnabled template...

References checkLoggerEnabled(), fl::FL_NO_EXCEPT, and printLoggerDisabledError().

Referenced by checkLoggerEnabled(), and fl::get_async_logger_by_index().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ colorProfileStrictMode()

bool & fl::detail::colorProfileStrictMode ( )

Definition at line 11 of file color_profile.cpp.hpp.

11 {
12 static bool strict = false;
13 return strict;
14}

References fl::FL_NO_EXCEPT.

Referenced by CFastLED::colorManagementStrict(), and CFastLED::setColorManagementStrict().

+ Here is the caller graph for this function:

◆ cos_poly_quarterturn_()

template<typename F>
F fl::detail::cos_poly_quarterturn_ ( F x)
inline

Definition at line 259 of file math.cpp.hpp.

259 {
260 // cos(x) ≈ 1 - x²/2 + x⁴/24 - x⁶/720
261 const F x2 = x * x;
262 return F(1) - x2 * (F(0.5) - x2 * (F(1.0 / 24.0) - x2 * F(1.0 / 720.0)));
263}

References fl::FL_NO_EXCEPT, and fl::x.

◆ cos_reduce_()

template<typename F>
F fl::detail::cos_reduce_ ( F x)
inline

Definition at line 284 of file math.cpp.hpp.

284 {
285 // cos(x) = sin(π/2 - x)
286 const F kPiHalf = F(1.57079632679489661923);
287 return sin_reduce_(kPiHalf - x);
288}
F sin_reduce_(F x) FL_NO_EXCEPT
Definition math.cpp.hpp:266

References fl::FL_NO_EXCEPT, sin_reduce_(), and fl::x.

Referenced by fl::cos_impl_double(), fl::cos_impl_float(), fl::tan_impl_double(), and fl::tan_impl_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cycles_from_ns()

fl::u32 fl::detail::cycles_from_ns ( fl::u32 ns,
fl::u32 hz )
constexpr

Convert nanoseconds to CPU cycles.

Parameters
nsNumber of nanoseconds
hzCPU frequency in Hz
Returns
Number of cycles (rounded up)

Definition at line 29 of file delay.h.

29 {
30 // Round up: cycles = ceil(ns * hz / 1e9)
31 // Using: (ns * hz + 999'999'999) / 1'000'000'000
32 return ((fl::u64)ns * (fl::u64)hz + 999999999UL) / 1000000000UL;
33}
fl::u64 u64
Definition s16x16x4.h:221

References fl::FL_NO_EXCEPT.

Referenced by cycles_from_ns_default().

+ Here is the caller graph for this function:

◆ cycles_from_ns_default()

fl::u32 fl::detail::cycles_from_ns_default ( fl::u32 ns)
constexpr

Compute cycles using default CPU frequency (compile-time)

Parameters
nsNumber of nanoseconds
Returns
Number of cycles using FL_CPU_FREQUENCY()

Definition at line 38 of file delay.h.

38 {
39 return cycles_from_ns(ns, FL_CPU_FREQUENCY());
40}
constexpr fl::u32 cycles_from_ns(fl::u32 ns, fl::u32 hz) FL_NO_EXCEPT
Convert nanoseconds to CPU cycles.
Definition delay.h:29

References cycles_from_ns(), and fl::FL_NO_EXCEPT.

+ Here is the call graph for this function:

◆ defaultSourceProfile()

SourceProfile & fl::detail::defaultSourceProfile ( )

Definition at line 16 of file color_profile.cpp.hpp.

16 {
18 return profile;
19}
static constexpr SourceProfile linearSrgb() FL_NO_EXCEPT
A source declaration, not a container or an output-device selection.

References fl::FL_NO_EXCEPT, and fl::SourceProfile::linearSrgb().

Referenced by CFastLED::defaultSourceProfile(), CFastLED::setDefaultSourceProfile(), and fl::Channel::sourceProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delay_impl()

void fl::detail::delay_impl ( u32 ms,
bool run_async = true )

Internal delay implementation used by the public fl::delay wrapper.

Parameters
msMilliseconds to delay
run_asyncIf true, pump async tasks during delay (only on platforms with SKETCH_HAS_LARGE_MEMORY==1)

Definition at line 177 of file delay.cpp.hpp.

177 {
178#if SKETCH_HAS_LARGE_MEMORY
179 // Check if delay override is active (for fast testing with stub platform)
180 // When override is active, skip async pumping and use platform delay directly
181#if defined(FASTLED_STUB_IMPL) && (!defined(ARDUINO) || defined(FASTLED_USE_STUB_ARDUINO))
182 if (isDelayOverrideActive()) {
183 fl::platforms::delay(ms); // Use platform override directly
184 return;
185 }
186#endif
187
188 if (run_async && ms > 0) {
189 task::run(ms * 1000);
190 } else {
191 fl::platforms::delay(ms); // Use platform layer for raw delay
192 }
193#else
194 (void)run_async; // Suppress unused parameter warning
195 fl::platforms::delay(ms); // Use platform layer for raw delay
196#endif
197}
void run(fl::u32 microseconds, ExecFlags flags) FL_NO_EXCEPT
Run selected task subsystems.

References fl::FL_NO_EXCEPT, and fl::task::run().

Referenced by fl::delay(), fl::delayMillis(), and fl::delayMs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deque_grow_map_capacity()

FL_NO_INLINE fl::size fl::detail::deque_grow_map_capacity ( fl::size current_map_capacity,
fl::size min_required_chunks )

Definition at line 13 of file deque_basic.cpp.hpp.

14 {
15 fl::size next = current_map_capacity == 0
16 ? static_cast<fl::size>(kDequeInitialMapCapacity)
17 : current_map_capacity * 2;
18 while (next < min_required_chunks) {
19 if (next > static_cast<fl::size>(-1) / 2) {
20 // Saturate: doubling further would overflow fl::size.
21 return min_required_chunks;
22 }
23 next *= 2;
24 }
25 return next;
26}

References fl::FL_NO_EXCEPT, and kDequeInitialMapCapacity.

Referenced by fl::deque< int >::grow_map().

+ Here is the caller graph for this function:

◆ ditherFrame()

fl::u8 fl::detail::ditherFrame ( )

Return the temporal-dither phase shared by all controllers in this frame.

Definition at line 80 of file FastLED.cpp.hpp.

80 {
81 return gDitherFrame;
82}

References fl::FL_NO_EXCEPT, and gDitherFrame.

Referenced by fl::ColorManagedPixelSource::ColorManagedPixelSource(), and PixelController< RGB_ORDER, LANES, MASK >::init_binary_dithering().

+ Here is the caller graph for this function:

◆ div_by_count() [1/3]

template<typename T>
fl::enable_if< fl::is_floating_point< T >::value, T >::type fl::detail::div_by_count ( T sum,
fl::size count )
inline

Definition at line 11 of file div_by_count.h.

11{ return sum / static_cast<T>(count); }

Referenced by fl::detail::SavitzkyGolayFilterImpl< T, N >::recompute(), fl::detail::AlphaTrimmedMeanImpl< T, N >::update(), fl::detail::AlphaTrimmedMeanImpl< T, N >::update(), and fl::detail::HampelFilterImpl< T, N >::update().

+ Here is the caller graph for this function:

◆ div_by_count() [2/3]

template<typename T>
fl::enable_if< fl::is_integral< T >::value, T >::type fl::detail::div_by_count ( T sum,
fl::size count )
inline

Definition at line 15 of file div_by_count.h.

15{ return sum / static_cast<T>(count); }

◆ div_by_count() [3/3]

template<typename T>
fl::enable_if<!fl::is_floating_point< T >::value &&!fl::is_integral< T >::value, T >::type fl::detail::div_by_count ( T sum,
fl::size count )
inline

Definition at line 20 of file div_by_count.h.

20{ return sum / T(static_cast<float>(count)); }

◆ dotRowQ16()

i32 fl::detail::dotRowQ16 ( const i32(&) row[3],
const i32(&) v[3] )

One s16.16 matrix row against a vector, rounded and saturated.

Definition at line 349 of file device_solve.cpp.hpp.

349 {
350 return dotSolveRowQ16(row, v);
351}

References fl::FL_NO_EXCEPT.

Referenced by fl::buildBradfordMatrixQ16(), and fl::buildSourceMatrixQ16().

+ Here is the caller graph for this function:

◆ enable_clockless()

template<typename Traits>
void fl::detail::enable_clockless ( )
inline

Definition at line 64 of file bus_traits.h.

64 {
66}
auto enable_clockless_impl(int) FL_NO_EXCEPT -> decltype(Traits::enableClockless(), void())
Call Traits::enableClockless() when the bus provides one.
Definition bus_traits.h:57

References enable_clockless_impl(), and fl::FL_NO_EXCEPT.

Referenced by fl::SlimBridgeController< DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, DriverTraits, XTRA0, DIRECT_SHOW >::SlimBridgeController(), fl::detail::enable_clockless_for< ClocklessChipset, Traits >::apply(), bus_register_one(), and fl::ChannelManager::setExclusiveDriver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enable_clockless_impl() [1/2]

template<typename Traits>
auto fl::detail::enable_clockless_impl ( int ) -> decltype(Traits::enableClockless(), void())
inline

Call Traits::enableClockless() when the bus provides one.

Unified parallel-IO buses (FLEX_IO on classic ESP32 / ESP32-S3) keep their clockless pipeline unlinked until something that can route clockless data to them names this hook (#4793). Buses without the member are a no-op.

Definition at line 57 of file bus_traits.h.

58 {
59 Traits::enableClockless();
60}

References fl::FL_NO_EXCEPT.

Referenced by enable_clockless().

+ Here is the caller graph for this function:

◆ enable_clockless_impl() [2/2]

template<typename Traits>
void fl::detail::enable_clockless_impl ( long )
inline

Definition at line 62 of file bus_traits.h.

62{}

References fl::FL_NO_EXCEPT.

◆ enable_rgbw_conversion()

void fl::detail::enable_rgbw_conversion ( )

Installs the RGBW pixel conversion used by PixelIterator.

Called from the active Rgbw constructors, so a program that never builds an active Rgbw never links the conversion code (#4795).

Definition at line 732 of file rgbw.cpp.hpp.

732 {
733#if !defined(FL_IS_AVR)
734 // AVR's PixelIterator keeps its own thunk and never reads the slot.
735 rgbw_convert_slot() = &rgbw_convert_pixel;
736#endif
737}

References fl::FL_NO_EXCEPT.

Referenced by fl::Rgbw::Rgbw(), fl::Rgbw::Rgbw(), and fl::Channel::syncLegacySettings().

+ Here is the caller graph for this function:

◆ enable_rgbw_power_estimate()

void fl::detail::enable_rgbw_power_estimate ( )

Lets the power limiter charge a controller's RGBW conversion.

Called by CLEDController::applyRgbw – the one path in-tree that stores an Rgbw into a controller – and by Channel when its options carry one, so a sketch that never configures RGBW does not link the conversion into the limiter. Defined in power_mgt.cpp.hpp.

Definition at line 481 of file power_mgt.cpp.hpp.

481 {
483}
fl::u32 calculate_unscaled_power_mW(fl::span< const CRGB > leds) FL_NO_EXCEPT
static rgbw_power_fn gRgbwPowerEstimate
fl::u32(* rgbw_power_fn)(fl::span< const CRGB >, const fl::Rgbw &)

References calculate_unscaled_power_mW(), fl::FL_NO_EXCEPT, and gRgbwPowerEstimate.

Referenced by fl::CLEDController::applyRgbw(), and fl::Channel::syncLegacySettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enable_rgbww_conversion()

void fl::detail::enable_rgbww_conversion ( )

Installs the RGBWW pixel conversion (see enable_rgbw_conversion, #4795).

Definition at line 418 of file rgbww.cpp.hpp.

418 {
419#if !defined(FL_IS_AVR)
420 rgbww_convert_slot() = &rgbww_convert_pixel;
421#endif
422}

References fl::FL_NO_EXCEPT.

Referenced by fl::Rgbww::Rgbww(), fl::CLEDController::setRgbww(), and fl::Channel::syncLegacySettings().

+ Here is the caller graph for this function:

◆ encodeUart2Bits() [1/2]

FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION u8 fl::detail::encodeUart2Bits ( u8 two_bits)

Legacy 2-bit encoding using hardcoded WS2812 LUT (backward compat)

Parameters
two_bits2-bit value (0-3)
Returns
UART data byte (8 bits)

Definition at line 186 of file uart_wave_encoder.h.

186 {
187 // Hardcoded WS2812 LUT for backward compatibility with existing tests
188 static constexpr u8 kWs2812Lut[4] = {0xEF, 0x8F, 0xEC, 0x8C};
189 return kWs2812Lut[two_bits & 0x03];
190}

References fl::FL_NO_EXCEPT.

◆ encodeUart2Bits() [2/2]

FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION u8 fl::detail::encodeUart2Bits ( u8 two_bits,
const Wave10Lut & lut )

Encode 2 LED bits to 1 UART byte using a Wave10 LUT.

Parameters
two_bits2-bit value (0-3)
lutWave10 lookup table
Returns
UART data byte (8 bits)

Definition at line 166 of file uart_wave_encoder.h.

166 {
167 return lut.lut[two_bits & 0x03];
168}
u8 lut[4]
2-bit input -> UART data byte

References fl::FL_NO_EXCEPT.

Referenced by encodeUartByte(), and encodeUartByte().

+ Here is the caller graph for this function:

◆ encodeUartByte() [1/2]

FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void fl::detail::encodeUartByte ( u8 led_byte,
u8 * output )

Legacy byte encoding using hardcoded WS2812 LUT (backward compat)

Parameters
led_byteLED data byte (8 bits)
outputOutput buffer (must have space for 4 bytes)

Definition at line 196 of file uart_wave_encoder.h.

196 {
197 output[0] = encodeUart2Bits((led_byte >> 6) & 0x03); // Bits 7-6
198 output[1] = encodeUart2Bits((led_byte >> 4) & 0x03); // Bits 5-4
199 output[2] = encodeUart2Bits((led_byte >> 2) & 0x03); // Bits 3-2
200 output[3] = encodeUart2Bits((led_byte >> 0) & 0x03); // Bits 1-0
201}
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION u8 encodeUart2Bits(u8 two_bits, const Wave10Lut &lut) FL_NO_EXCEPT
Encode 2 LED bits to 1 UART byte using a Wave10 LUT.

References encodeUart2Bits(), and fl::FL_NO_EXCEPT.

+ Here is the call graph for this function:

◆ encodeUartByte() [2/2]

FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void fl::detail::encodeUartByte ( u8 led_byte,
u8 * output,
const Wave10Lut & lut )

Encode 1 LED byte to 4 UART bytes using a Wave10 LUT.

Parameters
led_byteLED data byte (8 bits)
outputOutput buffer (must have space for 4 bytes)
lutWave10 lookup table

Definition at line 175 of file uart_wave_encoder.h.

175 {
176 output[0] = encodeUart2Bits((led_byte >> 6) & 0x03, lut); // Bits 7-6
177 output[1] = encodeUart2Bits((led_byte >> 4) & 0x03, lut); // Bits 5-4
178 output[2] = encodeUart2Bits((led_byte >> 2) & 0x03, lut); // Bits 3-2
179 output[3] = encodeUart2Bits((led_byte >> 0) & 0x03, lut); // Bits 1-0
180}

References encodeUart2Bits(), and fl::FL_NO_EXCEPT.

Referenced by fl::encodeLedsToUart(), and fl::encodeLedsToUart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exp_reduced_() [1/2]

double fl::detail::exp_reduced_ ( double x)
inline

Definition at line 156 of file math.cpp.hpp.

156 {
157 // AVR builds double as 32 bits: the float path is the double path there,
158 // and the 64-bit bit patterns below would read past the value.
159 if (sizeof(double) == sizeof(float)) {
160 return static_cast<double>(exp_reduced_(static_cast<float>(x)));
161 }
162 DoubleBits xb;
163 xb.f = x;
164 const u64 ax = xb.u & 0x7fffffffffffffffull;
165 if (ax >= 0x40862e42fefa39efull) { // |x| >= 709.7827, or NaN
166 if (ax > 0x7ff0000000000000ull) return x; // NaN
167 if ((xb.u >> 63) == 0u) { // overflow -> +inf
168 DoubleBits inf;
169 inf.u = 0x7ff0000000000000ull;
170 return inf.f;
171 }
172 if (ax >= 0x40874910d52d3052ull) return 0.0; // x <= -745.133: underflow
173 }
174 const double kMagic = 6755399441055744.0; // 1.5 * 2^52
176 t.f = x * 1.44269504088896338700e+00 + kMagic;
177 const int k = static_cast<int>(t.i - 0x4338000000000000ll);
178 const double kd = t.f - kMagic;
179 // fdlibm e_exp: e^r = 1 + 2r/(2 - c(r)) with c a degree-5 polynomial in
180 // r^2. Five multiply-adds and one division reach < 1 ulp, half the work of
181 // a Taylor series of the same accuracy; that matters on cores that do
182 // double in software.
183 const double hi = x - kd * 6.93147180369123816490e-01;
184 const double lo = kd * 1.90821492927058770002e-10;
185 const double r = hi - lo;
186 const double r2 = r * r;
187 const double c = r - r2 * (1.66666666666666019037e-01 +
188 r2 * (-2.77777777770155933842e-03 +
189 r2 * (6.61375632143793436117e-05 +
190 r2 * (-1.65339022054652515390e-06 +
191 r2 * 4.13813679705723846039e-08))));
192 const double p = 1.0 - ((lo - (r * c) / (2.0 - c)) - hi);
193 return scale_pow2_(p, k);
194}
float scale_pow2_(float p, int k) FL_NO_EXCEPT
Definition math.cpp.hpp:107
float exp_reduced_(float x) FL_NO_EXCEPT
Definition math.cpp.hpp:125

References exp_reduced_(), fl::detail::DoubleBits::f, fl::FL_NO_EXCEPT, scale_pow2_(), fl::t, fl::detail::DoubleBits::u, and fl::x.

+ Here is the call graph for this function:

◆ exp_reduced_() [2/2]

float fl::detail::exp_reduced_ ( float x)
inline

Definition at line 125 of file math.cpp.hpp.

125 {
126 FloatBits xb;
127 xb.f = x;
128 const u32 ax = xb.u & 0x7fffffffu;
129 if (ax >= 0x42b17218u) { // |x| >= 88.7228, or NaN
130 if (ax > 0x7f800000u) return x; // NaN
131 if ((xb.u >> 31) == 0u) { // overflow -> +inf
132 FloatBits inf;
133 inf.u = 0x7f800000u;
134 return inf.f;
135 }
136 if (ax >= 0x42cff1b5u) return 0.0f; // x <= -103.972: underflow
137 }
138 // k = round(x / ln2) via the 1.5 * 2^23 magic constant: adding it puts
139 // the integer in the low mantissa bits, so no float<->int conversions.
140 const float kMagic = 12582912.0f;
141 FloatBits t;
142 t.f = x * 1.44269504088896341f + kMagic;
143 const int k = t.i - 0x4b400000;
144 const float kf = t.f - kMagic;
145 const float r = (x - kf * 6.9314575195e-01f) - kf * 1.4286067653e-06f;
146 // e^r = 1 + r + r^2 * P(r), P minimax on |r| <= ln2/2: worst case 1 ulp.
147 float p = 1.393364297e-03f;
148 p = p * r + 8.363175565e-03f;
149 p = p * r + 4.166646498e-02f;
150 p = p * r + 1.666657700e-01f;
151 p = p * r + 5.000000013e-01f;
152 p = (p * r * r) + r + 1.0f;
153 return scale_pow2_(p, k);
154}
int x
Definition simple.h:92
static uint32_t t
Definition Luminova.h:55

References fl::detail::FloatBits::f, fl::FL_NO_EXCEPT, scale_pow2_(), fl::t, fl::detail::FloatBits::u, and fl::x.

Referenced by fl::exp_impl_double(), fl::exp_impl_float(), and exp_reduced_().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ five_bit_hd_solve16() [1/2]

void fl::detail::five_bit_hd_solve16 ( fl::u16 r16,
fl::u16 g16,
fl::u16 b16,
fl::u8 min_field,
CRGB * out,
fl::u8 * out_field )

References fl::FL_NO_EXCEPT.

◆ five_bit_hd_solve16() [2/2]

void fl::detail::five_bit_hd_solve16 ( u16 r16,
u16 g16,
u16 b16,
u8 min_field,
CRGB * out,
u8 * out_field )

Definition at line 184 of file five_bit_hd_gamma.cpp.hpp.

185 {
186 // Target light per channel, in code x field units with eight fraction
187 // bits: a drive of 65535 is 255 x 31. The legacy solve's field rule is
188 // not monotonic at 16-bit resolution -- a one-step rise can move it to a
189 // field whose rounding lands lower -- so this uses its own: the smallest
190 // field f with T < 255.5 f, and codes rounded at that field. Within a
191 // field, rounding is monotonic; across a transition the new field's light
192 // is at least T - (f + 1) / 2 > 255 f, which is at least the old field's
193 // maximum. So emitted light never falls as a drive rises.
194 if (min_field < 1) {
195 min_field = 1;
196 }
197 if (min_field > 31) {
198 min_field = 31;
199 }
200 const u16 drives[3] = {r16, g16, b16};
201 u32 target[3];
202 u32 brightest = 0;
203 for (int i = 0; i < 3; ++i) {
204 target[i] = static_cast<u32>(
205 (static_cast<u64>(drives[i]) * 7905u * 256u) / 65535u); // 7905 = 255 x 31; u64 throughout (AVR int is 16 bits)
206 if (target[i] > brightest) {
207 brightest = target[i];
208 }
209 }
210 // 255.5 in eight fraction bits is 65408.
211 u32 field = brightest / 65408u + 1u;
212 if (field < min_field) {
213 field = min_field;
214 }
215 if (field > 31u) {
216 field = 31u;
217 }
218 const u32 unit = field * 256u;
219 for (int i = 0; i < 3; ++i) {
220 const u32 code = (target[i] + unit / 2u) / unit;
221 out->raw[i] = static_cast<u8>(code > 255u ? 255u : code);
222 }
223 *out_field = static_cast<u8>(field);
224}

References fl::FL_NO_EXCEPT.

◆ fixed_point_to_float()

template<typename FP>
float fl::detail::fixed_point_to_float ( FP value)

Definition at line 254 of file json.h.

256 {
257 return fl::bit_cast<float>(
To bit_cast(const From &from) FL_NO_EXCEPT
Definition bit_cast.h:48

References fl::bit_cast(), fl::FL_NO_EXCEPT, ieee754_bits_from_fixed_raw(), and fl::type_rank< T >::value.

Referenced by fl::json::json(), and fl::json::operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixed_raw_from_ieee754_bits()

bool fl::detail::fixed_raw_from_ieee754_bits ( u32 bits,
int frac_bits,
i64 * out )
inline

Definition at line 216 of file json.h.

218 {
219 const bool negative = (bits & 0x80000000u) != 0;
220 const u32 exp_bits = (bits >> 23) & 0xFFu;
221 const u32 mantissa_bits = bits & 0x007FFFFFu;
222 if (exp_bits == 0xFFu) {
223 return false;
224 }
225
226 u64 significand = mantissa_bits;
227 int exponent = -126;
228 if (exp_bits != 0) {
229 significand |= 0x00800000u;
230 exponent = static_cast<int>(exp_bits) - 127;
231 }
232
233 const int shift = exponent + frac_bits - 23;
234 u64 magnitude = 0;
235 if (shift >= 0) {
236 if (shift >= 63 || significand > (u64(0x7FFFFFFFFFFFFFFF) >> shift)) {
237 return false;
238 }
239 magnitude = significand << shift;
240 } else {
241 magnitude = round_shift_right_u64(significand, -shift);
242 }
243 if ((!negative && magnitude > u64(0x7FFFFFFFFFFFFFFF)) ||
244 (negative && magnitude > (u64(0x7FFFFFFFFFFFFFFF) + 1u))) {
245 return false;
246 }
247 *out = negative
248 ? (magnitude == (u64(0x7FFFFFFFFFFFFFFF) + 1u)
249 ? static_cast<i64>(0x8000000000000000ull)
250 : -static_cast<i64>(magnitude))
251 : static_cast<i64>(magnitude);
fl::u64 u64
Definition s16x16x4.h:221
u32 round_shift_right_u64(u64 value, int shift) FL_NO_EXCEPT
Definition json.h:144
fl::i64 i64
Definition s16x16x4.h:222

Referenced by fl::json::as_fixed_point().

+ Here is the caller graph for this function:

◆ fixedPointLeadingZeros()

FL_FIXED_POINT_DIVIDE_INLINE int fl::detail::fixedPointLeadingZeros ( u32 value)

Leading zeros of a non-zero 32-bit value; 32 for zero.

Definition at line 86 of file wide_divide.h.

86 {
87#if defined(__GNUC__) || defined(__clang__)
88 // One CLZ instruction on every core this file's fast path is enabled for.
89 return value == 0 ? 32 : __builtin_clz(value);
90#else
91 int count = 0;
92 while (count < 32 && (value & 0x80000000u) == 0u) {
93 value <<= 1;
94 ++count;
95 }
96 return count;
97#endif
98}
constexpr int type_rank< T >::value

References FL_FIXED_POINT_DIVIDE_INLINE, fl::FL_NO_EXCEPT, and fl::type_rank< T >::value.

Referenced by fl::divide64By32().

+ Here is the caller graph for this function:

◆ flat_map_lower_bound_idx()

FL_NO_INLINE fl::size fl::detail::flat_map_lower_bound_idx ( const void * data,
fl::size n,
const void * key,
const flat_map_ops & ops )

Definition at line 13 of file flat_map_basic.cpp.hpp.

15 {
16 const char* base = static_cast<const char*>(data);
17 fl::size first_idx = 0;
18 fl::size count = n;
19 while (count > 0) {
20 fl::size step = count / 2;
21 fl::size mid_idx = first_idx + step;
22 // `.first` of `pair<Key, Value>` is at offset 0 (standard layout).
23 const void* mid_key = base + mid_idx * ops.element_size;
24 if (ops.less_fn(ops.less_ctx, mid_key, key)) {
25 first_idx = mid_idx + 1;
26 count -= step + 1;
27 } else {
28 count = step;
29 }
30 }
31 return first_idx;
32}
flat_map_less_thunk_t less_fn
constexpr enable_if< is_fixed_point< T >::value, T >::type step(T edge, T x) FL_NO_EXCEPT

References fl::FL_NO_EXCEPT, and fl::step().

Referenced by fl::flat_map< int, FxPtr >::lower_bound(), and fl::flat_map< int, FxPtr >::lower_bound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flat_map_upper_bound_idx()

FL_NO_INLINE fl::size fl::detail::flat_map_upper_bound_idx ( const void * data,
fl::size n,
const void * key,
const flat_map_ops & ops )

Definition at line 35 of file flat_map_basic.cpp.hpp.

37 {
38 const char* base = static_cast<const char*>(data);
39 fl::size first_idx = 0;
40 fl::size count = n;
41 while (count > 0) {
42 fl::size step = count / 2;
43 fl::size mid_idx = first_idx + step;
44 const void* mid_key = base + mid_idx * ops.element_size;
45 // upper_bound: advance past elements where !(key < elem.first).
46 if (!ops.less_fn(ops.less_ctx, key, mid_key)) {
47 first_idx = mid_idx + 1;
48 count -= step + 1;
49 } else {
50 count = step;
51 }
52 }
53 return first_idx;
54}

References fl::FL_NO_EXCEPT, and fl::step().

Referenced by fl::flat_map< int, FxPtr >::upper_bound(), and fl::flat_map< int, FxPtr >::upper_bound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_copy_construct_fn() [1/2]

template<typename T>
fl::enable_if< has_copy_ctor< T >::value, void(*)(void *, constvoid *)>::type fl::detail::get_copy_construct_fn ( )

Definition at line 221 of file basic_vector.h.

221 {
222 return [](void* dst, const void* src) FL_NO_EXCEPT {
223 new (dst) T(*static_cast<const T*>(src));
224 };
225}
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186

References fl::FL_NO_EXCEPT.

Referenced by fl::vector_element_ops_for().

+ Here is the caller graph for this function:

◆ get_copy_construct_fn() [2/2]

template<typename T>
fl::enable_if<!has_copy_ctor< T >::value, void(*)(void *, constvoid *)>::type fl::detail::get_copy_construct_fn ( )

Definition at line 230 of file basic_vector.h.

230 {
231 return nullptr;
232}

References fl::FL_NO_EXCEPT.

◆ get_default_construct_fn() [1/2]

template<typename T>
fl::enable_if< has_default_ctor< T >::value, void(*)(void *)>::type fl::detail::get_default_construct_fn ( )

Definition at line 207 of file basic_vector.h.

207 {
208 return [](void* ptr) FL_NO_EXCEPT { new (ptr) T(); };
209}

References fl::FL_NO_EXCEPT.

Referenced by fl::vector_element_ops_for().

+ Here is the caller graph for this function:

◆ get_default_construct_fn() [2/2]

template<typename T>
fl::enable_if<!has_default_ctor< T >::value, void(*)(void *)>::type fl::detail::get_default_construct_fn ( )

Definition at line 214 of file basic_vector.h.

214 {
215 return nullptr;
216}

References fl::FL_NO_EXCEPT.

◆ get_hex_int_width()

template<size_t Size>
HexIntWidth fl::detail::get_hex_int_width ( )
constexpr

Compile-time integer width determination (default - triggers error)

Definition at line 60 of file charconv.h.

60 {
61 FL_STATIC_ASSERT(Size == 0, "Unsupported type size for hex conversion");
62 return HexIntWidth::Width8; // Unreachable, but needed for compilation
63}
#define FL_STATIC_ASSERT(...)

References fl::FL_NO_EXCEPT, FL_STATIC_ASSERT, get_hex_int_width(), and Width8.

Referenced by get_hex_int_width(), get_hex_int_width< 1 >(), get_hex_int_width< 2 >(), get_hex_int_width< 4 >(), get_hex_int_width< 8 >(), and fl::to_hex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_hex_int_width< 1 >()

template<>
HexIntWidth fl::detail::get_hex_int_width< 1 > ( )
constexpr

Specialization for 1-byte types (int8_t, uint8_t, char, etc.)

Definition at line 67 of file charconv.h.

67 {
69}

References fl::FL_NO_EXCEPT, get_hex_int_width(), and Width8.

+ Here is the call graph for this function:

◆ get_hex_int_width< 2 >()

template<>
HexIntWidth fl::detail::get_hex_int_width< 2 > ( )
constexpr

Specialization for 2-byte types (int16_t, uint16_t, short, etc.)

Definition at line 73 of file charconv.h.

73 {
75}

References fl::FL_NO_EXCEPT, get_hex_int_width(), and Width16.

+ Here is the call graph for this function:

◆ get_hex_int_width< 4 >()

template<>
HexIntWidth fl::detail::get_hex_int_width< 4 > ( )
constexpr

Specialization for 4-byte types (int32_t, uint32_t, int, etc.)

Definition at line 79 of file charconv.h.

79 {
81}

References fl::FL_NO_EXCEPT, get_hex_int_width(), and Width32.

+ Here is the call graph for this function:

◆ get_hex_int_width< 8 >()

template<>
HexIntWidth fl::detail::get_hex_int_width< 8 > ( )
constexpr

Specialization for 8-byte types (i64, u64, long long, etc.)

Definition at line 85 of file charconv.h.

85 {
87}

References fl::FL_NO_EXCEPT, get_hex_int_width(), and Width64.

+ Here is the call graph for this function:

◆ get_move_construct_fn() [1/2]

template<typename T>
fl::enable_if< has_move_ctor< T >::value, void(*)(void *, void *)>::type fl::detail::get_move_construct_fn ( )

Definition at line 253 of file basic_vector.h.

253 {
254 return [](void* dst, void* src) FL_NO_EXCEPT {
255 new (dst) T(static_cast<T&&>(*static_cast<T*>(src)));
256 };
257}

References fl::FL_NO_EXCEPT.

Referenced by fl::vector_element_ops_for().

+ Here is the caller graph for this function:

◆ get_move_construct_fn() [2/2]

template<typename T>
fl::enable_if<!has_move_ctor< T >::value, void(*)(void *, void *)>::type fl::detail::get_move_construct_fn ( )

Definition at line 261 of file basic_vector.h.

261 {
262 return nullptr;
263}

References fl::FL_NO_EXCEPT.

◆ get_swap_fn() [1/2]

template<typename T>
fl::enable_if< is_swappable< T >::value, void(*)(void *, void *)>::type fl::detail::get_swap_fn ( )

Definition at line 268 of file basic_vector.h.

268 {
269 return [](void* a, void* b) FL_NO_EXCEPT {
270 T& ta = *static_cast<T*>(a);
271 T& tb = *static_cast<T*>(b);
272 T tmp(static_cast<T&&>(ta));
273 ta = static_cast<T&&>(tb);
274 tb = static_cast<T&&>(tmp);
275 };
276}

References fl::FL_NO_EXCEPT.

Referenced by fl::vector_element_ops_for().

+ Here is the caller graph for this function:

◆ get_swap_fn() [2/2]

template<typename T>
fl::enable_if<!is_swappable< T >::value, void(*)(void *, void *)>::type fl::detail::get_swap_fn ( )

Definition at line 280 of file basic_vector.h.

280 {
281 return nullptr;
282}

References fl::FL_NO_EXCEPT.

◆ getWaitSpinBudgetUs()

fl::u32 fl::detail::getWaitSpinBudgetUs ( )

Get the current tiered-wait spin budget (microseconds).

Definition at line 29 of file wait_spin_budget.cpp.hpp.

29 {
30 return sWaitSpinBudgetUs.load();
31}

References fl::FL_NO_EXCEPT.

Referenced by CFastLED::_getWaitSpinBudgetUs(), throttleToMaxRefreshRate(), fl::ChannelManager::waitForCondition(), and fl::IChannelDriver::waitForCondition().

+ Here is the caller graph for this function:

◆ hdFieldFloor()

u8 & fl::detail::hdFieldFloor ( )

Backing store for CFastLED::setHdFieldFloor().

Default 31: the field is held fixed, which cannot add flicker, until a sketch lowers it.

Definition at line 47 of file five_bit_semantics.cpp.hpp.

47 {
49}
static T & instance() FL_NO_EXCEPT
Definition singleton.h:41

References fl::FL_NO_EXCEPT, and fl::Singleton< T, N >::instance().

Referenced by fl::anonymous_namespace{pipeline_binding.cpp.hpp}::encodeColorPipelineManagedSpi(), CFastLED::getHdFieldFloor(), fl::powerChannelCodecPolicy(), and CFastLED::setHdFieldFloor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ heap_sort()

template<typename Iterator, typename Compare>
void fl::detail::heap_sort ( Iterator first,
Iterator last,
Compare comp )

Definition at line 403 of file algorithm.h.

403 {
404 heapify(first, last, comp);
405
406 Iterator end = last - 1;
407 while (end > first) {
408 swap(*end, *first);
409 sift_down(first, first, end - 1, comp);
410 --end;
411 }
412}
constexpr T * end(T(&array)[N]) FL_NO_EXCEPT
void heapify(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:390
void sift_down(Iterator first, Iterator start, Iterator end, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:365
void swap(array< T, N > &lhs, array< T, N > &rhs) FL_NO_EXCEPT
Definition array.h:209

References fl::adl_barrier::end(), fl::FL_NO_EXCEPT, heapify(), sift_down(), and fl::swap().

+ Here is the call graph for this function:

◆ heapify()

template<typename Iterator, typename Compare>
void fl::detail::heapify ( Iterator first,
Iterator last,
Compare comp )

Definition at line 390 of file algorithm.h.

390 {
391 Iterator start = first + (last - first - 2) / 2;
392
393 while (true) {
394 sift_down(first, start, last - 1, comp);
395 if (start == first) {
396 break;
397 }
398 --start;
399 }
400}

References fl::FL_NO_EXCEPT, and sift_down().

Referenced by heap_sort().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hex()

fl::string fl::detail::hex ( u64 value,
HexIntWidth width,
bool is_negative,
bool uppercase,
bool pad_to_width )

Internal hex conversion function (implementation in charconv.cpp)

Parameters
valueThe unsigned 64-bit value to convert
widthThe bit width classification of the original type
is_negativeWhether the original value was negative (for signed types)
uppercaseIf true, use uppercase hex digits (A-F), otherwise lowercase (a-f)
pad_to_widthIf true, pad with leading zeros to full type width
Returns
Hexadecimal string representation

Definition at line 12 of file charconv.cpp.hpp.

12 {
13 // Determine target width in hex characters based on integer bit width
14 size_t target_width = 0;
15 switch (width) {
16 case HexIntWidth::Width8: target_width = 2; break; // 8 bits = 2 hex chars
17 case HexIntWidth::Width16: target_width = 4; break; // 16 bits = 4 hex chars
18 case HexIntWidth::Width32: target_width = 8; break; // 32 bits = 8 hex chars
19 case HexIntWidth::Width64: target_width = 16; break; // 64 bits = 16 hex chars
20 }
21
23 const char* digits = uppercase ? "0123456789ABCDEF" : "0123456789abcdef";
24
25 // Convert value to hex string (minimal representation)
26 u64 temp_value = value;
27 if (temp_value == 0) {
28 // Special case: zero should be "0" not empty string
29 result = fl::string("0");
30 } else {
31 while (temp_value > 0) {
32 char ch = digits[temp_value % 16];
33 // Convert char to string since fl::string::append treats char as number
34 char temp_ch_str[2] = {ch, '\0'};
35 fl::string digit_str(temp_ch_str);
36 // Use += since + operator is not defined for fl::string
37 fl::string temp = digit_str;
38 temp += result;
39 result = temp;
40 temp_value /= 16;
41 }
42 }
43
44 // Pad with leading zeros to target width (only if padding is requested)
45 if (pad_to_width) {
46 while (result.size() < target_width) {
47 fl::string zero_str("0");
48 zero_str += result;
49 result = zero_str;
50 }
51 }
52
53 // Add negative sign if needed
54 if (is_negative) {
55 fl::string minus_str("-");
56 minus_str += result;
57 result = minus_str;
58 }
59
60 return result;
61}
u8 width
Definition blur.h:186
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
constexpr int numeric_limits< char >::digits

References fl::FL_NO_EXCEPT, fl::numeric_limits< char >::digits, fl::type_rank< T >::value, fl::width, Width16, Width32, Width64, and Width8.

Referenced by fl::printf_detail::format_integral(), and fl::to_hex().

+ Here is the caller graph for this function:

◆ ieee754_bits_from_fixed_raw()

u32 fl::detail::ieee754_bits_from_fixed_raw ( i64 raw,
int frac_bits )
inline

Definition at line 208 of file json.h.

210 {
211 const u32 sign = raw < 0 ? 0x80000000u : 0u;
212 const u64 magnitude = raw < 0
213 ? static_cast<u64>(-(raw + 1)) + 1u
214 : static_cast<u64>(raw);
constexpr enable_if< is_fixed_point< T >::value, int >::type sign(T x) FL_NO_EXCEPT

Referenced by fixed_point_to_float().

+ Here is the caller graph for this function:

◆ ieee754_bits_from_scaled_u64()

u32 fl::detail::ieee754_bits_from_scaled_u64 ( u32 sign,
u64 magnitude,
int binary_exp )
inline

Definition at line 159 of file json.h.

162 {
163 if (magnitude == 0) {
164 return sign;
165 }
166
167 const int top_bit = json_floor_log2_u64(magnitude);
168 int exponent = top_bit + binary_exp;
169 if (exponent > 127) {
170 return sign | 0x7F800000u;
171 }
172
173 if (exponent >= -126) {
174 const int shift = top_bit - 23;
175 u32 significand = 0;
176 if (shift > 0) {
177 significand = round_shift_right_u64(magnitude, shift);
178 } else {
179 significand = static_cast<u32>(magnitude << -shift);
180 }
181 if (significand >= 0x01000000u) {
182 significand >>= 1;
183 ++exponent;
184 if (exponent > 127) {
185 return sign | 0x7F800000u;
186 }
187 }
188 return sign | (static_cast<u32>(exponent + 127) << 23) |
189 (significand & 0x007FFFFFu);
190 }
191
192 const int subnormal_shift = -(binary_exp + 149);
193 u32 mantissa = 0;
194 if (subnormal_shift > 0) {
195 mantissa = round_shift_right_u64(magnitude, subnormal_shift);
196 } else {
197 const int left_shift = -subnormal_shift;
198 if (left_shift >= 64 || magnitude > (u64(-1) >> left_shift)) {
199 return sign | 0x7F800000u;
200 }
201 const u64 shifted = magnitude << left_shift;
202 mantissa = shifted > 0x007FFFFFu ? 0x00800000u : static_cast<u32>(shifted);
203 }
204 if (mantissa >= 0x00800000u) {
205 return sign | 0x00800000u;
206 }
int json_floor_log2_u64(u64 value) FL_NO_EXCEPT
Definition types_impl.h:18

◆ in_unsigned_range()

template<typename IntT>
bool fl::detail::in_unsigned_range ( IntT n,
u32 max_u )
constexpr

Definition at line 39 of file traits.h.

39 {
40 return static_cast<i32>(fl::is_signed<IntT>::value ? (n >= IntT(0)) : 1) &&
41 static_cast<u32>(n) <= max_u;
42}

References fl::FL_NO_EXCEPT, and fl::fl::is_signed< T >::value.

Referenced by fl::detail::int_to_fixed< IntBits, FracBits, false >::from_unsigned(), and fl::detail::int_to_fixed< IntBits, FracBits, true >::from_unsigned().

+ Here is the caller graph for this function:

◆ insertion_sort()

template<typename Iterator, typename Compare>
void fl::detail::insertion_sort ( Iterator first,
Iterator last,
Compare comp )

Definition at line 303 of file algorithm.h.

303 {
304 if (first == last) return;
305
306 for (Iterator i = first + 1; i != last; ++i) {
307 auto value = fl::move(*i);
308 Iterator j = i;
309
310 while (j != first && comp(value, *(j - 1))) {
311 *j = fl::move(*(j - 1));
312 --j;
313 }
314
315 *j = fl::move(value);
316 }
317}
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition s16x16x4.h:30

References fl::FL_NO_EXCEPT, fl::fl::adl_barrier::move(), and fl::type_rank< T >::value.

Referenced by mergesort_impl(), quicksort_impl(), and fl::adl_barrier::sort_small().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ integer_digits10_func()

template<typename T>
int fl::detail::integer_digits10_func ( )
constexpr

Definition at line 30 of file limits.h.

30 {
31 return sizeof(T) == 1 ? 2 :
32 sizeof(T) == 2 ? 4 :
33 sizeof(T) == 4 ? 9 :
34 sizeof(T) == 8 ? 19 : 0;
35 }

References fl::FL_NO_EXCEPT.

◆ integer_digits_func()

template<typename T>
int fl::detail::integer_digits_func ( )
constexpr

Definition at line 17 of file limits.h.

17 {
18 return (sizeof(T) * 8) - (T(-1) < T(0) ? 1 : 0);
19 }

References fl::FL_NO_EXCEPT.

◆ integer_out_of_range_for_fixed_point_type()

void fl::detail::integer_out_of_range_for_fixed_point_type ( )
inline

Definition at line 33 of file traits.h.

33{}

References fl::FL_NO_EXCEPT.

Referenced by fl::detail::int_to_fixed< IntBits, FracBits, false >::from_signed(), fl::detail::int_to_fixed< IntBits, FracBits, true >::from_signed(), fl::detail::int_to_fixed< IntBits, FracBits, false >::from_unsigned(), and fl::detail::int_to_fixed< IntBits, FracBits, true >::from_unsigned().

+ Here is the caller graph for this function:

◆ json_bit_copy()

template<typename To, typename From>
To fl::detail::json_bit_copy ( const From & value)
inline

Definition at line 36 of file types_impl.h.

36 {
38}
To soft_bit_copy(const From &value) FL_NO_EXCEPT
Definition soft_float.h:47

References fl::FL_NO_EXCEPT, soft_bit_copy(), and fl::type_rank< T >::value.

+ Here is the call graph for this function:

◆ json_convert_to_bool_core()

FL_NO_INLINE TypeConversionResult fl::detail::json_convert_to_bool_core ( const json_value & val,
bool * out_value )

Definition at line 67 of file json_dispatch.cpp.hpp.

68 {
70 if (auto* p = val.data.template ptr<bool>()) {
71 *out_value = *p;
72 return result;
73 }
74 if (auto* p = val.data.template ptr<i64>()) {
75 *out_value = (*p != 0);
76 result.addWarning(fl::string("int ") + fl::to_string(*p) +
77 " converted to bool " + (*out_value ? "true" : "false"));
78 return result;
79 }
80 if (auto* p = val.data.template ptr<float>()) {
81#if FL_PLATFORM_HAS_LARGE_MEMORY
82 *out_value = (*p != 0.0f);
83 result.addWarning(fl::string("float ") + fl::to_string(*p, 6) +
84 " converted to bool " + (*out_value ? "true" : "false"));
85#else
86 (void)p;
87 *out_value = false;
88 result.setError("float -> bool not supported on Low-memory");
89#endif
90 return result;
91 }
92 if (auto* p = val.data.template ptr<fl::string>()) {
93 if (*p == "true" || *p == "1" || *p == "yes") {
94 *out_value = true;
95 result.addWarning(fl::string("string '") + *p + "' parsed as bool true");
96 } else if (*p == "false" || *p == "0" || *p == "no") {
97 *out_value = false;
98 result.addWarning(fl::string("string '") + *p + "' parsed as bool false");
99 } else {
100 result.setError(fl::string("cannot parse string '") + *p + "' as bool");
101 *out_value = false;
102 }
103 return result;
104 }
105 if (val.data.template ptr<fl::nullptr_t>()) {
106 result.setError("cannot convert null to bool");
107 *out_value = false;
108 return result;
109 }
110 result.setError("cannot convert array or object to bool");
111 *out_value = false;
112 return result;
113}
string to_string(T value) FL_NO_EXCEPT
Definition string.h:459
variant_t data
Definition types.h:760

References fl::FL_NO_EXCEPT, and fl::to_string().

Referenced by fl::detail::JsonToType< bool, void >::convert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ json_convert_to_float_core()

FL_NO_INLINE TypeConversionResult fl::detail::json_convert_to_float_core ( const json_value & val,
float * out_value )

Definition at line 116 of file json_dispatch.cpp.hpp.

117 {
119 if (auto* p = val.data.template ptr<float>()) {
120 *out_value = *p;
121 return result;
122 }
123 if (auto* p = val.data.template ptr<i64>()) {
124#if FL_PLATFORM_HAS_LARGE_MEMORY
125 *out_value = static_cast<float>(*p);
126 if (sizeof(float) < 8 && (*p > 16777216 || *p < -16777216)) {
127 result.addWarning(fl::string("large int ") + fl::to_string(*p) +
128 " may lose precision as float");
129 }
130#else
131 // Avoid __aeabi_l2f via i32 route (same trick as #3076).
132 if (*p > 2147483647LL) {
133 *out_value = static_cast<float>(2147483647);
134 } else if (*p < -2147483648LL) {
135 *out_value = static_cast<float>(-2147483648);
136 } else {
137 *out_value = static_cast<float>(static_cast<fl::i32>(*p));
138 }
139#endif
140 return result;
141 }
142 if (auto* p = val.data.template ptr<bool>()) {
143 *out_value = *p ? 1.0f : 0.0f;
144 result.addWarning(fl::string("bool converted to float ") +
145 (*p ? "1.0" : "0.0"));
146 return result;
147 }
148 if (auto* p = val.data.template ptr<fl::string>()) {
149#if FL_PLATFORM_HAS_LARGE_MEMORY
150 char* end = nullptr;
151 double parsed = fl::strtod(p->c_str(), &end);
152 if (end != p->c_str() && *end == '\0') {
153 *out_value = static_cast<float>(parsed);
154 result.addWarning(fl::string("string '") + *p + "' parsed to float");
155 } else {
156 result.setError(fl::string("cannot parse string '") + *p + "' as float");
157 *out_value = 0.0f;
158 }
159#else
160 (void)p;
161 *out_value = 0.0f;
162 result.setError("string -> float not supported on Low-memory");
163#endif
164 return result;
165 }
166 if (val.data.template ptr<fl::nullptr_t>()) {
167 result.setError("cannot convert null to float");
168 *out_value = 0.0f;
169 return result;
170 }
171 result.setError("cannot convert array or object to float");
172 *out_value = 0.0f;
173 return result;
174}
FASTLED_FORCE_INLINE double strtod(const char *str, char **endptr) FL_NO_EXCEPT
Definition cstdlib.h:77

References fl::adl_barrier::end(), fl::FL_NO_EXCEPT, fl::strtod(), and fl::to_string().

Referenced by fl::detail::JsonToType< T, typename fl::enable_if< fl::is_floating_point< T >::value >::type >::convert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ json_convert_to_i64_core()

FL_NO_INLINE TypeConversionResult fl::detail::json_convert_to_i64_core ( const json_value & val,
fl::i64 * out_value )

Definition at line 17 of file json_dispatch.cpp.hpp.

18 {
20 if (auto* p = val.data.template ptr<i64>()) {
21 *out_value = *p;
22 return result;
23 }
24 if (auto* p = val.data.template ptr<bool>()) {
25 *out_value = *p ? 1 : 0;
26 result.addWarning(fl::string("bool converted to int ") + fl::to_string(*out_value));
27 return result;
28 }
29 if (auto* p = val.data.template ptr<float>()) {
30#if FL_PLATFORM_HAS_LARGE_MEMORY
31 *out_value = static_cast<i64>(*p);
32 if (*p != static_cast<float>(*out_value)) {
33 result.addWarning(fl::string("float ") + fl::to_string(*p, 6) +
34 " truncated to int " + fl::to_string(*out_value));
35 }
36#else
37 (void)p;
38 *out_value = 0;
39 result.setError("float -> int not supported on Low-memory");
40#endif
41 return result;
42 }
43 if (auto* p = val.data.template ptr<fl::string>()) {
44 char* end = nullptr;
45 long parsed = fl::strtol(p->c_str(), &end, 10);
46 if (end != p->c_str() && *end == '\0') {
47 *out_value = static_cast<i64>(parsed);
48 result.addWarning(fl::string("string '") + *p + "' parsed to int " + fl::to_string(*out_value));
49 } else {
50 result.setError(fl::string("cannot parse string '") + *p + "' as integer");
51 }
52 return result;
53 }
54 if (val.data.template ptr<fl::nullptr_t>()) {
55 result.setError("cannot convert null to integer");
56 return result;
57 }
58 // Any remaining alternative (json_object, json_array, vector<i16>,
59 // vector<u8>, vector<float>) -- all are "container" types that don't
60 // convert cleanly to an integer.
61 result.setError("cannot convert array or object to integer");
62 *out_value = 0;
63 return result;
64}
fl::i64 i64
Definition s16x16x4.h:222
FASTLED_FORCE_INLINE long strtol(const char *str, char **endptr, int base) FL_NO_EXCEPT
Definition cstdlib.h:61

References fl::adl_barrier::end(), fl::FL_NO_EXCEPT, fl::strtol(), and fl::to_string().

Referenced by fl::detail::JsonToType< T, typename fl::enable_if< fl::is_integral< T >::value &&!fl::is_same< T, bool >::value >::type >::convert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ json_convert_to_string_core()

FL_NO_INLINE TypeConversionResult fl::detail::json_convert_to_string_core ( const json_value & val,
fl::string * out_value )

Definition at line 177 of file json_dispatch.cpp.hpp.

178 {
180 if (auto* p = val.data.template ptr<fl::string>()) {
181 *out_value = *p;
182 return result;
183 }
184 if (auto* p = val.data.template ptr<i64>()) {
185 *out_value = fl::to_string(*p);
186 result.addWarning(fl::string("int ") + *out_value + " converted to string");
187 return result;
188 }
189 if (auto* p = val.data.template ptr<float>()) {
190#if FL_PLATFORM_HAS_LARGE_MEMORY
191 *out_value = fl::to_string(*p, 6);
192 result.addWarning(fl::string("float ") + *out_value + " converted to string");
193#else
194 (void)p;
195 *out_value = "0";
196 result.setError("float -> string not supported on Low-memory");
197#endif
198 return result;
199 }
200 if (auto* p = val.data.template ptr<bool>()) {
201 *out_value = *p ? "true" : "false";
202 result.addWarning(fl::string("bool converted to string '") + *out_value + "'");
203 return result;
204 }
205 if (val.data.template ptr<fl::nullptr_t>()) {
206 *out_value = "null";
207 result.addWarning("null converted to string 'null'");
208 return result;
209 }
210 result.setError("cannot convert array or object to string");
211 out_value->clear();
212 return result;
213}
void clear(bool freeMemory=false) FL_NO_EXCEPT

References fl::FL_NO_EXCEPT, and fl::to_string().

Referenced by fl::detail::JsonToType< fl::string, void >::convert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ json_double_to_float()

float fl::detail::json_double_to_float ( double value)
inline

Definition at line 40 of file types_impl.h.

40 {
42}
float soft_double_to_float(double value) FL_NO_EXCEPT
Definition soft_float.h:182

References fl::FL_NO_EXCEPT, fl::soft_double_to_float(), and fl::type_rank< T >::value.

Referenced by fl::json::json(), fl::float_conversion_visitor< FloatType >::operator()(), and fl::json_value::operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ json_float_to_double()

double fl::detail::json_float_to_double ( float value)
inline

Definition at line 44 of file types_impl.h.

44 {
46}
double soft_float_to_double(float value) FL_NO_EXCEPT
Definition soft_float.h:192

References fl::FL_NO_EXCEPT, fl::soft_float_to_double(), and fl::type_rank< T >::value.

Referenced by fl::float_conversion_visitor< FloatType >::operator()(), and fl::float_conversion_visitor< double >::operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ json_floor_log2_u64()

int fl::detail::json_floor_log2_u64 ( u64 value)
inline

Definition at line 18 of file types_impl.h.

18 {
20}
int soft_floor_log2_u64(u64 value) FL_NO_EXCEPT
Definition soft_float.h:73

References fl::FL_NO_EXCEPT, soft_floor_log2_u64(), and fl::type_rank< T >::value.

+ Here is the call graph for this function:

◆ json_ieee754_double_bits_from_float_bits()

u64 fl::detail::json_ieee754_double_bits_from_float_bits ( u32 bits)
inline

Definition at line 31 of file types_impl.h.

31 {
33}
u64 soft_double_bits_from_float_bits(u32 bits) FL_NO_EXCEPT
Definition soft_float.h:152

References fl::FL_NO_EXCEPT, and fl::soft_double_bits_from_float_bits().

+ Here is the call graph for this function:

◆ json_ieee754_float_bits_from_double_bits()

u32 fl::detail::json_ieee754_float_bits_from_double_bits ( u64 bits)
inline

Definition at line 27 of file types_impl.h.

27 {
29}
u32 soft_float_bits_from_double_bits(u64 bits) FL_NO_EXCEPT
Definition soft_float.h:132

References fl::FL_NO_EXCEPT, and fl::soft_float_bits_from_double_bits().

+ Here is the call graph for this function:

◆ json_ieee754_float_bits_from_scaled_u64()

u32 fl::detail::json_ieee754_float_bits_from_scaled_u64 ( u32 sign,
u64 magnitude,
int binary_exp )
inline

Definition at line 22 of file types_impl.h.

23 {
24 return fl::detail::soft_float_bits_from_scaled_u64(sign, magnitude, binary_exp);
25}
u32 soft_float_bits_from_scaled_u64(u32 sign, u64 magnitude, int binary_exp) FL_NO_EXCEPT
Definition soft_float.h:82

References fl::FL_NO_EXCEPT, fl::sign(), and soft_float_bits_from_scaled_u64().

+ Here is the call graph for this function:

◆ json_round_shift_right_u64()

u32 fl::detail::json_round_shift_right_u64 ( u64 value,
int shift )
inline

Definition at line 14 of file types_impl.h.

14 {
16}
u32 soft_round_shift_right_u64(u64 value, int shift) FL_NO_EXCEPT
Definition soft_float.h:58

References fl::FL_NO_EXCEPT, soft_round_shift_right_u64(), and fl::type_rank< T >::value.

+ Here is the call graph for this function:

◆ ldexp_loop_()

template<typename F>
F fl::detail::ldexp_loop_ ( F value,
int exp )
inline

Definition at line 705 of file math.cpp.hpp.

705 {
706 if (value == F(0)) return value;
707 if (exp == 0) return value;
708 if (exp > 0) {
709 // Cap to avoid pathological loops; saturate to ±inf-ish via overflow
710 // (these magnitudes are well outside the IEEE 754 finite range, and
711 // returning a saturated value matches libm's behavior of producing
712 // ±HUGE_VAL on overflow).
713 if (exp > 1024) exp = 1024;
714 while (exp >= 30) { value *= F(1073741824); exp -= 30; } // 2^30
715 while (exp > 0) { value *= F(2); --exp; }
716 return value;
717 }
718 // exp < 0
719 int neg = -exp;
720 if (neg > 1024) neg = 1024;
721 while (neg >= 30) { value *= F(1.0 / 1073741824.0); neg -= 30; }
722 while (neg > 0) { value *= F(0.5); --neg; }
723 return value;
724}
enable_if< is_fixed_point< T >::value, T >::type exp(T x) FL_NO_EXCEPT

References fl::exp(), fl::FL_NO_EXCEPT, and fl::type_rank< T >::value.

Referenced by fl::ldexp_impl_double(), and fl::ldexp_impl_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log_emit()

void fl::detail::log_emit ( log_kind kind,
const char * file,
int line,
fl::sstream & body )

Definition at line 68 of file log.cpp.hpp.

68 {
69 const char* tag;
70 switch (kind) {
71 case log_kind::WARN: tag = "): WARN: "; break;
72 case log_kind::ERROR: tag = "): ERROR: "; break;
73 case log_kind::INFO:
74 default: tag = "): INFO: "; break;
75 }
76 // Snapshot the user-supplied payload (the only thing `body`
77 // contains at entry — the macro fed it only `<< X`).
78 fl::string user_payload(body.str());
79 // Reset body's buffer and rebuild prefix-then-payload INTO body.
80 // body is in the caller's frame; the c_str() pointer we hand to
81 // println below lives until the end of the FL_WARN expression.
82 body.clear();
83 body << file << "(" << line << tag << user_payload.c_str();
84 fl::println(body.c_str());
85}
void clear() FL_NO_EXCEPT
Definition strstream.h:366
const char * c_str() const FL_NO_EXCEPT
Definition strstream.h:44
void println(const char *str) FL_NO_EXCEPT

References fl::basic_string::c_str(), ERROR, fl::FL_NO_EXCEPT, FL_NO_INLINE, INFO, fl::println(), and WARN.

Referenced by log_emit_auto(), and log_emit_auto().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log_emit_auto() [1/3]

template<fl::size N>
void fl::detail::log_emit_auto ( log_kind kind,
const char * file,
int line,
const log_literal< N > & body )
inline

Definition at line 245 of file log.h.

246 {
247 // Treat a one-argument literal as data, not as a printf format string.
248 // This preserves legacy FL_WARN("100% loaded") behavior while still
249 // avoiding an sstream at the call site.
250 log_emit_literal(kind, file, line, body.c_str());
251}
FL_NO_INLINE void log_emit_literal(log_kind kind, const char *file, int line, const char *body) FL_NO_EXCEPT
Definition log.cpp.hpp:87

References fl::FL_NO_EXCEPT, and log_emit_literal().

+ Here is the call graph for this function:

◆ log_emit_auto() [2/3]

void fl::detail::log_emit_auto ( log_kind kind,
const char * file,
int line,
fl::sstream && body )
inline

Definition at line 258 of file log.h.

259 {
260 log_emit(kind, file, line, body);
261}
FL_NO_INLINE void log_emit(log_kind kind, const char *file, int line, fl::sstream &body) FL_NO_EXCEPT
Definition log.cpp.hpp:68

References fl::FL_NO_EXCEPT, and log_emit().

+ Here is the call graph for this function:

◆ log_emit_auto() [3/3]

void fl::detail::log_emit_auto ( log_kind kind,
const char * file,
int line,
fl::sstream & body )
inline

Definition at line 253 of file log.h.

254 {
255 log_emit(kind, file, line, body);
256}

References fl::FL_NO_EXCEPT, and log_emit().

+ Here is the call graph for this function:

◆ log_emit_literal()

void fl::detail::log_emit_literal ( log_kind kind,
const char * file,
int line,
const char * body )

Definition at line 87 of file log.cpp.hpp.

88 {
89 // Prefix + literal + newline, with no formatter involved.
90 log_emit_prefix(kind, file, line);
91 fl::print(body);
93}
FL_NO_INLINE void log_emit_prefix(log_kind kind, const char *file, int line) FL_NO_EXCEPT
Definition log.cpp.hpp:26
FL_NO_INLINE void log_emit_newline() FL_NO_EXCEPT
Definition log.cpp.hpp:48
void print(const char *str) FL_NO_EXCEPT

References fl::FL_NO_EXCEPT, FL_NO_INLINE, log_emit_newline(), log_emit_prefix(), and fl::print().

Referenced by log_emit_auto().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log_emit_newline()

void fl::detail::log_emit_newline ( )

Definition at line 48 of file log.cpp.hpp.

48{ fl::print("\n"); }

References fl::FL_NO_EXCEPT, FL_NO_INLINE, and fl::print().

Referenced by log_emit_literal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log_emit_prefix()

void fl::detail::log_emit_prefix ( log_kind kind,
const char * file,
int line )

Definition at line 26 of file log.cpp.hpp.

27 {
28 char digits[12]; // "-2147483648" + NUL
29 char* p = digits + sizeof(digits);
30 *--p = '\0';
31 unsigned magnitude = line < 0 ? 0u - static_cast<unsigned>(line)
32 : static_cast<unsigned>(line);
33 do {
34 *--p = static_cast<char>('0' + magnitude % 10u);
35 magnitude /= 10u;
36 } while (magnitude != 0u);
37 if (line < 0) {
38 *--p = '-';
39 }
40 fl::print(file);
41 fl::print("(");
42 fl::print(p);
43 fl::print("): ");
45 fl::print(": ");
46}
FL_NO_INLINE const char * log_kind_name(log_kind kind) FL_NO_EXCEPT
Definition log.cpp.hpp:13

References fl::FL_NO_EXCEPT, FL_NO_INLINE, log_kind_name(), fl::numeric_limits< char >::digits, and fl::print().

Referenced by log_emit_literal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log_kind_name()

const char * fl::detail::log_kind_name ( log_kind kind)

Definition at line 13 of file log.cpp.hpp.

13 {
14 switch (kind) {
15 case log_kind::WARN: return "WARN";
16 case log_kind::ERROR: return "ERROR";
17 case log_kind::INFO: return "INFO";
18 }
19 return "LOG";
20}

References ERROR, fl::FL_NO_EXCEPT, FL_NO_INLINE, INFO, and WARN.

Referenced by log_emit_prefix().

+ Here is the caller graph for this function:

◆ log_natural_()

template<typename F>
F fl::detail::log_natural_ ( F value)
inline

Definition at line 296 of file math.cpp.hpp.

296 {
297 if (value <= F(0)) return F(-1e30); // -inf surrogate
298 int e = 0;
299 while (value >= F(2)) { value *= F(0.5); ++e; }
300 while (value < F(1)) { value *= F(2); --e; }
301 // value ∈ [1, 2); evaluate log(value) via Taylor around 1: let u = value - 1.
302 // log(1+u) = u - u²/2 + u³/3 - u⁴/4 + ...
303 // Use enough terms for ~5-decimal accuracy on [0, 1].
304 const F u = value - F(1);
305 const F u2 = u * u;
306 const F u3 = u2 * u;
307 const F u4 = u2 * u2;
308 const F u5 = u4 * u;
309 const F u6 = u4 * u2;
310 const F u7 = u6 * u;
311 F log_m = u - u2 * F(0.5) + u3 * F(1.0 / 3.0) - u4 * F(0.25)
312 + u5 * F(0.2) - u6 * F(1.0 / 6.0) + u7 * F(1.0 / 7.0);
313 const F kLn2 = F(0.69314718055994530942);
314 return log_m + F(e) * kLn2;
315}

References fl::FL_NO_EXCEPT, and fl::type_rank< T >::value.

Referenced by fl::log10_impl_double(), fl::log10_impl_float(), fl::log_impl_double(), fl::log_impl_float(), fl::pow_impl_double(), and fl::pow_impl_float().

+ Here is the caller graph for this function:

◆ lower_bound_impl()

template<typename Iterator, typename T, typename Compare>
Iterator fl::detail::lower_bound_impl ( Iterator first,
Iterator last,
const T & value,
Compare comp )

Definition at line 447 of file algorithm.h.

447 {
448 auto count = last - first;
449 while (count > 0) {
450 auto step = count / 2;
451 Iterator it = first + step;
452 if (comp(*it, value)) {
453 first = ++it;
454 count -= step + 1;
455 } else {
456 count = step;
457 }
458 }
459 return first;
460}

References fl::FL_NO_EXCEPT, fl::step(), and fl::type_rank< T >::value.

Referenced by fl::adl_barrier::lower_bound(), fl::adl_barrier::lower_bound(), and merge_inplace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_lut_u16()

template<typename Fn, fl::size... Is>
LutArray< u16, sizeof...(Is)> fl::detail::make_lut_u16 ( fl::index_sequence< Is... > )
constexpr

Definition at line 241 of file gamma_lut.h.

241 {
242 return {{ Fn()(static_cast<u8>(Is))... }};
243}

References fl::FL_NO_EXCEPT.

◆ make_lut_u8()

template<typename Fn, fl::size... Is>
LutArray< u8, sizeof...(Is)> fl::detail::make_lut_u8 ( fl::index_sequence< Is... > )
constexpr

Definition at line 235 of file gamma_lut.h.

235 {
236 return {{ Fn()(static_cast<u8>(Is))... }};
237}

References fl::FL_NO_EXCEPT.

◆ makeInfo()

DeviceInfo fl::detail::makeInfo ( Bus bus,
fl::u8 which,
const char * vendor,
const char * device,
const char * notes = "" )
inline

Definition at line 67 of file bus_info.h.

68 {
69 return DeviceInfo{bus, which, busName(bus, which), vendor, device, notes,
70 false, availableRuntime()};
71}
DeviceRuntime availableRuntime() FL_NO_EXCEPT
Definition bus_info.h:59
const char * busName(Bus b, fl::u8 which=0) FL_NO_EXCEPT
Definition bus.h:153

References availableRuntime(), fl::busName(), and fl::FL_NO_EXCEPT.

Referenced by fl::detail::DeviceInfoResolver< Bus::BIT_BANG, Which >::get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeJsonRpcError()

json fl::detail::makeJsonRpcError ( int code,
const fl::string & message,
const json & id )
inline

Definition at line 69 of file rpc_registry.h.

69 {
70 json response = json::object();
71 response.set("jsonrpc", "2.0");
72
73 json error = json::object();
74 error.set("code", code);
75 error.set("message", message);
76 response.set("error", error);
77
78 if (id.has_value()) {
79 response.set("id", id);
80 }
81
82 return response;
83}
void set(const fl::string &key, const json &value) FL_NO_EXCEPT
Definition json.h:866
static json object() FL_NO_EXCEPT
Definition json.h:857

References fl::FL_NO_EXCEPT, fl::json::object(), and fl::json::set().

Referenced by fl::Rpc::handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeNoop()

DeviceInfo fl::detail::makeNoop ( Bus bus,
fl::u8 which,
const char * notes = "" )
inline

Definition at line 73 of file bus_info.h.

73 {
74 return DeviceInfo{bus, which, busName(bus, which), "NOOP", "no-op", notes,
75 true, unavailableRuntime()};
76}
DeviceRuntime unavailableRuntime() FL_NO_EXCEPT
Definition bus_info.h:63

References fl::busName(), fl::FL_NO_EXCEPT, and unavailableRuntime().

Referenced by fl::detail::DeviceInfoResolver< B, Which >::get(), and fl::detail::DeviceInfoResolver< Bus::BIT_BANG, Which >::get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeRuntimeRpcBinding()

template<typename R, typename... Args>
fl::shared_ptr< RuntimeRpcBinding > fl::detail::makeRuntimeRpcBinding ( fl::function< R(Args...)> fn)

Definition at line 247 of file runtime_rpc_binding.h.

247 {
248 using Helper = runtime_rpc::TrampolineHelper<R, Args...>;
249 using FunctionType = fl::function<R(Args...)>;
250 // user_fn is owned by the RuntimeRpcBinding via mDestroyUserFn (see Helper::destroy).
251 FunctionType* user_fn = new FunctionType(fl::move(fn)); // ok bare allocation
253 static_cast<void*>(user_fn),
254 &Helper::trampoline,
255 &Helper::destroy,
257 sizeof...(Args),
259 );
260}
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
static const RpcTypeOps * ops() FL_NO_EXCEPT
static const RpcTypeOps *const * table() FL_NO_EXCEPT

References fl::FL_NO_EXCEPT, fl::adl_barrier::make_shared(), fl::fl::adl_barrier::move(), fl::detail::RpcTypeOpsFor< T >::ops(), and fl::detail::runtime_rpc::ArgTypesTable< Args >::table().

Referenced by fl::Rpc::registerMethod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ median_of_three()

template<typename Iterator, typename Compare>
Iterator fl::detail::median_of_three ( Iterator first,
Iterator middle,
Iterator last,
Compare comp )

Definition at line 321 of file algorithm.h.

321 {
322 if (comp(*middle, *first)) {
323 if (comp(*last, *middle)) {
324 return middle;
325 } else if (comp(*last, *first)) {
326 return last;
327 } else {
328 return first;
329 }
330 } else {
331 if (comp(*last, *first)) {
332 return first;
333 } else if (comp(*last, *middle)) {
334 return last;
335 } else {
336 return middle;
337 }
338 }
339}

References fl::FL_NO_EXCEPT.

Referenced by partition().

+ Here is the caller graph for this function:

◆ merge_inplace()

template<typename Iterator, typename Compare>
void fl::detail::merge_inplace ( Iterator first,
Iterator middle,
Iterator last,
Compare comp )

Definition at line 464 of file algorithm.h.

464 {
465 // If one of the ranges is empty, nothing to merge
466 if (first == middle || middle == last) {
467 return;
468 }
469
470 // If arrays are small enough, use insertion-based merge
471 auto left_size = middle - first;
472 auto right_size = last - middle;
473 if (left_size + right_size <= 32) {
474 // Simple insertion-based merge for small arrays
475 Iterator left = first;
476 Iterator right = middle;
477
478 while (left < middle && right < last) {
479 if (!comp(*right, *left)) {
480 // left element is in correct position
481 ++left;
482 } else {
483 // right element needs to be inserted into left part
484 auto value = fl::move(*right);
485 Iterator shift_end = right;
486 Iterator shift_start = left;
487
488 // Shift elements to make room
489 while (shift_end > shift_start) {
490 *shift_end = fl::move(*(shift_end - 1));
491 --shift_end;
492 }
493
494 *left = fl::move(value);
495 ++left;
496 ++middle; // middle has shifted right
497 ++right;
498 }
499 }
500 return;
501 }
502
503 // For larger arrays, use rotation-based merge
504 if (left_size == 0 || right_size == 0) {
505 return;
506 }
507
508 if (left_size == 1) {
509 // Find insertion point for the single left element in right array
510 Iterator pos = lower_bound_impl(middle, last, *first, comp);
511 rotate_impl(first, middle, pos);
512 return;
513 }
514
515 if (right_size == 1) {
516 // Find insertion point for the single right element in left array
517 Iterator pos = lower_bound_impl(first, middle, *(last - 1), comp);
518 rotate_impl(pos, middle, last);
519 return;
520 }
521
522 // Divide both arrays and recursively merge
523 Iterator left_mid = first + left_size / 2;
524 Iterator right_mid = lower_bound_impl(middle, last, *left_mid, comp);
525
526 // Rotate to bring the two middle parts together
527 rotate_impl(left_mid, middle, right_mid);
528
529 // Update middle position
530 Iterator new_middle = left_mid + (right_mid - middle);
531
532 // Recursively merge the two parts
533 merge_inplace(first, left_mid, new_middle, comp);
534 merge_inplace(new_middle, right_mid, last, comp);
535}
uint8_t pos
Definition Blur.ino:11
void rotate_impl(Iterator first, Iterator middle, Iterator last) FL_NO_EXCEPT
Definition algorithm.h:429
Iterator lower_bound_impl(Iterator first, Iterator last, const T &value, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:447
void merge_inplace(Iterator first, Iterator middle, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:464

References fl::FL_NO_EXCEPT, lower_bound_impl(), merge_inplace(), fl::fl::adl_barrier::move(), pos, rotate_impl(), and fl::type_rank< T >::value.

Referenced by merge_inplace(), and mergesort_impl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mergesort_impl()

template<typename Iterator, typename Compare>
void fl::detail::mergesort_impl ( Iterator first,
Iterator last,
Compare comp )

Definition at line 539 of file algorithm.h.

539 {
540 auto size = last - first;
541 if (size <= 16) { // Use insertion sort for small arrays (it's stable)
542 insertion_sort(first, last, comp);
543 return;
544 }
545
546 Iterator middle = first + size / 2;
547 mergesort_impl(first, middle, comp);
548 mergesort_impl(middle, last, comp);
549 merge_inplace(first, middle, last, comp);
550}
void mergesort_impl(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:539
void insertion_sort(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:303

References fl::FL_NO_EXCEPT, insertion_sort(), merge_inplace(), and mergesort_impl().

Referenced by mergesort_impl(), and fl::adl_barrier::stable_sort().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ not_null_assert_failed()

void fl::detail::not_null_assert_failed ( const char * message)

Definition at line 24 of file not_null.cpp.hpp.

24 {
25 FL_UNUSED(message); // FL_ASSERT compiles to nothing in some builds
26 FL_ASSERT(false, message);
27}
#define FL_ASSERT(x, MSG)
Definition assert.h:6
#define FL_UNUSED(x)

References FL_ASSERT, fl::FL_NO_EXCEPT, and FL_UNUSED.

Referenced by fl::not_null< StringHolderPtr >::not_null(), and fl::not_null< StringHolderPtr >::operator=().

+ Here is the caller graph for this function:

◆ partition()

template<typename Iterator, typename Compare>
Iterator fl::detail::partition ( Iterator first,
Iterator last,
Compare comp )

Definition at line 343 of file algorithm.h.

343 {
344 Iterator middle = first + (last - first) / 2;
345 Iterator pivot_iter = median_of_three(first, middle, last - 1, comp);
346
347 // Move pivot to end
348 swap(*pivot_iter, *(last - 1));
349 Iterator pivot = last - 1;
350
351 Iterator i = first;
352 for (Iterator j = first; j != pivot; ++j) {
353 if (comp(*j, *pivot)) {
354 swap(*i, *j);
355 ++i;
356 }
357 }
358
359 swap(*i, *pivot);
360 return i;
361}
Iterator median_of_three(Iterator first, Iterator middle, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:321

References fl::FL_NO_EXCEPT, median_of_three(), and fl::swap().

Referenced by quicksort_impl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pick_variant_copy_fn()

template<typename T>
variant_copy_fn fl::detail::pick_variant_copy_fn ( )
constexpr

Definition at line 96 of file variant.h.

96 {
98 ? &variant_trivial_copy_n<sizeof(T)>
99 : &typed_copy_thunk<T>;
100}
void typed_copy_thunk(void *dst, const void *src) FL_NO_EXCEPT
Definition variant.h:60
void variant_trivial_copy_n(void *dst, const void *src) FL_NO_EXCEPT
Definition variant.h:76

References fl::FL_NO_EXCEPT, typed_copy_thunk(), fl::is_trivially_copyable< T >::value, and variant_trivial_copy_n().

+ Here is the call graph for this function:

◆ pick_variant_destroy_fn()

template<typename T>
variant_destroy_fn fl::detail::pick_variant_destroy_fn ( )
constexpr

Definition at line 89 of file variant.h.

89 {
93}
void typed_destroy_thunk(void *storage) FL_NO_EXCEPT
Definition variant.h:55
void variant_noop_destroy(void *) FL_NO_EXCEPT
Definition variant.h:73

References fl::FL_NO_EXCEPT, typed_destroy_thunk(), fl::is_trivially_copyable< T >::value, and variant_noop_destroy().

+ Here is the call graph for this function:

◆ pick_variant_move_fn()

template<typename T>
variant_move_fn fl::detail::pick_variant_move_fn ( )
constexpr

Definition at line 103 of file variant.h.

103 {
105 ? &variant_trivial_move_n<sizeof(T)>
106 : &typed_move_thunk<T>;
107}
void typed_move_thunk(void *dst, void *src) FL_NO_EXCEPT
Definition variant.h:66
void variant_trivial_move_n(void *dst, void *src) FL_NO_EXCEPT
Definition variant.h:81

References fl::FL_NO_EXCEPT, typed_move_thunk(), fl::is_trivially_copyable< T >::value, and variant_trivial_move_n().

+ Here is the call graph for this function:

◆ print_emit_auto() [1/3]

template<fl::size N>
void fl::detail::print_emit_auto ( const log_literal< N > & body)
inline

Definition at line 264 of file log.h.

264 {
265 fl::println(body.c_str());
266}

References fl::FL_NO_EXCEPT, and fl::println().

+ Here is the call graph for this function:

◆ print_emit_auto() [2/3]

void fl::detail::print_emit_auto ( fl::sstream && body)
inline

Definition at line 272 of file log.h.

272 {
273 fl::println(body.c_str());
274}

References fl::FL_NO_EXCEPT, and fl::println().

+ Here is the call graph for this function:

◆ print_emit_auto() [3/3]

void fl::detail::print_emit_auto ( fl::sstream & body)
inline

Definition at line 268 of file log.h.

268 {
269 fl::println(body.c_str());
270}

References fl::FL_NO_EXCEPT, and fl::println().

+ Here is the call graph for this function:

◆ printLoggerDisabledError()

void fl::detail::printLoggerDisabledError ( const char * category_name,
const char * define_name )

Print error message for disabled logger (non-template helper) Called from checkLoggerEnabled template function IMPORTANT: This must NOT be inline - needs external linkage for cross-TU calls.

Definition at line 20 of file async_logger.cpp.hpp.

20 {
21 FL_UNUSED(category_name); // only consumed by FL_ERROR, a no-op on small platforms
22 FL_UNUSED(define_name);
23 FL_ERROR(category_name << " ASYNC LOGGING NOT ENABLED. Add '#define " << define_name << "' before including FastLED.h");
24 }
#define FL_ERROR(...)
Definition log.h:373

References FL_ERROR, fl::FL_NO_EXCEPT, and FL_UNUSED.

Referenced by checkLoggerEnabled().

+ Here is the caller graph for this function:

◆ qsort_impl()

void fl::detail::qsort_impl ( char * base,
size_t nmemb,
size_t size,
qsort_compare_fn compar )

Definition at line 456 of file cstdlib.cpp.hpp.

456 {
457 if (nmemb <= 1) {
458 return;
459 }
460
461 // Use insertion sort for small arrays (threshold of 16)
462 if (nmemb <= 16) {
463 qsort_insertion_sort(base, nmemb, size, compar);
464 return;
465 }
466
467 size_t pivot_idx = qsort_partition(base, nmemb, size, compar);
468
469 // Sort left partition
470 qsort_impl(base, pivot_idx, size, compar);
471
472 // Sort right partition
473 if (pivot_idx + 1 < nmemb) {
474 qsort_impl(base + (pivot_idx + 1) * size, nmemb - pivot_idx - 1, size, compar);
475 }
476}
void qsort_impl(char *base, size_t nmemb, size_t size, qsort_compare_fn compar) FL_NO_EXCEPT
static void qsort_insertion_sort(char *base, size_t nmemb, size_t size, qsort_compare_fn compar) FL_NO_EXCEPT
static size_t qsort_partition(char *base, size_t nmemb, size_t size, qsort_compare_fn compar) FL_NO_EXCEPT

References fl::FL_NO_EXCEPT, qsort_impl(), fl::qsort_insertion_sort(), and fl::qsort_partition().

Referenced by fl::libc_impl::qsort(), and qsort_impl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qsort_swap()

void fl::detail::qsort_swap ( char * a,
char * b,
size_t size )

Definition at line 369 of file cstdlib.cpp.hpp.

369 {
370 if (a == b) return;
371 constexpr size_t STACK_BUF_SIZE = 64;
372 if (size <= STACK_BUF_SIZE) {
373 char tmp[STACK_BUF_SIZE];
374 memcpy(tmp, a, size);
375 memcpy(a, b, size);
376 memcpy(b, tmp, size);
377 } else {
378 for (size_t i = 0; i < size; ++i) {
379 char t = a[i];
380 a[i] = b[i];
381 b[i] = t;
382 }
383 }
384}
FASTLED_FORCE_INLINE void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
Definition cstring.h:136

References fl::FL_NO_EXCEPT, fl::memcpy(), and fl::t.

Referenced by fl::qsort_insertion_sort(), and fl::qsort_partition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quicksort_impl()

template<typename Iterator, typename Compare>
void fl::detail::quicksort_impl ( Iterator first,
Iterator last,
Compare comp )

Definition at line 416 of file algorithm.h.

416 {
417 if (last - first <= 16) { // Use insertion sort for small arrays
418 insertion_sort(first, last, comp);
419 return;
420 }
421
422 Iterator pivot = partition(first, last, comp);
423 quicksort_impl(first, pivot, comp);
424 quicksort_impl(pivot + 1, last, comp);
425}
Iterator partition(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:343
void quicksort_impl(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:416

References fl::FL_NO_EXCEPT, insertion_sort(), partition(), and quicksort_impl().

Referenced by quicksort_impl(), and fl::adl_barrier::sort().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rgbw_conversion()

RgbwConvertFn fl::detail::rgbw_conversion ( )

Null until enable_rgbw_conversion() has run.

Definition at line 738 of file rgbw.cpp.hpp.

738{ return rgbw_convert_slot(); }

References fl::FL_NO_EXCEPT.

Referenced by fl::PixelIterator::PixelIterator(), and fl::PixelIterator::set_rgbw().

+ Here is the caller graph for this function:

◆ rgbww_conversion()

RgbwwConvertFn fl::detail::rgbww_conversion ( )

Definition at line 423 of file rgbww.cpp.hpp.

423{ return rgbww_convert_slot(); }

References fl::FL_NO_EXCEPT.

Referenced by fl::PixelIterator::PixelIterator(), and fl::PixelIterator::set_rgbww().

+ Here is the caller graph for this function:

◆ rotate_impl()

template<typename Iterator>
void fl::detail::rotate_impl ( Iterator first,
Iterator middle,
Iterator last )

Definition at line 429 of file algorithm.h.

429 {
430 if (first == middle || middle == last) {
431 return;
432 }
433
434 Iterator next = middle;
435 while (first != next) {
436 swap(*first++, *next++);
437 if (next == last) {
438 next = middle;
439 } else if (first == middle) {
440 middle = next;
441 }
442 }
443}

References fl::FL_NO_EXCEPT, and fl::swap().

Referenced by merge_inplace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ round_shift_right_u64()

u32 fl::detail::round_shift_right_u64 ( u64 value,
int shift )
inline

Definition at line 144 of file json.h.

144 : fl::true_type {};
145
146inline u32 round_shift_right_u64(u64 value, int shift) FL_NO_EXCEPT {
147 if (shift <= 0) {
148 return static_cast<u32>(value);
149 }
150 if (shift >= 64) {
151 return 0;
152 }
153 const u64 half = u64(1) << (shift - 1);
154 const u64 mask = (u64(1) << shift) - 1;
155 const u64 truncated = value >> shift;
156 const u64 remainder = value & mask;
157 const bool round_up = remainder > half || (remainder == half && (truncated & 1));
integral_constant< bool, true > true_type
Definition s16x16x4.h:28

◆ roundedDivideQ16()

i64 fl::detail::roundedDivideQ16 ( i64 numerator,
i64 denominator )

The s16.16 building blocks the bind-time builders share.

Definition at line 340 of file device_solve.cpp.hpp.

340 {
341 return ::fl::roundedDivideQ16(numerator, denominator);
342}

References fl::FL_NO_EXCEPT.

Referenced by fl::buildBradfordMatrixQ16(), and fl::buildSourceMatrixQ16().

+ Here is the caller graph for this function:

◆ scale_pow2_() [1/2]

double fl::detail::scale_pow2_ ( double p,
int k )
inline

Definition at line 116 of file math.cpp.hpp.

116 {
117 const int a = k / 2;
118 const int b = k - a;
119 DoubleBits fa, fb;
120 fa.u = static_cast<u64>(a + 1023) << 52;
121 fb.u = static_cast<u64>(b + 1023) << 52;
122 return (p * fa.f) * fb.f;
123}

References fl::detail::DoubleBits::f, fl::FL_NO_EXCEPT, and fl::detail::DoubleBits::u.

◆ scale_pow2_() [2/2]

float fl::detail::scale_pow2_ ( float p,
int k )
inline

Definition at line 107 of file math.cpp.hpp.

107 {
108 const int a = k / 2;
109 const int b = k - a;
110 FloatBits fa, fb;
111 fa.u = static_cast<u32>(a + 127) << 23;
112 fb.u = static_cast<u32>(b + 127) << 23;
113 return (p * fa.f) * fb.f;
114}

References fl::detail::FloatBits::f, fl::FL_NO_EXCEPT, and fl::detail::FloatBits::u.

Referenced by exp_reduced_(), and exp_reduced_().

+ Here is the caller graph for this function:

◆ setWaitSpinBudgetUs()

void fl::detail::setWaitSpinBudgetUs ( fl::u32 budget_us)

Set the tiered-wait spin budget (microseconds).

Definition at line 33 of file wait_spin_budget.cpp.hpp.

33 {
34 sWaitSpinBudgetUs.store(budget_us);
35}

References fl::FL_NO_EXCEPT.

Referenced by CFastLED::_setWaitSpinBudgetUs().

+ Here is the caller graph for this function:

◆ sift_down()

template<typename Iterator, typename Compare>
void fl::detail::sift_down ( Iterator first,
Iterator start,
Iterator end,
Compare comp )

Definition at line 365 of file algorithm.h.

365 {
366 Iterator root = start;
367
368 while (root - first <= (end - first - 2) / 2) {
369 Iterator child = first + 2 * (root - first) + 1;
370 Iterator swap_iter = root;
371
372 if (comp(*swap_iter, *child)) {
373 swap_iter = child;
374 }
375
376 if (child + 1 <= end && comp(*swap_iter, *(child + 1))) {
377 swap_iter = child + 1;
378 }
379
380 if (swap_iter == root) {
381 return;
382 } else {
383 swap(*root, *swap_iter);
384 root = swap_iter;
385 }
386 }
387}

References fl::adl_barrier::end(), fl::FL_NO_EXCEPT, and fl::swap().

Referenced by heap_sort(), and heapify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sin_poly_quarterturn_()

template<typename F>
F fl::detail::sin_poly_quarterturn_ ( F x)
inline

Definition at line 252 of file math.cpp.hpp.

252 {
253 // sin(x) ≈ x - x³/6 + x⁵/120 - x⁷/5040
254 const F x2 = x * x;
255 return x * (F(1) - x2 * (F(1.0 / 6.0) - x2 * (F(1.0 / 120.0) - x2 * F(1.0 / 5040.0))));
256}

References fl::FL_NO_EXCEPT, and fl::x.

Referenced by sin_reduce_().

+ Here is the caller graph for this function:

◆ sin_reduce_()

template<typename F>
F fl::detail::sin_reduce_ ( F x)
inline

Definition at line 266 of file math.cpp.hpp.

266 {
267 const F kPi = F(3.14159265358979323846);
268 const F kTwoPi = F(6.28318530717958647692);
269 const F kPiHalf = F(1.57079632679489661923);
270 // Reduce to [-π, π]: subtract floor(x / 2π) * 2π.
271 // For the FastLED use cases we expect |x| < ~100, so this loop runs a
272 // bounded number of times. For pathological inputs we cap iterations.
273 int guard = 32;
274 while (x > kPi && guard > 0) { x -= kTwoPi; --guard; }
275 while (x < -kPi && guard > 0) { x += kTwoPi; --guard; }
276 // Map to [-π/2, π/2] using sin(π - x) = sin(x).
277 if (x > kPiHalf) x = kPi - x;
278 if (x < -kPiHalf) x = -kPi - x;
279 // [-π/2, π/2] -- the polynomial works fine here (max |x| ≈ 1.57).
280 return sin_poly_quarterturn_(x);
281}
F sin_poly_quarterturn_(F x) FL_NO_EXCEPT
Definition math.cpp.hpp:252

References fl::FL_NO_EXCEPT, sin_poly_quarterturn_(), and fl::x.

Referenced by cos_reduce_(), fl::sin_impl_double(), fl::sin_impl_float(), fl::tan_impl_double(), and fl::tan_impl_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singleton_registry_get()

void * fl::detail::singleton_registry_get ( const char * key)

Definition at line 19 of file singleton.cpp.hpp.

19 {
20 for (int i = 0; i < registry_count; i++) {
21 if (fl::strcmp(registry[i].key, key) == 0) {
22 return registry[i].value;
23 }
24 }
25 return nullptr;
26}
FASTLED_FORCE_INLINE int strcmp(const char *s1, const char *s2) FL_NO_EXCEPT
Definition cstring.h:60

References fl::FL_NO_EXCEPT, fl::strcmp(), and fl::detail::anonymous_namespace{singleton.cpp.hpp}::RegistryEntry::value.

Referenced by fl::SingletonShared< T, N >::instance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singleton_registry_set()

void fl::detail::singleton_registry_set ( const char * key,
void * value )

Definition at line 28 of file singleton.cpp.hpp.

28 {
29 // Check if already registered (update)
30 for (int i = 0; i < registry_count; i++) {
31 if (fl::strcmp(registry[i].key, key) == 0) {
32 registry[i].value = value;
33 return;
34 }
35 }
36 // Add new entry
37 if (registry_count < REGISTRY_MAX) {
38 registry[registry_count++] = {key, value};
39 }
40}

References fl::FL_NO_EXCEPT, fl::strcmp(), fl::type_rank< T >::value, and fl::detail::anonymous_namespace{singleton.cpp.hpp}::RegistryEntry::value.

Referenced by fl::SingletonShared< T, N >::instance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ slab_allocator_registry_get()

void * fl::detail::slab_allocator_registry_get ( fl::size block_size,
fl::size slab_size )

Definition at line 274 of file allocator.cpp.hpp.

274 {
275 auto& s = slab_registry_state();
276 for (int i = 0; i < s.count; i++) {
277 if (s.entries[i].block_size == block_size &&
278 s.entries[i].slab_size == slab_size) {
279 return s.entries[i].allocator;
280 }
281 }
282 return nullptr;
283}

References fl::FL_NO_EXCEPT.

Referenced by fl::allocator_slab< T, SLAB_SIZE >::get_allocator().

+ Here is the caller graph for this function:

◆ slab_allocator_registry_set()

void fl::detail::slab_allocator_registry_set ( fl::size block_size,
fl::size slab_size,
void * allocator )

Definition at line 285 of file allocator.cpp.hpp.

285 {
286 auto& s = slab_registry_state();
287 // Check if already registered (update)
288 for (int i = 0; i < s.count; i++) {
289 if (s.entries[i].block_size == block_size &&
290 s.entries[i].slab_size == slab_size) {
291 s.entries[i].allocator = allocator;
292 return;
293 }
294 }
295 // Add new entry
296 if (s.count < SlabRegistryState::MAX) {
297 s.entries[s.count++] = {block_size, slab_size, allocator};
298 }
299}

References fl::FL_NO_EXCEPT.

Referenced by fl::allocator_slab< T, SLAB_SIZE >::get_allocator().

+ Here is the caller graph for this function:

◆ soft_bit_copy()

template<typename To, typename From>
To fl::detail::soft_bit_copy ( const From & value)
inline

Definition at line 47 of file soft_float.h.

47 {
48 To out = 0;
49 const char* src = fl::bit_cast_ptr<const char>(&value);
50 char* dst = fl::bit_cast_ptr<char>(&out);
51 const fl::size n = sizeof(To) < sizeof(From) ? sizeof(To) : sizeof(From);
52 for (fl::size i = 0; i < n; ++i) {
53 dst[i] = src[i];
54 }
55 return out;
56}
To * bit_cast_ptr(void *storage) FL_NO_EXCEPT
Definition bit_cast.h:60

References fl::bit_cast_ptr(), fl::FL_NO_EXCEPT, and fl::type_rank< T >::value.

Referenced by json_bit_copy(), fl::soft_double_to_float(), and fl::soft_float_to_double().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ soft_float_bits_from_scaled_u64()

u32 fl::detail::soft_float_bits_from_scaled_u64 ( u32 sign,
u64 magnitude,
int binary_exp )
inline

Definition at line 82 of file soft_float.h.

83 {
84 if (magnitude == 0) {
85 return sign;
86 }
87
88 const int top_bit = soft_floor_log2_u64(magnitude);
89 int exponent = top_bit + binary_exp;
90 if (exponent > 127) {
91 return sign | 0x7F800000u;
92 }
93
94 if (exponent >= -126) {
95 const int shift = top_bit - 23;
96 u32 significand = shift > 0
97 ? soft_round_shift_right_u64(magnitude, shift)
98 : static_cast<u32>(magnitude << -shift);
99 if (significand >= 0x01000000u) {
100 significand >>= 1;
101 ++exponent;
102 if (exponent > 127) {
103 return sign | 0x7F800000u;
104 }
105 }
106 return sign | (static_cast<u32>(exponent + 127) << 23) |
107 (significand & 0x007FFFFFu);
108 }
109
110 const int subnormal_shift = -(binary_exp + 149);
111 u32 mantissa = 0;
112 if (subnormal_shift > 0) {
113 mantissa = soft_round_shift_right_u64(magnitude, subnormal_shift);
114 } else {
115 const int left_shift = -subnormal_shift;
116 if (left_shift >= 64 || magnitude > (u64(-1) >> left_shift)) {
117 return sign | 0x7F800000u;
118 }
119 const u64 shifted = magnitude << left_shift;
120 mantissa = shifted > 0x007FFFFFu ? 0x00800000u : static_cast<u32>(shifted);
121 }
122 if (mantissa >= 0x00800000u) {
123 return sign | 0x00800000u;
124 }
125 return sign | mantissa;
126}

References fl::FL_NO_EXCEPT, fl::sign(), soft_floor_log2_u64(), and soft_round_shift_right_u64().

Referenced by json_ieee754_float_bits_from_scaled_u64(), and fl::soft_float_bits_from_double_bits().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ soft_floor_log2_u64()

int fl::detail::soft_floor_log2_u64 ( u64 value)
inline

Definition at line 73 of file soft_float.h.

73 {
74 int bit = -1;
75 while (value != 0) {
76 value >>= 1;
77 ++bit;
78 }
79 return bit;
80}

References fl::FL_NO_EXCEPT, and fl::type_rank< T >::value.

Referenced by json_floor_log2_u64(), and soft_float_bits_from_scaled_u64().

+ Here is the caller graph for this function:

◆ soft_round_shift_right_u64()

u32 fl::detail::soft_round_shift_right_u64 ( u64 value,
int shift )
inline

Definition at line 58 of file soft_float.h.

58 {
59 if (shift <= 0) {
60 return static_cast<u32>(value);
61 }
62 if (shift >= 64) {
63 return 0;
64 }
65 const u64 half = u64(1) << (shift - 1);
66 const u64 mask = (u64(1) << shift) - 1;
67 const u64 truncated = value >> shift;
68 const u64 remainder = value & mask;
69 const bool round_up = remainder > half || (remainder == half && (truncated & 1));
70 return static_cast<u32>(truncated + (round_up ? 1 : 0));
71}

References fl::FL_NO_EXCEPT, and fl::type_rank< T >::value.

Referenced by json_round_shift_right_u64(), and soft_float_bits_from_scaled_u64().

+ Here is the caller graph for this function:

◆ span_invalid_pointer_range()

void fl::detail::span_invalid_pointer_range ( )

Definition at line 10 of file span.cpp.hpp.

10 {
11 FL_ERROR("fl::span pointer range has end before begin");
12}

References FL_ERROR, and fl::FL_NO_EXCEPT.

Referenced by fl::span< T, dynamic_extent >::pointer_range_size().

+ Here is the caller graph for this function:

◆ spread_transpose16_symbol()

FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void fl::detail::spread_transpose16_symbol ( const u8 l[16],
u8 out[16] )

Transpose one symbol of 16 lanes (16 input bytes) into 16 output bytes: 8 pulses × 2 bytes, low byte = lanes 0-7, high byte = lanes 8-15, pulse order 7..0 (out[0] = pulse 7 low).

Matches the naive layout.

Definition at line 44 of file bit_spread_lut.hpp.

44 {
45 const u32 aLo = spreadA(l[0]) | spreadA(l[1]) << 1 | spreadA(l[2]) << 2 | spreadA(l[3]) << 3 |
46 spreadA(l[4]) << 4 | spreadA(l[5]) << 5 | spreadA(l[6]) << 6 | spreadA(l[7]) << 7;
47 const u32 bLo = spreadB(l[0]) | spreadB(l[1]) << 1 | spreadB(l[2]) << 2 | spreadB(l[3]) << 3 |
48 spreadB(l[4]) << 4 | spreadB(l[5]) << 5 | spreadB(l[6]) << 6 | spreadB(l[7]) << 7;
49 const u32 aHi = spreadA(l[8]) | spreadA(l[9]) << 1 | spreadA(l[10]) << 2 | spreadA(l[11]) << 3 |
50 spreadA(l[12]) << 4 | spreadA(l[13]) << 5 | spreadA(l[14]) << 6 | spreadA(l[15]) << 7;
51 const u32 bHi = spreadB(l[8]) | spreadB(l[9]) << 1 | spreadB(l[10]) << 2 | spreadB(l[11]) << 3 |
52 spreadB(l[12]) << 4 | spreadB(l[13]) << 5 | spreadB(l[14]) << 6 | spreadB(l[15]) << 7;
53 out[0] = static_cast<u8>(aLo); out[1] = static_cast<u8>(aHi);
54 out[2] = static_cast<u8>(aLo >> 8); out[3] = static_cast<u8>(aHi >> 8);
55 out[4] = static_cast<u8>(aLo >> 16); out[5] = static_cast<u8>(aHi >> 16);
56 out[6] = static_cast<u8>(aLo >> 24); out[7] = static_cast<u8>(aHi >> 24);
57 out[8] = static_cast<u8>(bLo); out[9] = static_cast<u8>(bHi);
58 out[10] = static_cast<u8>(bLo >> 8); out[11] = static_cast<u8>(bHi >> 8);
59 out[12] = static_cast<u8>(bLo >> 16); out[13] = static_cast<u8>(bHi >> 16);
60 out[14] = static_cast<u8>(bLo >> 24); out[15] = static_cast<u8>(bHi >> 24);
61}
FASTLED_FORCE_INLINE u32 spreadB(u8 v) FL_NO_EXCEPT
Pulses 3,2,1,0 of v (byte j = bit (3-j)). Depends only on the low nibble.
FASTLED_FORCE_INLINE u32 spreadA(u8 v) FL_NO_EXCEPT
Pulses 7,6,5,4 of v (byte j = bit (7-j)). Depends only on the high nibble.

References fl::FL_NO_EXCEPT, spreadA(), and spreadB().

Referenced by wave3_transpose_16(), wave8_transpose_16(), wave8_transpose_16_bf1(), wave8_transpose_16x2_pipe2(), wave8_transpose_16x4_bf1_pipe4(), and wave8_transpose_16x4_pipe4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spread_transpose8_symbol()

FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void fl::detail::spread_transpose8_symbol ( const u8 l[8],
u8 out[8] )

Transpose one symbol of 8 lanes (8 input bytes) into 8 output bytes: 8 pulses × 1 byte (bit L = lane L), pulse order 7..0 (out[0] = pulse 7).

Definition at line 66 of file bit_spread_lut.hpp.

66 {
67 const u32 a = spreadA(l[0]) | spreadA(l[1]) << 1 | spreadA(l[2]) << 2 | spreadA(l[3]) << 3 |
68 spreadA(l[4]) << 4 | spreadA(l[5]) << 5 | spreadA(l[6]) << 6 | spreadA(l[7]) << 7;
69 const u32 b = spreadB(l[0]) | spreadB(l[1]) << 1 | spreadB(l[2]) << 2 | spreadB(l[3]) << 3 |
70 spreadB(l[4]) << 4 | spreadB(l[5]) << 5 | spreadB(l[6]) << 6 | spreadB(l[7]) << 7;
71 out[0] = static_cast<u8>(a); out[1] = static_cast<u8>(a >> 8);
72 out[2] = static_cast<u8>(a >> 16); out[3] = static_cast<u8>(a >> 24);
73 out[4] = static_cast<u8>(b); out[5] = static_cast<u8>(b >> 8);
74 out[6] = static_cast<u8>(b >> 16); out[7] = static_cast<u8>(b >> 24);
75}

References fl::FL_NO_EXCEPT, spreadA(), and spreadB().

Referenced by wave3_transpose_8(), wave8_transpose_8(), and wave8_transpose_8_bf1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spreadA()

FASTLED_FORCE_INLINE u32 fl::detail::spreadA ( u8 v)

Pulses 7,6,5,4 of v (byte j = bit (7-j)). Depends only on the high nibble.

Definition at line 36 of file bit_spread_lut.hpp.

36{ return kSpreadNibble[v >> 4]; }
constexpr u32 kSpreadNibble[16]
kSpreadNibble[n] places the 4 bits of nibble n at bit 0 of 4 separate bytes: byte0 = bit3(n),...

References FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, and kSpreadNibble.

Referenced by spread_transpose16_symbol(), spread_transpose8_symbol(), and wave8_transpose_4_bf1().

+ Here is the caller graph for this function:

◆ spreadB()

FASTLED_FORCE_INLINE u32 fl::detail::spreadB ( u8 v)

Pulses 3,2,1,0 of v (byte j = bit (3-j)). Depends only on the low nibble.

Definition at line 38 of file bit_spread_lut.hpp.

38{ return kSpreadNibble[v & 0x0Fu]; }

References FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, and kSpreadNibble.

Referenced by spread_transpose16_symbol(), spread_transpose8_symbol(), and wave8_transpose_4_bf1().

+ Here is the caller graph for this function:

◆ sqrt_newton_()

template<typename F>
F fl::detail::sqrt_newton_ ( F value)
inline

Definition at line 233 of file math.cpp.hpp.

233 {
234 if (value <= F(0)) return F(0);
235 // Initial estimate: x_0 = value / 2. Pure-arithmetic, no bit-cast needed.
236 // Newton converges quadratically so 5-6 iterations is plenty even from a
237 // crude start.
238 F x = value;
239 if (x > F(1)) x = F(1) + (x - F(1)) * F(0.5); // bias toward 1 for fast convergence
240 for (int i = 0; i < 6; ++i) {
241 if (x == F(0)) break;
242 x = F(0.5) * (x + value / x);
243 }
244 return x;
245}

References fl::FL_NO_EXCEPT, fl::type_rank< T >::value, and fl::x.

Referenced by fl::asin_impl_double(), fl::asin_impl_float(), fl::hypot_impl_double(), fl::hypot_impl_float(), fl::sqrt_impl_double(), and fl::sqrt_impl_float().

+ Here is the caller graph for this function:

◆ test_encoder() [1/2]

template<typename T>
bool fl::detail::test_encoder ( ...)
constexpr

Definition at line 35 of file clockless_encoder.h.

35{ return false; }

References fl::FL_NO_EXCEPT.

◆ test_encoder() [2/2]

template<typename T>
auto fl::detail::test_encoder ( int ) -> decltype(T::ENCODER, true)
constexpr

Definition at line 33 of file clockless_encoder.h.

33{ return true; }

References fl::FL_NO_EXCEPT.

◆ to_string()

void fl::detail::to_string ( const fl::u16 * bit_data,
fl::u32 bit_count,
string * dst )

Definition at line 9 of file bitset.cpp.hpp.

9 {
10 fl::string& result = *dst;
11 constexpr fl::u32 bits_per_block = 8 * sizeof(fl::u16); // 16 bits per block
12
13 for (fl::u32 i = 0; i < bit_count; ++i) {
14 const fl::u32 block_idx = i / bits_per_block;
15 const fl::u32 bit_offset = i % bits_per_block;
16
17 // Extract the bit from the block
18 bool bit_value = (bit_data[block_idx] >> bit_offset) & 1;
19 result.append(bit_value ? "1" : "0");
20 }
21}

References fl::FL_NO_EXCEPT.

Referenced by FL_DISABLE_WARNING(), and fl::bitset_dynamic::to_string().

+ Here is the caller graph for this function:

◆ typed_copy_thunk()

template<typename T>
void fl::detail::typed_copy_thunk ( void * dst,
const void * src )

Definition at line 60 of file variant.h.

60 {
61 const T* source = fl::bit_cast_ptr<const T>(src);
62 new (dst) T(*source);
63}

References fl::bit_cast_ptr(), and fl::FL_NO_EXCEPT.

Referenced by pick_variant_copy_fn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ typed_destroy_thunk()

template<typename T>
void fl::detail::typed_destroy_thunk ( void * storage)

Definition at line 55 of file variant.h.

55 {
56 fl::bit_cast_ptr<T>(storage)->~T();
57}

References fl::bit_cast_ptr(), and fl::FL_NO_EXCEPT.

Referenced by pick_variant_destroy_fn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ typed_move_thunk()

template<typename T>
void fl::detail::typed_move_thunk ( void * dst,
void * src )

Definition at line 66 of file variant.h.

66 {
67 T* source = fl::bit_cast_ptr<T>(src);
68 new (dst) T(fl::move(*source));
69}

References fl::bit_cast_ptr(), fl::FL_NO_EXCEPT, and fl::fl::adl_barrier::move().

Referenced by pick_variant_move_fn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unavailableRuntime()

DeviceRuntime fl::detail::unavailableRuntime ( )
inline

Definition at line 63 of file bus_info.h.

63 {
64 return DeviceRuntime{false, false, false, false, "unavailable"};
65}

References fl::FL_NO_EXCEPT.

Referenced by makeNoop().

+ Here is the caller graph for this function:

◆ unordered_map_probe_idx()

FL_NO_INLINE fl::size fl::detail::unordered_map_probe_idx ( fl::size h,
fl::size i,
fl::size mask,
fl::size cap )

Definition at line 14 of file unordered_map_basic.cpp.hpp.

15 {
17 return (h + i) & mask;
18 }
20 return (h + i + i * i) & mask;
21 }
22 return (h + i) & mask;
23}

References fl::FL_NO_EXCEPT, kUnorderedMapLinearProbeOnlyThreshold, and kUnorderedMapQuadraticProbingTries.

Referenced by fl::iterator<, u8 >::find_index(), fl::iterator<, u8 >::find_slot(), and fl::iterator<, u8 >::find_unoccupied_index_using_bitset().

+ Here is the caller graph for this function:

◆ UpscalePaletteInterpolated()

template<typename TSrcPalette, typename TDestPalette>
void fl::detail::UpscalePaletteInterpolated ( const TSrcPalette & srcpal,
TDestPalette & destpal )

Definition at line 1282 of file colorutils.cpp.hpp.

1283 {
1284 const fl::u16 dest_size =
1285 sizeof(destpal.entries) / sizeof(destpal.entries[0]);
1286 for (fl::u16 i = 0; i < dest_size; ++i) {
1287 destpal[static_cast<fl::u8>(i)] =
1288 ColorFromPalette(srcpal, static_cast<fl::u8>(i));
1289 }
1290}
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType) FL_NO_EXCEPT

References fl::ColorFromPalette(), and fl::FL_NO_EXCEPT.

Referenced by fl::UpscalePalette(), fl::UpscalePalette(), fl::UpscalePalette(), and fl::UpscalePalette().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpscalePaletteRepeat()

template<typename TSrcPalette, typename TDestPalette>
void fl::detail::UpscalePaletteRepeat ( const TSrcPalette & srcpal,
TDestPalette & destpal )

Definition at line 1267 of file colorutils.cpp.hpp.

1268 {
1269 const fl::u16 src_size = sizeof(srcpal.entries) / sizeof(srcpal.entries[0]);
1270 const fl::u16 dest_size =
1271 sizeof(destpal.entries) / sizeof(destpal.entries[0]);
1272 const fl::u16 repeat = dest_size / src_size;
1273 for (fl::u16 i = 0; i < src_size; ++i) {
1274 const fl::u16 start = i * repeat;
1275 for (fl::u16 j = 0; j < repeat; ++j) {
1276 destpal[static_cast<fl::u8>(start + j)] = srcpal[static_cast<fl::u8>(i)];
1277 }
1278 }
1279}

References fl::FL_NO_EXCEPT.

Referenced by fl::UpscalePalette(), and fl::UpscalePalette().

+ Here is the caller graph for this function:

◆ variant_noop_destroy()

void fl::detail::variant_noop_destroy ( void * )
inline

Definition at line 73 of file variant.h.

73{}

References fl::FL_NO_EXCEPT.

Referenced by pick_variant_destroy_fn().

+ Here is the caller graph for this function:

◆ variant_trivial_copy_n()

template<fl::size N>
void fl::detail::variant_trivial_copy_n ( void * dst,
const void * src )

Definition at line 76 of file variant.h.

76 {
77 fl::memcpy(dst, src, N);
78}

References fl::FL_NO_EXCEPT, and fl::memcpy().

Referenced by pick_variant_copy_fn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ variant_trivial_move_n()

template<fl::size N>
void fl::detail::variant_trivial_move_n ( void * dst,
void * src )

Definition at line 81 of file variant.h.

81 {
82 fl::memcpy(dst, src, N);
83}

References fl::FL_NO_EXCEPT, and fl::memcpy().

Referenced by pick_variant_move_fn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave3_convert_byte_to_wave3byte()

void fl::detail::wave3_convert_byte_to_wave3byte ( u8 byte_value,
const Wave3BitExpansionLut & lut,
Wave3Byte * output )

Convert one byte to a Wave3Byte using the nibble LUT.

Split-nibble path (high nibble + low nibble); bit-identical output to a wave3-eligible chipset's expected pulse pattern.

Definition at line 23 of file wave3.cpp.hpp.

25 {
26 u16 high_pattern = lut.lut[(byte_value >> 4) & 0xF];
27 u16 low_pattern = lut.lut[byte_value & 0xF];
28
29 output->data[0] = (u8)(high_pattern >> 4);
30 output->data[1] = (u8)(((high_pattern & 0xF) << 4) | ((low_pattern >> 8) & 0xF));
31 output->data[2] = (u8)(low_pattern & 0xFF);
32}
u8 data[3]
Definition wave3.h:22

References fl::FL_NO_EXCEPT.

Referenced by fl::wave3(), fl::wave3Transpose_16(), fl::wave3Transpose_2(), fl::wave3Transpose_4(), and fl::wave3Transpose_8().

+ Here is the caller graph for this function:

◆ wave3_transpose_16()

void fl::detail::wave3_transpose_16 ( const Wave3Byte lane_waves[16],
u8 output[16 *sizeof(Wave3Byte)] )

Transpose 16 lanes of Wave3Byte data via the spread-LUT path (#2533).

Definition at line 118 of file wave3.cpp.hpp.

119 {
120 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
121 u8 l[16];
122 for (int lane = 0; lane < 16; lane++) {
123 l[lane] = lane_waves[lane].data[symbol_idx];
124 }
125 spread_transpose16_symbol(l, output + symbol_idx * 16);
126 }
127}
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void spread_transpose16_symbol(const u8 l[16], u8 out[16]) FL_NO_EXCEPT
Transpose one symbol of 16 lanes (16 input bytes) into 16 output bytes: 8 pulses × 2 bytes,...

References fl::Wave3Byte::data, fl::FL_NO_EXCEPT, and spread_transpose16_symbol().

Referenced by fl::wave3Transpose_16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave3_transpose_2()

void fl::detail::wave3_transpose_2 ( const Wave3Byte lane_waves[2],
u8 output[2 *sizeof(Wave3Byte)] )

Transpose 2 lanes of Wave3Byte data into interleaved format.

Definition at line 35 of file wave3.cpp.hpp.

36 {
37 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
38 u8 l0 = lane_waves[0].data[symbol_idx];
39 u8 l1 = lane_waves[1].data[symbol_idx];
40
41 u16 interleaved = 0;
42 for (int bit = 0; bit < 8; bit++) {
43 u16 b0 = (l0 >> bit) & 1;
44 u16 b1 = (l1 >> bit) & 1;
45 interleaved |= (b1 << (bit * 2));
46 interleaved |= (b0 << (bit * 2 + 1));
47 }
48
49 output[symbol_idx * 2] = (u8)(interleaved >> 8);
50 output[symbol_idx * 2 + 1] = (u8)(interleaved & 0xFF);
51 }
52}

References fl::Wave3Byte::data, and fl::FL_NO_EXCEPT.

Referenced by fl::wave3Transpose_2().

+ Here is the caller graph for this function:

◆ wave3_transpose_4()

void fl::detail::wave3_transpose_4 ( const Wave3Byte lane_waves[4],
u8 output[4 *sizeof(Wave3Byte)] )

Transpose 4 lanes of Wave3Byte data.

Definition at line 55 of file wave3.cpp.hpp.

56 {
57 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
58 u8 l0 = lane_waves[0].data[symbol_idx];
59 u8 l1 = lane_waves[1].data[symbol_idx];
60 u8 l2 = lane_waves[2].data[symbol_idx];
61 u8 l3 = lane_waves[3].data[symbol_idx];
62
63 output[symbol_idx * 4 + 0] =
64 ((l3 >> 7) & 1) << 7 |
65 ((l2 >> 7) & 1) << 6 |
66 ((l1 >> 7) & 1) << 5 |
67 ((l0 >> 7) & 1) << 4 |
68 ((l3 >> 6) & 1) << 3 |
69 ((l2 >> 6) & 1) << 2 |
70 ((l1 >> 6) & 1) << 1 |
71 ((l0 >> 6) & 1);
72
73 output[symbol_idx * 4 + 1] =
74 ((l3 >> 5) & 1) << 7 |
75 ((l2 >> 5) & 1) << 6 |
76 ((l1 >> 5) & 1) << 5 |
77 ((l0 >> 5) & 1) << 4 |
78 ((l3 >> 4) & 1) << 3 |
79 ((l2 >> 4) & 1) << 2 |
80 ((l1 >> 4) & 1) << 1 |
81 ((l0 >> 4) & 1);
82
83 output[symbol_idx * 4 + 2] =
84 ((l3 >> 3) & 1) << 7 |
85 ((l2 >> 3) & 1) << 6 |
86 ((l1 >> 3) & 1) << 5 |
87 ((l0 >> 3) & 1) << 4 |
88 ((l3 >> 2) & 1) << 3 |
89 ((l2 >> 2) & 1) << 2 |
90 ((l1 >> 2) & 1) << 1 |
91 ((l0 >> 2) & 1);
92
93 output[symbol_idx * 4 + 3] =
94 ((l3 >> 1) & 1) << 7 |
95 ((l2 >> 1) & 1) << 6 |
96 ((l1 >> 1) & 1) << 5 |
97 ((l0 >> 1) & 1) << 4 |
98 ((l3 >> 0) & 1) << 3 |
99 ((l2 >> 0) & 1) << 2 |
100 ((l1 >> 0) & 1) << 1 |
101 ((l0 >> 0) & 1);
102 }
103}

References fl::Wave3Byte::data, and fl::FL_NO_EXCEPT.

Referenced by fl::wave3Transpose_4().

+ Here is the caller graph for this function:

◆ wave3_transpose_8()

void fl::detail::wave3_transpose_8 ( const Wave3Byte lane_waves[8],
u8 output[8 *sizeof(Wave3Byte)] )

Transpose 8 lanes of Wave3Byte data via the spread-LUT path (#2533).

Definition at line 106 of file wave3.cpp.hpp.

107 {
108 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
109 u8 l[8];
110 for (int lane = 0; lane < 8; lane++) {
111 l[lane] = lane_waves[lane].data[symbol_idx];
112 }
113 spread_transpose8_symbol(l, output + symbol_idx * 8);
114 }
115}
FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void spread_transpose8_symbol(const u8 l[8], u8 out[8]) FL_NO_EXCEPT
Transpose one symbol of 8 lanes (8 input bytes) into 8 output bytes: 8 pulses × 1 byte (bit L = lane ...

References fl::Wave3Byte::data, fl::FL_NO_EXCEPT, and spread_transpose8_symbol().

Referenced by fl::wave3Transpose_8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_convert_byte_to_wave8byte()

void fl::detail::wave8_convert_byte_to_wave8byte ( u8 byte_value,
const Wave8BitExpansionLut & lut,
Wave8Byte * output )

Definition at line 24 of file wave8.cpp.hpp.

26 {
27 const Wave8Bit* high_nibble_data = lut.lut[(byte_value >> 4) & 0xF];
28 isr::memcpy_32(fl::bit_cast_ptr<u32>(&output->symbols[0]),
29 fl::bit_cast_ptr<const u32>(high_nibble_data),
30 1);
31
32 const Wave8Bit* low_nibble_data = lut.lut[byte_value & 0xF];
33 isr::memcpy_32(fl::bit_cast_ptr<u32>(&output->symbols[4]),
34 fl::bit_cast_ptr<const u32>(low_nibble_data),
35 1);
36}
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memcpy_32(u32 *FL_RESTRICT_PARAM dst, const u32 *FL_RESTRICT_PARAM src, size_t count)
ISR-optimized 32-bit block copy for 4-byte aligned memory.
Definition memcpy.h:32
Type-safe container for packed 8-bit wave pulse pattern.
Definition wave8.h:23

References fl::bit_cast_ptr(), fl::FL_NO_EXCEPT, and fl::isr::memcpy_32().

Referenced by fl::wave8(), fl::wave8Transpose_16(), fl::wave8Transpose_2(), fl::wave8Transpose_4(), and fl::wave8Transpose_8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_expand_byte()

void fl::detail::wave8_expand_byte ( u8 byte_value,
const Wave8ByteExpansionLut & lut,
Wave8Byte * output )

Definition at line 39 of file wave8.cpp.hpp.

41 {
43 fl::bit_cast_ptr<const u32>(&lut.lut[byte_value]),
44 2);
45}

References fl::bit_cast_ptr(), fl::FL_NO_EXCEPT, and fl::isr::memcpy_32().

Referenced by fl::wave8Transpose_16(), fl::wave8Transpose_16x2_pipe2(), fl::wave8Transpose_16x4_pipe4(), fl::wave8Transpose_2(), fl::wave8Transpose_4(), and fl::wave8Transpose_8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_16()

void fl::detail::wave8_transpose_16 ( const Wave8Byte lane_waves[16],
u8 output[16 *sizeof(Wave8Byte)] )

Definition at line 125 of file wave8.cpp.hpp.

126 {
127 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
128 u8 l[16];
129 for (int lane = 0; lane < 16; lane++) {
130 l[lane] = lane_waves[lane].symbols[symbol_idx].data;
131 }
132 spread_transpose16_symbol(l, output + symbol_idx * 16);
133 }
134}

References fl::FL_NO_EXCEPT, and spread_transpose16_symbol().

Referenced by fl::wave8Transpose_16(), and fl::wave8Transpose_16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_16_bf1()

void fl::detail::wave8_transpose_16_bf1 ( const u8 lanes[16],
u8 W0,
u8 W1,
u8 output[16 *sizeof(Wave8Byte)] )

Definition at line 181 of file wave8.cpp.hpp.

183 {
184 u8 d_mask[8];
185 u8 m0_mask[8];
186 const u8 D_byte = W0 ^ W1;
187 for (int p = 0; p < 8; ++p) {
188 const int shift = 7 - p;
189 d_mask[p] = ((D_byte >> shift) & 1) ? 0xFFu : 0x00u;
190 m0_mask[p] = ((W0 >> shift) & 1) ? 0xFFu : 0x00u;
191 }
192 u8 cols[16];
193 spread_transpose16_symbol(lanes, cols);
194 for (int s = 0; s < 8; ++s) {
195 const u8 col_lo = cols[2 * s + 0];
196 const u8 col_hi = cols[2 * s + 1];
197 for (int p = 0; p < 8; ++p) {
198 output[s * 16 + p * 2 + 0] = m0_mask[p] ^ (col_lo & d_mask[p]);
199 output[s * 16 + p * 2 + 1] = m0_mask[p] ^ (col_hi & d_mask[p]);
200 }
201 }
202}
@ W1
White is second.
Definition eorder.h:28
@ W0
White is first.
Definition eorder.h:29

References fl::FL_NO_EXCEPT, spread_transpose16_symbol(), fl::W0, and fl::W1.

Referenced by fl::wave8Transpose_16_bf1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_16x2_pipe2()

void fl::detail::wave8_transpose_16x2_pipe2 ( const Wave8Byte lane_waves_a[16],
const Wave8Byte lane_waves_b[16],
u8 output_a[16 *sizeof(Wave8Byte)],
u8 output_b[16 *sizeof(Wave8Byte)] )

Definition at line 137 of file wave8.cpp.hpp.

140 {
141 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
142 u8 la[16];
143 u8 lb[16];
144 for (int lane = 0; lane < 16; lane++) {
145 la[lane] = lane_waves_a[lane].symbols[symbol_idx].data;
146 lb[lane] = lane_waves_b[lane].symbols[symbol_idx].data;
147 }
148 spread_transpose16_symbol(la, output_a + symbol_idx * 16);
149 spread_transpose16_symbol(lb, output_b + symbol_idx * 16);
150 }
151}

References fl::FL_NO_EXCEPT, and spread_transpose16_symbol().

Referenced by fl::wave8Transpose_16x2_pipe2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_16x4_bf1_pipe4()

void fl::detail::wave8_transpose_16x4_bf1_pipe4 ( const u8 lanes_a[16],
const u8 lanes_b[16],
const u8 lanes_c[16],
const u8 lanes_d[16],
u8 W0,
u8 W1,
u8 output_a[16 *sizeof(Wave8Byte)],
u8 output_b[16 *sizeof(Wave8Byte)],
u8 output_c[16 *sizeof(Wave8Byte)],
u8 output_d[16 *sizeof(Wave8Byte)] )

Definition at line 301 of file wave8.cpp.hpp.

309 {
310 u8 d_mask[8];
311 u8 m0_mask[8];
312 const u8 D_byte = W0 ^ W1;
313 for (int p = 0; p < 8; ++p) {
314 const int shift = 7 - p;
315 d_mask[p] = ((D_byte >> shift) & 1) ? 0xFFu : 0x00u;
316 m0_mask[p] = ((W0 >> shift) & 1) ? 0xFFu : 0x00u;
317 }
318 u8 cols_a[16], cols_b[16], cols_c[16], cols_d[16];
319 spread_transpose16_symbol(lanes_a, cols_a);
320 spread_transpose16_symbol(lanes_b, cols_b);
321 spread_transpose16_symbol(lanes_c, cols_c);
322 spread_transpose16_symbol(lanes_d, cols_d);
323 for (int s = 0; s < 8; ++s) {
324 const u8 al = cols_a[2*s + 0], ah = cols_a[2*s + 1];
325 const u8 bl = cols_b[2*s + 0], bh = cols_b[2*s + 1];
326 const u8 cl = cols_c[2*s + 0], ch = cols_c[2*s + 1];
327 const u8 dl = cols_d[2*s + 0], dh = cols_d[2*s + 1];
328 for (int p = 0; p < 8; ++p) {
329 const u8 dm = d_mask[p], mm = m0_mask[p];
330 output_a[s*16 + p*2 + 0] = mm ^ (al & dm);
331 output_a[s*16 + p*2 + 1] = mm ^ (ah & dm);
332 output_b[s*16 + p*2 + 0] = mm ^ (bl & dm);
333 output_b[s*16 + p*2 + 1] = mm ^ (bh & dm);
334 output_c[s*16 + p*2 + 0] = mm ^ (cl & dm);
335 output_c[s*16 + p*2 + 1] = mm ^ (ch & dm);
336 output_d[s*16 + p*2 + 0] = mm ^ (dl & dm);
337 output_d[s*16 + p*2 + 1] = mm ^ (dh & dm);
338 }
339 }
340}

References fl::FL_NO_EXCEPT, spread_transpose16_symbol(), fl::W0, and fl::W1.

Referenced by fl::wave8Transpose_16x4_bf1_pipe4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_16x4_pipe4()

void fl::detail::wave8_transpose_16x4_pipe4 ( const Wave8Byte lane_waves_a[16],
const Wave8Byte lane_waves_b[16],
const Wave8Byte lane_waves_c[16],
const Wave8Byte lane_waves_d[16],
u8 output_a[16 *sizeof(Wave8Byte)],
u8 output_b[16 *sizeof(Wave8Byte)],
u8 output_c[16 *sizeof(Wave8Byte)],
u8 output_d[16 *sizeof(Wave8Byte)] )

Definition at line 154 of file wave8.cpp.hpp.

161 {
162 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
163 u8 la[16];
164 u8 lb[16];
165 u8 lc[16];
166 u8 ld[16];
167 for (int lane = 0; lane < 16; lane++) {
168 la[lane] = lane_waves_a[lane].symbols[symbol_idx].data;
169 lb[lane] = lane_waves_b[lane].symbols[symbol_idx].data;
170 lc[lane] = lane_waves_c[lane].symbols[symbol_idx].data;
171 ld[lane] = lane_waves_d[lane].symbols[symbol_idx].data;
172 }
173 spread_transpose16_symbol(la, output_a + symbol_idx * 16);
174 spread_transpose16_symbol(lb, output_b + symbol_idx * 16);
175 spread_transpose16_symbol(lc, output_c + symbol_idx * 16);
176 spread_transpose16_symbol(ld, output_d + symbol_idx * 16);
177 }
178}

References fl::FL_NO_EXCEPT, and spread_transpose16_symbol().

Referenced by fl::wave8Transpose_16x4_pipe4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_2()

void fl::detail::wave8_transpose_2 ( const Wave8Byte lane_waves[2],
u8 output[2 *sizeof(Wave8Byte)] )

Definition at line 48 of file wave8.cpp.hpp.

49 {
50 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
51 u16 interleaved = 0;
52 FL_WAVE8_SPREAD_TO_16(lane_waves[0].symbols[symbol_idx].data,
53 lane_waves[1].symbols[symbol_idx].data,
54 interleaved);
55
56 output[symbol_idx * 2] = (u8)(interleaved >> 8);
57 output[symbol_idx * 2 + 1] = (u8)(interleaved & 0xFF);
58 }
59}
#define FL_WAVE8_SPREAD_TO_16(lane_u8_0, lane_u8_1, out_16)
Definition wave8.h:45

References fl::FL_NO_EXCEPT, and FL_WAVE8_SPREAD_TO_16.

Referenced by fl::wave8Transpose_2(), and fl::wave8Transpose_2().

+ Here is the caller graph for this function:

◆ wave8_transpose_2_bf1()

void fl::detail::wave8_transpose_2_bf1 ( const u8 lanes[2],
u8 W0,
u8 W1,
u8 output[2 *sizeof(Wave8Byte)] )

Definition at line 264 of file wave8.cpp.hpp.

266 {
267 u8 d_mask[8];
268 u8 m0_mask[8];
269 const u8 D_byte = W0 ^ W1;
270 for (int p = 0; p < 8; ++p) {
271 const int shift = 7 - p;
272 d_mask[p] = ((D_byte >> shift) & 1) ? 0xFFu : 0x00u;
273 m0_mask[p] = ((W0 >> shift) & 1) ? 0xFFu : 0x00u;
274 }
275 for (int s = 0; s < 8; ++s) {
276 const int bit_idx = 7 - s;
277 const u8 b0 = static_cast<u8>((lanes[0] >> bit_idx) & 1u);
278 const u8 b1 = static_cast<u8>((lanes[1] >> bit_idx) & 1u);
279 u8 byte_hi = 0;
280 u8 byte_lo = 0;
281 for (int q = 0; q < 4; ++q) {
282 const int p_hi = 3 - q;
283 const int p_lo = 7 - q;
284 const u8 m0_p_hi = static_cast<u8>(m0_mask[p_hi] & 1u);
285 const u8 d_p_hi = static_cast<u8>(d_mask[p_hi] & 1u);
286 const u8 m0_p_lo = static_cast<u8>(m0_mask[p_lo] & 1u);
287 const u8 d_p_lo = static_cast<u8>(d_mask[p_lo] & 1u);
288 const u8 v0_hi = static_cast<u8>(m0_p_hi ^ (b0 & d_p_hi));
289 const u8 v1_hi = static_cast<u8>(m0_p_hi ^ (b1 & d_p_hi));
290 const u8 v0_lo = static_cast<u8>(m0_p_lo ^ (b0 & d_p_lo));
291 const u8 v1_lo = static_cast<u8>(m0_p_lo ^ (b1 & d_p_lo));
292 byte_hi |= static_cast<u8>((v1_hi << (2 * q)) | (v0_hi << (2 * q + 1)));
293 byte_lo |= static_cast<u8>((v1_lo << (2 * q)) | (v0_lo << (2 * q + 1)));
294 }
295 output[s * 2 + 0] = byte_hi;
296 output[s * 2 + 1] = byte_lo;
297 }
298}

References fl::FL_NO_EXCEPT, fl::W0, and fl::W1.

Referenced by fl::wave8Transpose_2_bf1().

+ Here is the caller graph for this function:

◆ wave8_transpose_4()

void fl::detail::wave8_transpose_4 ( const Wave8Byte lane_waves[4],
u8 output[4 *sizeof(Wave8Byte)] )

Definition at line 62 of file wave8.cpp.hpp.

63 {
64 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
65 u8 l0 = lane_waves[0].symbols[symbol_idx].data;
66 u8 l1 = lane_waves[1].symbols[symbol_idx].data;
67 u8 l2 = lane_waves[2].symbols[symbol_idx].data;
68 u8 l3 = lane_waves[3].symbols[symbol_idx].data;
69
70 output[symbol_idx * 4 + 0] =
71 ((l3 >> 7) & 1) << 7 |
72 ((l2 >> 7) & 1) << 6 |
73 ((l1 >> 7) & 1) << 5 |
74 ((l0 >> 7) & 1) << 4 |
75 ((l3 >> 6) & 1) << 3 |
76 ((l2 >> 6) & 1) << 2 |
77 ((l1 >> 6) & 1) << 1 |
78 ((l0 >> 6) & 1);
79
80 output[symbol_idx * 4 + 1] =
81 ((l3 >> 5) & 1) << 7 |
82 ((l2 >> 5) & 1) << 6 |
83 ((l1 >> 5) & 1) << 5 |
84 ((l0 >> 5) & 1) << 4 |
85 ((l3 >> 4) & 1) << 3 |
86 ((l2 >> 4) & 1) << 2 |
87 ((l1 >> 4) & 1) << 1 |
88 ((l0 >> 4) & 1);
89
90 output[symbol_idx * 4 + 2] =
91 ((l3 >> 3) & 1) << 7 |
92 ((l2 >> 3) & 1) << 6 |
93 ((l1 >> 3) & 1) << 5 |
94 ((l0 >> 3) & 1) << 4 |
95 ((l3 >> 2) & 1) << 3 |
96 ((l2 >> 2) & 1) << 2 |
97 ((l1 >> 2) & 1) << 1 |
98 ((l0 >> 2) & 1);
99
100 output[symbol_idx * 4 + 3] =
101 ((l3 >> 1) & 1) << 7 |
102 ((l2 >> 1) & 1) << 6 |
103 ((l1 >> 1) & 1) << 5 |
104 ((l0 >> 1) & 1) << 4 |
105 ((l3 >> 0) & 1) << 3 |
106 ((l2 >> 0) & 1) << 2 |
107 ((l1 >> 0) & 1) << 1 |
108 ((l0 >> 0) & 1);
109 }
110}

References fl::FL_NO_EXCEPT.

Referenced by fl::wave8Transpose_4(), and fl::wave8Transpose_4().

+ Here is the caller graph for this function:

◆ wave8_transpose_4_bf1()

void fl::detail::wave8_transpose_4_bf1 ( const u8 lanes[4],
u8 W0,
u8 W1,
u8 output[4 *sizeof(Wave8Byte)] )

Definition at line 227 of file wave8.cpp.hpp.

229 {
230 u8 d_mask[8];
231 u8 m0_mask[8];
232 const u8 D_byte = W0 ^ W1;
233 for (int p = 0; p < 8; ++p) {
234 const int shift = 7 - p;
235 d_mask[p] = ((D_byte >> shift) & 1) ? 0xFFu : 0x00u;
236 m0_mask[p] = ((W0 >> shift) & 1) ? 0xFFu : 0x00u;
237 }
238 const u32 aLo = spreadA(lanes[0]) | (spreadA(lanes[1]) << 1)
239 | (spreadA(lanes[2]) << 2) | (spreadA(lanes[3]) << 3);
240 const u32 bLo = spreadB(lanes[0]) | (spreadB(lanes[1]) << 1)
241 | (spreadB(lanes[2]) << 2) | (spreadB(lanes[3]) << 3);
242 u8 cols[8];
243 cols[0] = static_cast<u8>(aLo);
244 cols[1] = static_cast<u8>(aLo >> 8);
245 cols[2] = static_cast<u8>(aLo >> 16);
246 cols[3] = static_cast<u8>(aLo >> 24);
247 cols[4] = static_cast<u8>(bLo);
248 cols[5] = static_cast<u8>(bLo >> 8);
249 cols[6] = static_cast<u8>(bLo >> 16);
250 cols[7] = static_cast<u8>(bLo >> 24);
251 for (int s = 0; s < 8; ++s) {
252 const u8 col = cols[s];
253 for (int k = 0; k < 4; ++k) {
254 const int p_hi = 2 * k;
255 const int p_lo = 2 * k + 1;
256 const u8 hi = static_cast<u8>((m0_mask[p_hi] & 0xF0u) ^ ((col << 4) & d_mask[p_hi]));
257 const u8 lo = static_cast<u8>((m0_mask[p_lo] & 0x0Fu) ^ (col & d_mask[p_lo]));
258 output[s * 4 + k] = static_cast<u8>(hi | lo);
259 }
260 }
261}

References fl::FL_NO_EXCEPT, spreadA(), spreadB(), fl::W0, and fl::W1.

Referenced by fl::wave8Transpose_4_bf1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_8()

void fl::detail::wave8_transpose_8 ( const Wave8Byte lane_waves[8],
u8 output[8 *sizeof(Wave8Byte)] )

Definition at line 113 of file wave8.cpp.hpp.

114 {
115 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
116 u8 l[8];
117 for (int lane = 0; lane < 8; lane++) {
118 l[lane] = lane_waves[lane].symbols[symbol_idx].data;
119 }
120 spread_transpose8_symbol(l, output + symbol_idx * 8);
121 }
122}

References fl::FL_NO_EXCEPT, and spread_transpose8_symbol().

Referenced by fl::wave8Transpose_8(), and fl::wave8Transpose_8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wave8_transpose_8_bf1()

void fl::detail::wave8_transpose_8_bf1 ( const u8 lanes[8],
u8 W0,
u8 W1,
u8 output[8 *sizeof(Wave8Byte)] )

Definition at line 205 of file wave8.cpp.hpp.

207 {
208 u8 d_mask[8];
209 u8 m0_mask[8];
210 const u8 D_byte = W0 ^ W1;
211 for (int p = 0; p < 8; ++p) {
212 const int shift = 7 - p;
213 d_mask[p] = ((D_byte >> shift) & 1) ? 0xFFu : 0x00u;
214 m0_mask[p] = ((W0 >> shift) & 1) ? 0xFFu : 0x00u;
215 }
216 u8 cols[8];
217 spread_transpose8_symbol(lanes, cols);
218 for (int s = 0; s < 8; ++s) {
219 const u8 col = cols[s];
220 for (int p = 0; p < 8; ++p) {
221 output[s * 8 + p] = m0_mask[p] ^ (col & d_mask[p]);
222 }
223 }
224}

References fl::FL_NO_EXCEPT, spread_transpose8_symbol(), fl::W0, and fl::W1.

Referenced by fl::wave8Transpose_8_bf1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xyzColumnQ16()

bool fl::detail::xyzColumnQ16 ( const i32(&) xy[2],
i32 luminance,
i64(&) column[3] )

XYZ of chromaticity xy at luminance luminance, all s16.16; false for a non-positive or out-of-simplex chromaticity or a non-positive luminance.

Definition at line 344 of file device_solve.cpp.hpp.

345 {
346 return emitterColumnQ16(xy, luminance, column);
347}
unsigned int xy(unsigned int x, unsigned int y)

References fl::FL_NO_EXCEPT, and xy().

Referenced by fl::buildBradfordMatrixQ16(), fl::buildSourceMatrixQ16(), fl::buildWhiteAllocationFromSolveQ16(), and fl::anonymous_namespace{pipeline.cpp.hpp}::wideWhiteColumnQ16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ gDitherFrame

fl::u8 fl::detail::gDitherFrame
extern

Definition at line 78 of file FastLED.cpp.hpp.

Referenced by advanceDitherFrame(), and ditherFrame().

◆ kBradford

const float fl::detail::kBradford
Initial value:
= {
{0.8951f, 0.2664f, -0.1614f},
{-0.7502f, 1.7135f, 0.0367f},
{0.0389f, -0.0685f, 1.0296f},
}

ICC linear Bradford cone-response matrix.

ICC linear Bradford cone-response matrix, and its inverse.

Declared here rather than kept file-local so the test can check the shipped constants. An earlier revision compared the solver against a copy of the numbers written into the test, which validates the copy and says nothing about the implementation – and the inverse is precomputed precisely so that nothing recomputes it, which means nothing else would notice a wrong digit either (FastLED #4043).

Same reason adaptXyzQ16 is public below: a stage that cannot be run on its own cannot be bisected when its budget misses.

Definition at line 13 of file chromatic_adaptation.cpp.hpp.

13 {
14 {0.8951f, 0.2664f, -0.1614f},
15 {-0.7502f, 1.7135f, 0.0367f},
16 {0.0389f, -0.0685f, 1.0296f},
17};

◆ kBradfordInverse

const float fl::detail::kBradfordInverse
Initial value:
= {
{0.986992955f, -0.14705427f, 0.159962654f},
{0.432305276f, 0.518360257f, 0.049291227f},
{-0.0085286675f, 0.0400428213f, 0.968486726f},
}

Its inverse, precomputed.

This used to be invert3x3(kBradford, ...) on every profile bind – a float determinant, a reciprocal, three column-scale divisions and nine multiplies, run to recompute a matrix that cannot change. The operand is a compile-time constant, so the answer is one too.

The values are what invert3x3 produces from kBradford in float32, to the last bit, so the adaptation matrix this feeds is unchanged. test_bradford_inverse_matches_the_general_solver pins that against the solver rather than against a transcription, which is what catches a typo here – a wrong digit in a plausible-looking matrix is exactly the kind of constant nothing else would notice (FastLED #4043).

Definition at line 32 of file chromatic_adaptation.cpp.hpp.

32 {
33 {0.986992955f, -0.14705427f, 0.159962654f},
34 {0.432305276f, 0.518360257f, 0.049291227f},
35 {-0.0085286675f, 0.0400428213f, 0.968486726f},
36};

◆ kBradfordInverseQ16

const i32 fl::detail::kBradfordInverseQ16
Initial value:
= {
{64684, -9637, 10483},
{28332, 33971, 3230},
{-559, 2624, 63471},
}

Definition at line 45 of file chromatic_adaptation.cpp.hpp.

45 {
46 {64684, -9637, 10483},
47 {28332, 33971, 3230},
48 {-559, 2624, 63471},
49};

Referenced by fl::buildBradfordMatrixQ16().

◆ kBradfordQ16

const i32 fl::detail::kBradfordQ16
Initial value:
= {
{58661, 17459, -10578},
{-49165, 112296, 2405},
{2549, -4489, 67476},
}

The two matrices above in s16.16, rounded from the float32 values, so the bind-time build needs no float (FastLED#4458).

The same two in s16.16, which the bind-time build uses (FastLED#4458).

Definition at line 40 of file chromatic_adaptation.cpp.hpp.

40 {
41 {58661, 17459, -10578},
42 {-49165, 112296, 2405},
43 {2549, -4489, 67476},
44};

Referenced by fl::buildBradfordMatrixQ16().

◆ kSpreadNibble

u32 fl::detail::kSpreadNibble[16]
constexpr
Initial value:
= {
0x00000000u, 0x01000000u, 0x00010000u, 0x01010000u,
0x00000100u, 0x01000100u, 0x00010100u, 0x01010100u,
0x00000001u, 0x01000001u, 0x00010001u, 0x01010001u,
0x00000101u, 0x01000101u, 0x00010101u, 0x01010101u,
}

kSpreadNibble[n] places the 4 bits of nibble n at bit 0 of 4 separate bytes: byte0 = bit3(n), byte1 = bit2(n), byte2 = bit1(n), byte3 = bit0(n).

A 16-entry literal table (C++11-valid, no constexpr loop, ~64 bytes, cache- resident). spreadA/spreadB only depend on one nibble each, so this one table serves both halves.

Definition at line 28 of file bit_spread_lut.hpp.

28 {
29 0x00000000u, 0x01000000u, 0x00010000u, 0x01010000u,
30 0x00000100u, 0x01000100u, 0x00010100u, 0x01010100u,
31 0x00000001u, 0x01000001u, 0x00010001u, 0x01010001u,
32 0x00000101u, 0x01000101u, 0x00010101u, 0x01010101u,
33};

Referenced by spreadA(), and spreadB().

◆ kTranspose2_4_LUT

u8 fl::detail::kTranspose2_4_LUT[4]
constexpr
Initial value:
= {
0x00,
0x01,
0x10,
0x11
}

4-lane LUT: Spreads 2 bits into 4-lane interleaved positions (2-bit → byte).

Definition at line 31 of file wave8.h.

31 {
32 0x00, // 0b00 → no bits set
33 0x01, // 0b01 → bit at position 0 (pulse 1)
34 0x10, // 0b10 → bit at position 4 (pulse 0)
35 0x11 // 0b11 → bits at positions 0 and 4 (both pulses)
36};

◆ kTranspose4_16_LUT

u8 fl::detail::kTranspose4_16_LUT[16]
constexpr
Initial value:
= {0x00, 0x01, 0x04, 0x05, 0x10, 0x11,
0x14, 0x15, 0x40, 0x41, 0x44, 0x45,
0x50, 0x51, 0x54, 0x55}

2-lane LUT: Spreads 4 bits into 2-lane interleaved positions (nibble → byte).

Definition at line 26 of file wave8.h.

26 {0x00, 0x01, 0x04, 0x05, 0x10, 0x11,
27 0x14, 0x15, 0x40, 0x41, 0x44, 0x45,
28 0x50, 0x51, 0x54, 0x55};