FastLED 3.9.15
Loading...
Searching...
No Matches
fl Namespace Reference

Detailed Description

IMPORTANT!

Implements a simple red square effect for 2D LED grids.

This file MUST not

Usage Example

#include <FastLED.h>
#include <fl/task.h>
void setup() {
// Create a recurring task that runs every 100ms
.then([]() {
// Task logic here
})
.catch_([](const fl::Error& e) {
// Error handling here
});
// Add task to scheduler
}
void loop() {
// Execute ready tasks
// Yield for other operations
}
void setup()
void loop()
central include file for FastLED, defines the CFastLED class/object
static Scheduler & instance()
Definition async.cpp:91
void update()
Definition async.cpp:105
int add_task(task t)
Definition async.cpp:95
task & then(function< void()> on_then)
Definition task.cpp:188
static task every_ms(int interval_ms)
Definition task.cpp:143
void async_yield()
Platform-specific async yield function.
Definition async.cpp:68
Error type for promises.
Definition promise.h:53
#define FL_TRACE
A macro to capture the current source file, line number, and time.
Definition trace.h:27

Trace System

The trace system provides source location information for debugging.

Components:

  • fl::TracePoint: A tuple of (file, line, timestamp)
  • FL_TRACE: Macro that captures current file, line, and timestamp

Namespaces

namespace  anonymous_namespace{allocator.cpp}
 
namespace  anonymous_namespace{audio.cpp}
 
namespace  anonymous_namespace{blur.cpp}
 
namespace  anonymous_namespace{corkscrew.cpp}
 
namespace  anonymous_namespace{frame_tracker.cpp}
 
namespace  anonymous_namespace{gradient.cpp}
 
namespace  anonymous_namespace{istream.cpp}
 
namespace  anonymous_namespace{line_simplification.cpp}
 
namespace  anonymous_namespace{noise_woryley.cpp}
 
namespace  anonymous_namespace{pir.cpp}
 
namespace  anonymous_namespace{rgbw.cpp}
 
namespace  anonymous_namespace{task.cpp}
 
namespace  anonymous_namespace{tile2x2.cpp}
 
namespace  anonymous_namespace{time.cpp}
 
namespace  anonymous_namespace{wave.cpp}
 
namespace  anonymous_namespace{xypath.cpp}
 
namespace  detail
 
namespace  json2
 
namespace  printf_detail
 
namespace  string_functions
 
namespace  wave_detail
 
namespace  xypath_detail
 

Classes

struct  _DrawContext
 
struct  add_pointer
 
struct  add_pointer< T & >
 
struct  add_pointer< T && >
 
struct  add_rvalue_reference
 
struct  add_rvalue_reference< T & >
 
struct  alignment_of
 
class  allocator
 
class  allocator_inlined
 
class  allocator_psram
 
class  allocator_slab
 
class  Animartrix
 
struct  AnimartrixEntry
 ################################################## Details with the implementation of Animartrix More...
 
class  ArchimedeanSpiralPath
 
class  array
 A fixed-size array implementation similar to std::array. More...
 
struct  ArrayDeleter
 
class  async_runner
 Generic asynchronous task runner interface. More...
 
class  AsyncManager
 Async task manager (singleton) More...
 
class  AtomicFake
 
struct  AudioConfig
 
struct  AudioData
 
class  AudioReactive
 
class  AudioSample
 
class  AudioSampleImpl
 
class  bitset_dynamic
 A dynamic bitset implementation that can be resized at runtime. More...
 
class  BitsetFixed
 
class  BitsetInlined
 
class  Blend2d
 
struct  Blend2dParams
 
class  Button
 
class  ButtonLowLevel
 
class  ByteStream
 
class  ByteStreamMemory
 
class  CatmullRomParams
 
class  CatmullRomPath
 Catmull–Rom spline through arbitrary points. More...
 
struct  choose_by_rank
 
struct  choose_by_signedness
 
struct  choose_by_size
 
struct  CHSV
 Representation of an HSV pixel (hue, saturation, value (aka brightness)). More...
 
union  CHSV.__unnamed0__
 
struct  CHSV.__unnamed0__.__unnamed0__
 
union  CHSV.__unnamed0__.__unnamed0__.__unnamed0__
 
union  CHSV.__unnamed0__.__unnamed0__.__unnamed1__
 
union  CHSV.__unnamed0__.__unnamed0__.__unnamed2__
 
class  CirclePath
 
class  CircularBuffer
 
struct  common_type
 
struct  common_type_impl
 
struct  common_type_impl< double, float >
 
struct  common_type_impl< double, long double >
 
struct  common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
 
struct  common_type_impl< float, double >
 
struct  common_type_impl< float, long double >
 
struct  common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
 
struct  common_type_impl< i8, u8, void >
 
struct  common_type_impl< long double, double >
 
struct  common_type_impl< long double, float >
 
struct  common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
 
struct  common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
 
struct  common_type_impl< T, T >
 
struct  common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >
 
struct  common_type_impl< u8, i8, void >
 
struct  conditional
 
struct  conditional< false, T, F >
 
struct  contains_type
 
struct  contains_type< T >
 
struct  contains_type< T, U, Rest... >
 
class  Corkscrew
 
class  Cylon
 An animation that moves a single LED back and forth (Larson Scanner effect) More...
 
struct  decay
 
struct  default_delete
 
struct  default_delete< T[]>
 
struct  DefaultValueVisitor
 
class  DemoReel100
 
class  deque
 
class  DigitalPin
 
class  DigitalPinImpl
 
struct  DrawItem
 
struct  Empty
 
struct  enable_if
 
struct  enable_if< true, T >
 
struct  endl_t
 
class  EngineEvents
 
struct  EqualTo
 
struct  Error
 Error type for promises. More...
 
class  FakeStrStream
 
struct  FastHash
 
struct  FastHash< vec2< T > >
 
class  FastLEDANIMartRIX
 
class  fetch_options
 Fetch options builder (fluent interface) More...
 
class  FetchEngineListener
 
class  FetchManager
 Internal fetch manager for promise tracking. More...
 
class  FFT
 
struct  FFT_Args
 
struct  FFTBins
 
class  FFTContext
 
class  FFTImpl
 
class  FileHandle
 
class  FileSystem
 
class  Fire2012
 
class  FixedMap
 
class  FixedVector
 
class  fl_random
 A random number generator class that wraps FastLED's random functions. More...
 
struct  FloatConversionVisitor
 
struct  FloatConversionVisitor< double >
 
class  Frame
 
class  FrameInterpolator
 
class  FrameTracker
 
class  FsImpl
 
class  function
 
class  FunctionList
 
class  FunctionList< void >
 
class  FunctionListBase
 
class  Fx
 
class  Fx1d
 
class  Fx2d
 
class  FxCompositor
 
class  FxEngine
 Manages and renders multiple visual effects (Fx) for LED strips. More...
 
class  FxLayer
 
struct  Gap
 Struct representing gap parameters for corkscrew mapping. More...
 
class  GielisCurveParams
 
class  GielisCurvePath
 
class  Gradient
 
class  GradientInlined
 
class  Grid
 
struct  has_member_swap
 
struct  Hash
 
struct  Hash< bool >
 
struct  Hash< double >
 
struct  Hash< FFT_Args >
 
struct  Hash< fl::shared_ptr< T > >
 
struct  Hash< fl::string >
 
struct  Hash< fl::u8 >
 
struct  Hash< fl::WeakPtr< T > >
 
struct  Hash< float >
 
struct  Hash< i16 >
 
struct  Hash< i32 >
 
struct  Hash< i8 >
 
struct  Hash< T * >
 
struct  Hash< u16 >
 
struct  Hash< u32 >
 
struct  Hash< vec2< T > >
 
class  HashMap
 
class  HashMapLru
 
class  HashSet
 
class  HeapVector
 
class  HeartPath
 
struct  HSV16
 
class  IdTracker
 Thread-safe ID tracker that maps void* pointers to unique integer IDs. More...
 
struct  InlinedMemoryBlock
 
class  InlinedVector
 
struct  IntConversionVisitor
 
struct  IntConversionVisitor< int64_t >
 
struct  integer_promotion_impl
 
struct  integral_constant
 
struct  is_array
 
struct  is_array< T[]>
 
struct  is_array< T[N]>
 
struct  is_base_of
 
struct  is_base_of_v_helper
 
struct  is_bitcast_compatible
 
struct  is_bitcast_compatible< const T >
 
struct  is_bitcast_compatible< T * >
 
struct  is_const
 
struct  is_const< const T >
 
struct  is_floating_point
 
struct  is_floating_point< const T >
 
struct  is_floating_point< double >
 
struct  is_floating_point< float >
 
struct  is_floating_point< long double >
 
struct  is_floating_point< T & >
 
struct  is_floating_point< volatile T >
 
struct  is_function
 
struct  is_function< Ret(Args...) const >
 
struct  is_function< Ret(Args...) const volatile >
 
struct  is_function< Ret(Args...) volatile >
 
struct  is_function< Ret(Args...)>
 
struct  is_integral
 
struct  is_integral< bool >
 
struct  is_integral< char >
 
struct  is_integral< const T >
 
struct  is_integral< int >
 
struct  is_integral< long >
 
struct  is_integral< long long >
 
struct  is_integral< short >
 
struct  is_integral< signed char >
 
struct  is_integral< T & >
 
struct  is_integral< unsigned char >
 
struct  is_integral< unsigned int >
 
struct  is_integral< unsigned long >
 
struct  is_integral< unsigned long long >
 
struct  is_integral< unsigned short >
 
struct  is_integral< volatile T >
 
struct  is_lvalue_reference
 
struct  is_lvalue_reference< T & >
 
struct  is_member_function_pointer
 
struct  is_member_function_pointer< Ret(C::*)(A...) const >
 
struct  is_member_function_pointer< Ret(C::*)(A...)>
 
struct  is_pod
 
struct  is_pod< bool >
 
struct  is_pod< char >
 
struct  is_pod< double >
 
struct  is_pod< float >
 
struct  is_pod< int >
 
struct  is_pod< long >
 
struct  is_pod< long double >
 
struct  is_pod< long long >
 
struct  is_pod< short >
 
struct  is_pod< signed char >
 
struct  is_pod< unsigned char >
 
struct  is_pod< unsigned int >
 
struct  is_pod< unsigned long >
 
struct  is_pod< unsigned long long >
 
struct  is_pod< unsigned short >
 
struct  is_pod_v_helper
 
struct  is_same
 
struct  is_same< T, T >
 
struct  is_same_v_helper
 
struct  is_signed
 
struct  is_signed< double >
 
struct  is_signed< float >
 
struct  is_signed< int >
 
struct  is_signed< long >
 
struct  is_signed< long double >
 
struct  is_signed< long long >
 
struct  is_signed< short >
 
struct  is_signed< signed char >
 
struct  is_void
 
struct  is_void< void >
 
class  istream
 
class  istream_real
 
class  Json
 
struct  JsonValue
 
class  Leds
 
class  LedsXY
 
struct  less
 Binary function object that returns whether the first argument is less than the second. More...
 
struct  less< void >
 Specialization of less for void, allowing for transparent comparisons. More...
 
struct  line_xy
 
class  LinePath
 
class  LinePathParams
 
class  LineSimplifier
 
class  LineSimplifierExact
 
class  lock_guard
 
class  Luminova
 
struct  LuminovaParams
 
class  LUT
 
class  MapRedBlackTree
 
struct  Matrix3x3f
 
class  MatrixSlice
 
struct  max_align
 
struct  max_align< T, Rest... >
 
struct  max_align<>
 
struct  max_size
 
struct  max_size< T, Rest... >
 
struct  max_size<>
 
class  MutexFake
 
class  NoisePalette
 
class  NoiseWave
 
class  NullFileHandle
 
class  NullFileSystem
 
struct  nullopt_t
 
class  ObjectFLED
 
class  Optional
 
class  ostream
 
class  Pacifica
 
struct  pair
 
struct  pair_element
 
struct  pair_element< 0, T1, T2 >
 
struct  pair_element< 1, T1, T2 >
 
struct  pair_xy
 
struct  ParseResult
 
class  PhyllotaxisParams
 
class  PhyllotaxisPath
 
class  Pir
 
class  PirLowLevel
 
struct  Pixel
 
union  Pixel.__unnamed0__
 
struct  Pixel.__unnamed0__.__unnamed0__
 
struct  PixelControllerVtable
 
class  PixelIterator
 
class  Pixels
 
class  PixelStream
 
struct  PointerDeleter
 
class  PointPath
 
class  Pride2015
 
class  PriorityQueue
 
class  promise
 Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper around a shared PromiseImpl for easy copying/sharing. More...
 
class  PSRamAllocator
 
class  Ptr
 
class  PtrTraits
 
class  queue
 A first-in, first-out (FIFO) queue container adapter. More...
 
struct  rect
 
class  RectangularDrawBuffer
 
class  RedBlackTree
 
class  RedSquare
 
class  Referent
 
struct  remove_const
 
struct  remove_const< const T >
 
struct  remove_cv
 
struct  remove_cv< const T >
 
struct  remove_cv< const volatile T >
 
struct  remove_cv< volatile T >
 
struct  remove_extent
 
struct  remove_extent< T[]>
 
struct  remove_extent< T[N]>
 
struct  remove_reference
 
struct  remove_reference< T & >
 
struct  remove_reference< T && >
 
struct  RequestOptions
 Request options (matches JavaScript fetch RequestInit) More...
 
class  response
 HTTP response class (unified interface) More...
 
class  result
 Result type for promise operations. More...
 
struct  Rgbw
 
struct  RgbwDefault
 
struct  RgbwInvalid
 
struct  RgbwWhiteIsOff
 
class  RosePath
 
class  RosePathParams
 
class  ScaleUp
 
class  Scheduler
 
class  scoped_array
 
class  scoped_array2
 
class  ScreenMap
 
class  set
 
class  SetRedBlackTree
 
class  shared_ptr
 
class  Singleton
 
class  SlabAllocator
 
class  Slice
 
class  SortedHeapMap
 
class  SortedHeapVector
 
class  SoundLevelMeter
 
class  string
 
struct  StringConversionVisitor
 
class  StringFormatter
 
class  StringHolder
 
class  StrN
 
class  StrStream
 
struct  StrStreamHelper
 
struct  StrStreamHelper< char >
 
struct  StrStreamHelper< fl::u8 >
 
struct  StrStreamHelper< int >
 
struct  StrStreamHelper< unsigned int >
 
struct  swap_impl
 
struct  swap_impl< T, false >
 
struct  swap_impl< T, true >
 
class  task
 
class  TaskImpl
 
class  ThreadLocalFake
 
class  Tile2x2_u8
 
class  Tile2x2_u8_wrap
 
class  TimeAlpha
 
class  TimeClampedTransition
 
class  TimeFunction
 
class  TimeRamp
 
class  TimeWarp
 
struct  Transform16
 
struct  TransformFloat
 
class  TransformFloatImpl
 
class  Transition
 
struct  tuple
 
struct  tuple< Head, Tail... >
 
struct  tuple<>
 
struct  tuple_element
 
struct  tuple_element< 0, pair< T1, T2 > >
 
struct  tuple_element< 0, tuple< Head, Tail... > >
 
struct  tuple_element< 1, pair< T1, T2 > >
 
struct  tuple_element< I, tuple< Head, Tail... > >
 
struct  tuple_size
 
struct  tuple_size< pair< T1, T2 > >
 
struct  tuple_size< tuple< Ts... > >
 
class  TwinkleFox
 
struct  type_rank
 
struct  type_rank< bool >
 
struct  type_rank< char >
 
struct  type_rank< double >
 
struct  type_rank< float >
 
struct  type_rank< int >
 
struct  type_rank< long >
 
struct  type_rank< long double >
 
struct  type_rank< long long >
 
struct  type_rank< short >
 
struct  type_rank< signed char >
 
struct  type_rank< unsigned char >
 
struct  type_rank< unsigned int >
 
struct  type_rank< unsigned long >
 
struct  type_rank< unsigned long long >
 
struct  type_rank< unsigned short >
 
class  UIAudio
 
class  UIAudioImpl
 
class  UIButton
 
class  UIButtonImpl
 
class  UICheckbox
 
class  UICheckboxImpl
 
class  UIDescription
 
class  UIDescriptionImpl
 
class  UIDropdown
 
class  UIDropdownImpl
 
class  UIElement
 
class  UIGroup
 
class  UIGroupImpl
 
class  UIHelp
 
class  UIHelpImpl
 
class  UINumberField
 
class  UINumberFieldImpl
 
class  UISlider
 
class  UISliderImpl
 
class  UITitle
 
class  UITitleImpl
 
class  unique_ptr
 
class  unique_ptr< T[], Deleter >
 
class  unordered_set
 
class  Variant
 
struct  vec2
 
struct  vec3
 
class  VectorSet
 
class  VectorSetFixed
 
class  Video
 
class  VideoFxWrapper
 
class  WaveCrgbGradientMap
 
class  WaveCrgbMap
 
class  WaveCrgbMapDefault
 
class  WaveFx
 
struct  WaveFxArgs
 
class  WaveSimulation1D
 
class  WaveSimulation1D_Real
 
class  WaveSimulation2D
 
class  WaveSimulation2D_Real
 
class  weak_ptr
 
class  WeakPtr
 
class  WeakReferent
 
class  XMap
 
struct  XYDrawComposited
 
struct  XYDrawGradient
 
class  XYMap
 
class  XYPath
 
class  XYPathFunction
 
class  XYPathGenerator
 
class  XYPathParams
 
class  XYPathRenderer
 
class  XYRasterSparse_CRGB
 
class  XYRasterU8Sparse
 

Typedefs

typedef u16 accum124
 no direct ANSI counterpart. 12 bits int, 4 bits fraction
 
typedef u32 accum1616
 ANSI: signed _Accum. 16 bits int, 16 bits fraction.
 
typedef u16 accum88
 ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.
 
template<typename T>
using add_pointer_t = typename add_pointer<T>::type
 
typedef void(* advanceDataFunction) (void *pixel_controller)
 
template<typename T, fl::size N>
using allocator_inlined_psram = allocator_inlined<T, N, fl::allocator_psram<T>>
 
template<typename T, fl::size N>
using allocator_inlined_slab = allocator_inlined<T, N, fl::allocator_slab<T>>
 
template<typename T, fl::size N, fl::size SLAB_SIZE = 8>
using allocator_inlined_slab_psram = allocator_inlined<T, N, fl::allocator_slab<T, SLAB_SIZE>>
 
using alpha16
 
template<typename T>
using atomic = AtomicFake<T>
 
using atomic_bool = atomic<bool>
 
using atomic_i32 = atomic<fl::i32>
 
using atomic_int = atomic<int>
 
using atomic_u32 = atomic<fl::u32>
 
using atomic_uint = atomic<unsigned int>
 
template<typename T, typename U>
using common_type_t = typename common_type<T, U>::type
 
template<bool B, typename T, typename F>
using conditional_t = typename conditional<B, T, F>::type
 
typedef fl::i64 cycle_t
 8.8 fixed point (signed) value
 
template<typename T>
using decay_t = typename decay<T>::type
 
template<typename T>
using DefaultLess = less<T>
 
typedef deque< double > deque_double
 
typedef deque< float > deque_float
 
typedef deque< int > deque_int
 
template<bool Condition, typename T = void>
using enable_if_t = typename enable_if<Condition, T>::type
 
template<typename T>
using equal_to = EqualTo<T>
 
using false_type = integral_constant<bool, false>
 
using FetchCallback = fl::function<void(const response&)>
 Callback type for simple fetch responses (backward compatible)
 
template<typename Key, size N>
using FixedSet = VectorSetFixed<Key, N>
 
template<typename Key, typename T, typename Compare = fl::less<Key>>
using fl_map = MapRedBlackTree<Key, T, Compare, fl::allocator_slab<char>>
 
typedef u16 fract16
 ANSI: unsigned _Fract.
 
typedef u32 fract32
 ANSI: unsigned long _Fract. 32 bits int, 32 bits fraction.
 
typedef u8 fract8
 Fixed-Point Fractional Types.
 
typedef void(* getHdScaleFunction) (void *pixel_controller, uint8_t *c0, uint8_t *c1, uint8_t *c2, uint8_t *brightness)
 
typedef uint8_t(* globalBrightness) (void *pixel_controller)
 
typedef bool(* hasFunction) (void *pixel_controller, int n)
 
template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = equal_to<Key>>
using hash_map = HashMap<Key, T, Hash, KeyEqual>
 
template<typename Key, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>>
using hash_set = HashSet<Key, Hash, KeyEqual>
 
typedef signed char i8
 
template<typename T>
using intrusive_ptr = fl::Ptr<T>
 
template<typename Base, typename Derived>
using is_derived = enable_if_t<is_base_of<Base, Derived>::value>
 
using JsonArray = fl::vector<fl::shared_ptr<JsonValue>>
 
using JsonObject = fl::HashMap<fl::string, fl::shared_ptr<JsonValue>>
 
typedef void(* loadAndScale_WS2816_HDFunction) (void *pixel_controller, uint16_t *b0_out, uint16_t *b1_out, uint16_t *b2_out)
 
typedef void(* loadAndScaleRGBFunction) (void *pixel_controller, uint8_t *r_out, uint8_t *g_out, uint8_t *b_out)
 
typedef void(* loadAndScaleRGBWFunction) (void *pixel_controller, Rgbw rgbw, uint8_t *b0_out, uint8_t *b1_out, uint8_t *b2_out, uint8_t *b3_out)
 
typedef LUT< u16 > LUT16
 
typedef LUT< vec2< u16 > > LUTXY16
 
typedef LUT< vec2fLUTXYFLOAT
 
typedef LUT< vec3fLUTXYZFLOAT
 
using mutex = MutexFake<void>
 
typedef decltype(nullptr) nullptr_t
 
template<typename T>
using optional = Optional<T>
 
template<typename T1, typename T2>
using Pair = pair<T1, T2>
 
using pair_xy_float = vec2<float>
 
using pair_xyz_float = vec3<float>
 
template<typename T>
using PromiseResult = result<T>
 Type alias for backwards compatibility.
 
typedef __PTRDIFF_TYPE__ ptrdiff_t
 
template<typename T>
using remove_cv_t = typename remove_cv<T>::type
 
template<typename T>
using remove_reference_t = typename remove_reference<T>::type
 
typedef void(* rgb_2_rgbw_function) (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 
typedef i32 saccum114
 no direct ANSI counterpart. 1 bit int, 14 bits fraction
 
typedef i32 saccum1516
 ANSI: signed _Accum. 15 bits int, 16 bits fraction.
 
typedef i16 saccum78
 ANSI: signed short _Accum. 7 bits int, 8 bits fraction.
 
template<typename T, typename Deleter = default_delete<T>>
using scoped_ptr = unique_ptr<T, Deleter>
 
template<typename T, fl::size N>
using set_inlined = fl::set<T, fl::allocator_inlined_slab<T, N>>
 
typedef i16 sfract15
 ANSI: signed _Fract.
 
typedef i32 sfract31
 ANSI: signed long _Fract. 31 bits int, 1 bit fraction.
 
typedef i8 sfract7
 ANSI: signed short _Fract.
 
typedef __SIZE_TYPE__ size_t
 
typedef int(* sizeFunction) (void *pixel_controller)
 
template<typename T>
using span = Slice<T>
 
using sstream = StrStream
 
typedef void(* stepDitheringFunction) (void *pixel_controller)
 
using Str = fl::string
 
template<typename T>
using ThreadLocal = ThreadLocalFake<T>
 
using TracePoint = fl::tuple<const char*, int, uint32_t>
 A structure to hold source trace information.
 
using true_type = integral_constant<bool, true>
 
typedef unsigned char u8
 
typedef unsigned int uint
 
template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = equal_to<Key>>
using unordered_map = HashMap<Key, T, Hash, KeyEqual>
 
using vec2f = vec2<float>
 
using vec2i16 = vec2<i16>
 
using vec2u8 = vec2<fl::u8>
 
using vec3f = vec3<float>
 
template<typename T, typename Allocator = fl::allocator<T>>
using vector = HeapVector<T, Allocator>
 
template<typename T, fl::size INLINED_SIZE>
using vector_fixed = FixedVector<T, INLINED_SIZE>
 
template<typename T, fl::size INLINED_SIZE = 64>
using vector_inlined = InlinedVector<T, INLINED_SIZE>
 
typedef u16(* XFunction) (u16 x, u16 length)
 
typedef u16(* XYFunction) (u16 x, u16 y, u16 width, u16 height)
 
using XYRaster = XYRasterU8Sparse
 

Enumerations

enum  { kRGBWDefaultColorTemp = 6000 }
 
enum  AnimartrixAnim {
  RGB_BLOBS5 = 0 , RGB_BLOBS4 , RGB_BLOBS3 , RGB_BLOBS2 ,
  RGB_BLOBS , POLAR_WAVES , SLOW_FADE , ZOOM2 ,
  ZOOM , HOT_BLOB , SPIRALUS2 , SPIRALUS ,
  YVES , SCALEDEMO1 , LAVA1 , CALEIDO3 ,
  CALEIDO2 , CALEIDO1 , DISTANCE_EXPERIMENT , CENTER_FIELD ,
  WAVES , CHASING_SPIRALS , ROTATING_BLOB , RINGS ,
  COMPLEX_KALEIDO , COMPLEX_KALEIDO_2 , COMPLEX_KALEIDO_3 , COMPLEX_KALEIDO_4 ,
  COMPLEX_KALEIDO_5 , COMPLEX_KALEIDO_6 , WATER , PARAMETRIC_WATER ,
  MODULE_EXPERIMENT1 , MODULE_EXPERIMENT2 , MODULE_EXPERIMENT3 , MODULE_EXPERIMENT4 ,
  MODULE_EXPERIMENT5 , MODULE_EXPERIMENT6 , MODULE_EXPERIMENT7 , MODULE_EXPERIMENT8 ,
  MODULE_EXPERIMENT9 , MODULE_EXPERIMENT10 , MODULE_EXPERIMENT_SM1 , MODULE_EXPERIMENT_SM2 ,
  MODULE_EXPERIMENT_SM3 , MODULE_EXPERIMENT_SM4 , MODULE_EXPERIMENT_SM5 , MODULE_EXPERIMENT_SM6 ,
  MODULE_EXPERIMENT_SM8 , MODULE_EXPERIMENT_SM9 , MODULE_EXPERIMENT_SM10 , NUM_ANIMATIONS
}
 
enum  ButtonStrategy { kHighLowFloating , kPullUp }
 
enum  DrawMode { DRAW_MODE_OVERWRITE , DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS }
 
enum  EaseType {
  EASE_NONE , EASE_IN_QUAD , EASE_OUT_QUAD , EASE_IN_OUT_QUAD ,
  EASE_IN_CUBIC , EASE_OUT_CUBIC , EASE_IN_OUT_CUBIC , EASE_IN_SINE ,
  EASE_OUT_SINE , EASE_IN_OUT_SINE
}
 
enum  EOrder {
  RGB =0012 , RBG =0021 , GRB =0102 , GBR =0120 ,
  BRG =0201 , BGR =0210
}
 RGB color channel orderings, used when instantiating controllers to determine what order the controller should send data out in. More...
 
enum  EOrderW {
  W3 = 0x3 , W2 = 0x2 , W1 = 0x1 , W0 = 0x0 ,
  WDefault = W3
}
 
enum  FiveBitGammaCorrectionMode { kFiveBitGammaCorrectionMode_Null = 0 , kFiveBitGammaCorrectionMode_BitShift = 1 }
 
enum  HSVHue {
  HUE_RED = 0 , HUE_ORANGE = 32 , HUE_YELLOW = 64 , HUE_GREEN = 96 ,
  HUE_AQUA = 128 , HUE_BLUE = 160 , HUE_PURPLE = 192 , HUE_PINK = 224
}
 Pre-defined hue values for CHSV objects. More...
 
enum  InsertResult { kInserted = 0 , kExists = 1 , kMaxSize = 2 }
 
enum class  leddirection { FORWARD , BACKWARD , MAP }
 
enum  RGBW_MODE {
  kRGBWInvalid , kRGBWNullWhitePixel , kRGBWExactColors , kRGBWBoostedWhite ,
  kRGBWMaxBrightness , kRGBWUserFunction
}
 
enum  SuperSample { SUPER_SAMPLE_NONE = 1 , SUPER_SAMPLE_2X = 2 , SUPER_SAMPLE_4X = 4 , SUPER_SAMPLE_8X = 8 }
 
enum class  TaskType { kEveryMs , kAtFramerate , kBeforeFrame , kAfterFrame }
 
enum  TGradientDirectionCode { FORWARD_HUES , BACKWARD_HUES , SHORTEST_HUES , LONGEST_HUES }
 Hue direction for calculating fill gradients. More...
 
enum  U8EasingFunction { WAVE_U8_MODE_LINEAR , WAVE_U8_MODE_SQRT }
 

Functions

template<typename T, typename A, typename... Args>
shared_ptr< T > allocate_shared (const A &alloc, Args &&... args)
 
void AnimartrixLoop (Animartrix &self, fl::u32 now)
 
CRGB applyGamma_video (const CRGB &orig, float gamma)
 
CRGB applyGamma_video (const CRGB &orig, float gammaR, float gammaG, float gammaB)
 
fl::u8 applyGamma_video (fl::u8 brightness, float gamma)
 
size_t async_active_tasks ()
 Get the number of active async tasks across all systems.
 
bool async_has_tasks ()
 Check if any async systems have active tasks.
 
void async_run ()
 Run all registered async tasks once.
 
void async_yield ()
 Platform-specific async yield function.
 
int available ()
 
template<typename T>
fl::result< T > await_top_level (fl::promise< T > promise)
 Synchronously wait for a promise to complete (ONLY safe in top-level contexts)
 
template<typename Container>
constexpr auto begin (const Container &c) -> decltype(c.begin())
 
template<typename Container>
constexpr auto begin (Container &c) -> decltype(c.begin())
 
template<typename T, fl::size N>
constexpr T * begin (T(&array)[N]) noexcept
 
u8 bilinearInterpolate (u8 v00, u8 v10, u8 v01, u8 v11, u16 dx, u16 dy)
 
u8 bilinearInterpolatePowerOf2 (u8 v00, u8 v10, u8 v01, u8 v11, u8 dx, u8 dy)
 
template<typename To, typename From>
To bit_cast (const From &from) noexcept
 
template<typename To>
const To * bit_cast_ptr (const void *storage) noexcept
 
template<typename To>
To * bit_cast_ptr (void *storage) noexcept
 
CHSV blend (const CHSV &p1, const CHSV &p2, fract8 amountOfP2, TGradientDirectionCode directionCode)
 
CHSVblend (const CHSV *src1, const CHSV *src2, CHSV *dest, fl::u16 count, fract8 amountOfsrc2, TGradientDirectionCode directionCode)
 
CRGB blend (const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
 
CRGBblend (const CRGB *src1, const CRGB *src2, CRGB *dest, fl::u16 count, fract8 amountOfsrc2)
 
void blur1d (CRGB *leds, fl::u16 numLeds, fract8 blur_amount)
 
void blur1d (CRGB *leds, u16 numLeds, fract8 blur_amount)
 One-dimensional blur filter.
 
void blur2d (CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount) FASTLED_DEPRECATED("Use blur2d(...
 Legacy version of blur2d, which does not require an XYMap but instead implicitly binds to XY() function.
 
void blur2d (CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const fl::XYMap &xymap)
 Two-dimensional blur filter.
 
void blurColumns (CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const fl::XYMap &xymap)
 Perform a blur1d() on every column of a rectangular matrix.
 
void blurRows (CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const fl::XYMap &xymap)
 Perform a blur1d() on every row of a rectangular matrix.
 
constexpr fl::u16 calculateCorkscrewHeight (float totalTurns, fl::u16 numLeds)
 
constexpr fl::u16 calculateCorkscrewWidth (float totalTurns, fl::u16 numLeds)
 
template<typename T>
ceil (T value)
 
constexpr int ceil_constexpr (float value)
 
istream_realcin_real ()
 
template<typename T>
FASTLED_FORCE_INLINEclamp (T value, T min, T max)
 
template<typename Container>
void clear (Container &container)
 
template<int N>
void clear (CRGB(&arr)[N])
 
template<typename T>
void clear (Grid< T > &grid)
 
void clear (Leds &leds)
 
template<fl::size W, fl::size H>
void clear (LedsXY< W, H > &leds)
 
CHSV ColorFromPalette (const CHSVPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
 
CHSV ColorFromPalette (const CHSVPalette256 &pal, fl::u8 index, fl::u8 brightness, TBlendType)
 
CHSV ColorFromPalette (const CHSVPalette32 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
 
CRGB ColorFromPalette (const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
 
CRGB ColorFromPalette (const CRGBPalette256 &pal, fl::u8 index, fl::u8 brightness, TBlendType)
 
CRGB ColorFromPalette (const CRGBPalette32 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
 
CRGB ColorFromPalette (const TProgmemRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
 
CRGB ColorFromPalette (const TProgmemRGBPalette32 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
 
CRGB ColorFromPaletteExtended (const CRGBPalette16 &pal, fl::u16 index, fl::u8 brightness, TBlendType blendType)
 
CRGB ColorFromPaletteExtended (const CRGBPalette256 &pal, fl::u16 index, fl::u8 brightness, TBlendType blendType)
 
CRGB ColorFromPaletteExtended (const CRGBPalette32 &pal, fl::u16 index, fl::u8 brightness, TBlendType blendType)
 
template<typename T, typename Y>
shared_ptr< T > const_pointer_cast (const shared_ptr< Y > &other) noexcept
 
static FASTLED_FORCE_INLINE i16 cos16lut (u16 angle)
 
static FASTLED_FORCE_INLINE i32 cos32 (u32 angle)
 
template<typename T>
add_rvalue_reference< T >::type declval () noexcept
 
fl_randomdefault_random ()
 Global default random number generator instance.
 
void downscale (const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY)
 
void downscaleArbitrary (const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY)
 
void downscaleHalf (const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY)
 
void downscaleHalf (const CRGB *src, fl::u16 srcWidth, fl::u16 srcHeight, CRGB *dst)
 
void drawSquare (void *, uint16_t, uint16_t, int, int, uint32_t, uint32_t)
 
void ease16 (EaseType type, u16 *src, u16 *dst, u16 count)
 
u16 ease16 (EaseType type, u16 i)
 
void ease8 (EaseType type, u8 *src, u8 *dst, u8 count)
 
u8 ease8 (EaseType type, u8 i)
 
u16 easeInCubic16 (u16 i)
 16-bit cubic ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeInCubic8 (u8 i)
 8-bit cubic ease-in function Takes an input value 0-255 and returns an eased value 0-255 More pronounced acceleration than quadratic
 
u16 easeInOutCubic16 (u16 i)
 16-bit cubic ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeInOutCubic8 (u8 i)
 8-bit cubic ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 More pronounced easing curve than quadratic
 
u16 easeInOutQuad16 (u16 i)
 16-bit quadratic ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeInOutQuad8 (u8 i)
 8-bit quadratic ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 The curve starts slow, accelerates in the middle, then slows down again
 
u16 easeInOutSine16 (u16 i)
 16-bit sine ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeInOutSine8 (u8 i)
 8-bit sine ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinusoidal acceleration and deceleration
 
u16 easeInQuad16 (u16 i)
 16-bit quadratic ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeInQuad8 (u8 i)
 8-bit quadratic ease-in function Takes an input value 0-255 and returns an eased value 0-255 The curve starts slow and accelerates (ease-in only)
 
u16 easeInSine16 (u16 i)
 16-bit sine ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeInSine8 (u8 i)
 8-bit sine ease-in function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinusoidal acceleration
 
u16 easeOutCubic16 (u16 i)
 16-bit cubic ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeOutCubic8 (u8 i)
 8-bit cubic ease-out function Takes an input value 0-255 and returns an eased value 0-255 More pronounced deceleration than quadratic
 
u16 easeOutQuad16 (u16 i)
 16-bit quadratic ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeOutQuad8 (u8 i)
 8-bit quadratic ease-out function Takes an input value 0-255 and returns an eased value 0-255 The curve starts fast and decelerates (ease-out only)
 
u16 easeOutSine16 (u16 i)
 16-bit sine ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
 
u8 easeOutSine8 (u8 i)
 8-bit sine ease-out function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinusoidal deceleration
 
template<typename Container>
constexpr auto end (const Container &c) -> decltype(c.end())
 
template<typename Container>
constexpr auto end (Container &c) -> decltype(c.end())
 
template<typename T, fl::size N>
constexpr T * end (T(&array)[N]) noexcept
 
template<typename Iterator1, typename Iterator2>
bool equal (Iterator1 first1, Iterator1 last1, Iterator2 first2)
 
template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
bool equal (Iterator1 first1, Iterator1 last1, Iterator2 first2, BinaryPredicate pred)
 
template<typename Iterator1, typename Iterator2>
bool equal (Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
 
template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
bool equal (Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2, BinaryPredicate pred)
 
template<typename Container1, typename Container2>
bool equal_container (const Container1 &c1, const Container2 &c2)
 
template<typename Container1, typename Container2, typename BinaryPredicate>
bool equal_container (const Container1 &c1, const Container2 &c2, BinaryPredicate pred)
 
fl::promise< responseexecute_fetch_request (const fl::string &url, const fetch_options &request)
 Internal helper to execute a fetch request and return a promise.
 
template<typename T>
exp (T value)
 
void fade_raw (CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
 
void fade_video (CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
 
void fadeLightBy (CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
 
void fadeToBlackBy (CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
 
void fadeToColorBy (void *, uint16_t, uint32_t, uint8_t)
 
void fadeUsingColor (CRGB *leds, fl::u16 numLeds, const CRGB &colormask)
 
static u32 fast_hash32 (u32 x) noexcept
 
static u32 fast_hash64 (u64 x) noexcept
 
const char * fastled_file_offset (const char *file)
 
 FASTLED_SMART_PTR (Animartrix)
 
 FASTLED_SMART_PTR (ArchimedeanSpiralPath)
 
 FASTLED_SMART_PTR (AudioSampleImpl)
 
 FASTLED_SMART_PTR (Blend2d)
 
 FASTLED_SMART_PTR (ByteStream)
 
 FASTLED_SMART_PTR (ByteStreamMemory)
 
 FASTLED_SMART_PTR (CatmullRomParams)
 
 FASTLED_SMART_PTR (CatmullRomPath)
 
 FASTLED_SMART_PTR (CirclePath)
 
 FASTLED_SMART_PTR (Cylon)
 
 FASTLED_SMART_PTR (DemoReel100)
 
 FASTLED_SMART_PTR (DigitalPinImpl)
 
 FASTLED_SMART_PTR (FileHandle)
 
 FASTLED_SMART_PTR (FileSystem)
 
 FASTLED_SMART_PTR (Fire2012)
 Simple one-dimensional fire animation function.
 
 FASTLED_SMART_PTR (Frame)
 
 FASTLED_SMART_PTR (FrameInterpolator)
 
 FASTLED_SMART_PTR (FsImpl)
 
 FASTLED_SMART_PTR (Fx)
 
 FASTLED_SMART_PTR (Fx2d)
 
 FASTLED_SMART_PTR (FxLayer)
 
 FASTLED_SMART_PTR (GielisCurvePath)
 
 FASTLED_SMART_PTR (HeartPath)
 
 FASTLED_SMART_PTR (LinePath)
 
 FASTLED_SMART_PTR (LinePathParams)
 
 FASTLED_SMART_PTR (Luminova)
 
 FASTLED_SMART_PTR (NoisePalette)
 
 FASTLED_SMART_PTR (NoiseWave)
 
 FASTLED_SMART_PTR (Pacifica)
 
 FASTLED_SMART_PTR (PhyllotaxisPath)
 
 FASTLED_SMART_PTR (PixelStream)
 
 FASTLED_SMART_PTR (PointPath)
 
 FASTLED_SMART_PTR (Pride2015)
 
 FASTLED_SMART_PTR (RedSquare)
 
 FASTLED_SMART_PTR (RosePath)
 
 FASTLED_SMART_PTR (RosePathParams)
 
 FASTLED_SMART_PTR (ScaleUp)
 
 FASTLED_SMART_PTR (StringHolder)
 
 FASTLED_SMART_PTR (TimeFunction)
 
 FASTLED_SMART_PTR (TimeWarp)
 
 FASTLED_SMART_PTR (TransformFloatImpl)
 
 FASTLED_SMART_PTR (TwinkleFox)
 
 FASTLED_SMART_PTR (VideoFxWrapper)
 
 FASTLED_SMART_PTR (VideoImpl)
 
 FASTLED_SMART_PTR (WaveCrgbGradientMap)
 
 FASTLED_SMART_PTR (WaveCrgbMap)
 
 FASTLED_SMART_PTR (WaveCrgbMapDefault)
 
 FASTLED_SMART_PTR (WaveFx)
 
 FASTLED_SMART_PTR (XYPath)
 
 FASTLED_SMART_PTR (XYPathFunction)
 
 FASTLED_SMART_PTR (XYPathGenerator)
 
 FASTLED_SMART_PTR (XYPathRenderer)
 
 FASTLED_SMART_PTR_NO_FWD (LUT16)
 
 FASTLED_SMART_PTR_NO_FWD (LUTXY16)
 
 FASTLED_SMART_PTR_NO_FWD (LUTXYFLOAT)
 
 FASTLED_SMART_PTR_NO_FWD (LUTXYZFLOAT)
 
 FASTLED_UI_DEFINE_OPERATORS (UIButton)
 
 FASTLED_UI_DEFINE_OPERATORS (UICheckbox)
 
 FASTLED_UI_DEFINE_OPERATORS (UIDropdown)
 
 FASTLED_UI_DEFINE_OPERATORS (UINumberField)
 
 FASTLED_UI_DEFINE_OPERATORS (UISlider)
 
void fetch (const char *url, const FetchCallback &callback)
 Make an HTTP GET request with URL string literal (cross-platform)
 
void fetch (const fl::string &url, const FetchCallback &callback)
 Make an HTTP GET request (cross-platform, backward compatible)
 
fl::size fetch_active_requests ()
 Get number of active requests.
 
fl::promise< responsefetch_delete (const fl::string &url, const fetch_options &request=fetch_options(""))
 HTTP DELETE request.
 
fl::promise< responsefetch_get (const fl::string &url, const fetch_options &request=fetch_options(""))
 HTTP GET request.
 
fl::promise< responsefetch_head (const fl::string &url, const fetch_options &request=fetch_options(""))
 HTTP HEAD request.
 
fl::promise< responsefetch_http_options (const fl::string &url, const fetch_options &request=fetch_options(""))
 HTTP OPTIONS request.
 
fl::promise< responsefetch_patch (const fl::string &url, const fetch_options &request=fetch_options(""))
 HTTP PATCH request.
 
fl::promise< responsefetch_post (const fl::string &url, const fetch_options &request=fetch_options(""))
 HTTP POST request.
 
fl::promise< responsefetch_put (const fl::string &url, const fetch_options &request=fetch_options(""))
 HTTP PUT request.
 
fl::promise< responsefetch_request (const fl::string &url, const RequestOptions &options=RequestOptions())
 Generic request with options (like fetch(url, options))
 
void fetch_update ()
 Legacy manual update for fetch promises (use fl::async_run() for new code)
 
template<typename Iterator, typename T>
void fill (Iterator first, Iterator last, const T &value)
 
template<typename T>
void fill_gradient (T *targetArray, u16 numLeds, const CHSV &c1, const CHSV &c2, const CHSV &c3, const CHSV &c4, TGradientDirectionCode directionCode=SHORTEST_HUES)
 Fill a range of LEDs with a smooth HSV gradient between four HSV colors.
 
template<typename T>
void fill_gradient (T *targetArray, u16 numLeds, const CHSV &c1, const CHSV &c2, const CHSV &c3, TGradientDirectionCode directionCode=SHORTEST_HUES)
 Fill a range of LEDs with a smooth HSV gradient between three HSV colors.
 
template<typename T>
void fill_gradient (T *targetArray, u16 numLeds, const CHSV &c1, const CHSV &c2, TGradientDirectionCode directionCode=SHORTEST_HUES)
 Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
 
template<typename T>
void fill_gradient (T *targetArray, u16 startpos, CHSV startcolor, u16 endpos, CHSV endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES)
 Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
 
void fill_gradient_RGB (CRGB *leds, u16 numLeds, const CRGB &c1, const CRGB &c2)
 Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
 
void fill_gradient_RGB (CRGB *leds, u16 numLeds, const CRGB &c1, const CRGB &c2, const CRGB &c3)
 Fill a range of LEDs with a smooth RGB gradient between three RGB colors.
 
void fill_gradient_RGB (CRGB *leds, u16 numLeds, const CRGB &c1, const CRGB &c2, const CRGB &c3, const CRGB &c4)
 Fill a range of LEDs with a smooth RGB gradient between four RGB colors.
 
void fill_gradient_RGB (CRGB *leds, u16 startpos, CRGB startcolor, u16 endpos, CRGB endcolor)
 Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
 
void fill_rainbow (struct CHSV *targetArray, int numToFill, fl::u8 initialhue, fl::u8 deltahue=5)
 Fill a range of LEDs with a rainbow of colors.
 
void fill_rainbow (struct CRGB *targetArray, int numToFill, fl::u8 initialhue, fl::u8 deltahue=5)
 Fill a range of LEDs with a rainbow of colors.
 
void fill_rainbow_circular (struct CHSV *targetArray, int numToFill, fl::u8 initialhue, bool reversed=false)
 Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning.
 
void fill_rainbow_circular (struct CRGB *targetArray, int numToFill, fl::u8 initialhue, bool reversed=false)
 Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning.
 
void fill_solid (struct CHSV *targetArray, int numToFill, const struct CHSV &color)
 Fill a range of LEDs with a solid color.
 
void fill_solid (struct CRGB *targetArray, int numToFill, const struct CRGB &color)
 Fill a range of LEDs with a solid color.
 
template<typename Iterator, typename T>
Iterator find (Iterator first, Iterator last, const T &value)
 
template<typename Iterator, typename UnaryPredicate>
Iterator find_if (Iterator first, Iterator last, UnaryPredicate pred)
 
template<typename Iterator, typename UnaryPredicate>
Iterator find_if_not (Iterator first, Iterator last, UnaryPredicate pred)
 
void five_bit_bitshift (u16 r16, u16 g16, u16 b16, fl::u8 brightness, CRGB *out, fl::u8 *out_power_5bit)
 
void five_bit_bitshift (uint16_t r16, uint16_t g16, uint16_t b16, uint8_t brightness, CRGB *out, uint8_t *out_power_5bit)
 
void five_bit_hd_gamma_bitshift (CRGB colors, CRGB colors_scale, fl::u8 global_brightness, CRGB *out_colors, fl::u8 *out_power_5bit)
 
void five_bit_hd_gamma_function (CRGB color, u16 *r16, u16 *g16, u16 *b16)
 
template<typename T>
fl_abs (T value)
 
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING (sign-compare) FL_DISABLE_WARNING_FLOAT_CONVERSION FL_DISABLE_WARNING_SIGN_CONVERSION FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION FL_DISABLE_WARNING_FLOAT_CONVERSION template< typename T
 
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING (unused-function) static bool canBeRepresentedAsFloat(double value)
 
template<typename T, typename U>
common_type_t< T, U > fl_max (T a, U b)
 
FL_DISABLE_WARNING_PUSH U common_type_t< T, U > fl_min (T a, U b)
 
template<typename T>
floor (T value)
 
template<typename T>
constexpr T && forward (typename remove_reference< T >::type &&t) noexcept
 
template<typename T>
constexpr T && forward (typename remove_reference< T >::type &t) noexcept
 
void Free (void *ptr)
 
void gamma16 (const CRGB &rgb, u16 *r16, u16 *g16, u16 *b16)
 
template<fl::size I, typename T1, typename T2>
const pair_element< I, T1, T2 >::type & get (const pair< T1, T2 > &p) noexcept
 
template<typename T, typename T1, typename T2>
const T & get (const pair< T1, T2 > &p) noexcept
 
template<size_t I, typename Head, typename... Tail>
enable_if< I==0, constHead & >::type get (const tuple< Head, Tail... > &t)
 
template<size_t I, typename Head, typename... Tail>
enable_if< I!=0, consttypenametuple_element< I, tuple< Head, Tail... > >::type & >::type get (const tuple< Head, Tail... > &t)
 
template<fl::size I, typename T1, typename T2>
pair_element< I, T1, T2 >::type && get (pair< T1, T2 > &&p) noexcept
 
template<typename T, typename T1, typename T2>
T && get (pair< T1, T2 > &&p) noexcept
 
template<fl::size I, typename T1, typename T2>
pair_element< I, T1, T2 >::type & get (pair< T1, T2 > &p) noexcept
 
template<typename T, typename T1, typename T2>
T & get (pair< T1, T2 > &p) noexcept
 
template<size_t I, typename Head, typename... Tail>
enable_if< I==0, Head && >::type get (tuple< Head, Tail... > &&t)
 
template<size_t I, typename Head, typename... Tail>
enable_if< I!=0, typenametuple_element< I, tuple< Head, Tail... > >::type && >::type get (tuple< Head, Tail... > &&t)
 
template<size_t I, typename Head, typename... Tail>
enable_if< I==0, Head & >::type get (tuple< Head, Tail... > &t)
 
template<size_t I, typename Head, typename... Tail>
enable_if< I!=0, typenametuple_element< I, tuple< Head, Tail... > >::type & >::type get (tuple< Head, Tail... > &t)
 
JsonObjectget_empty_json_object ()
 
FL_DISABLE_WARNING_POP JsonValueget_null_value ()
 
fl::string getAnimartrixName (int animation)
 
static u32 hash_pair (u32 a, u32 b, u32 seed=0) noexcept
 
CRGB HeatColor (fl::u8 temperature)
 
static CRGB HSV16toRGB (const HSV16 &hsv)
 
template<typename T>
T * int_to_ptr (uptr value) noexcept
 
void internal_builtin_five_bit_hd_gamma_bitshift (CRGB colors, CRGB colors_scale, fl::u8 global_brightness, CRGB *out_colors, fl::u8 *out_power_5bit)
 
template<typename F, typename... Args>
auto invoke (F &&f, Args &&... args) -> enable_if_t<!is_member_function_pointer< typename remove_reference< F >::type >::value &&!detail::is_member_data_pointer< typename remove_reference< F >::type >::value, decltype(fl::forward< F >(f)(fl::forward< Args >(args)...))>
 
template<typename F, typename T1>
auto invoke (F &&f, T1 &&t1) -> enable_if_t< detail::is_member_data_pointer< typename remove_reference< F >::type >::value &&!detail::use_pointer_syntax< T1 >::value, decltype(fl::forward< T1 >(t1).*f)>
 
template<typename F, typename T1, typename... Args>
auto invoke (F &&f, T1 &&t1, Args &&... args) -> enable_if_t< is_member_function_pointer< typename remove_reference< F >::type >::value &&!detail::use_pointer_syntax< T1 >::value, decltype((fl::forward< T1 >(t1).*f)(fl::forward< Args >(args)...))>
 
fl::vector< float > jsonArrayToFloatVector (const fl::Json &jsonArray)
 
fl::u8 lsrX4 (fl::u8 dividend)
 Helper function to divide a number by 16, aka four logical shift right (LSR)'s.
 
template<typename T>
result< T > make_error (const char *message)
 Helper function to create an error result from C-string.
 
template<typename T>
result< T > make_error (const Error &error)
 Helper function to create an error result.
 
template<typename T>
result< T > make_error (const fl::string &message)
 Helper function to create an error result from string.
 
template<typename T>
result< T > make_error (Error &&error)
 Helper function to create an error result (move)
 
template<typename T, typename... Args>
intrusive_ptr< T > make_intrusive (Args &&... args)
 
template<typename T>
optional< T > make_optional (const T &value)
 
template<typename T>
optional< T > make_optional (T &&value)
 
template<typename T1, typename T2>
pair< typename fl::decay< T1 >::type, typename fl::decay< T2 >::type > make_pair (T1 &&t, T2 &&u)
 
template<typename T>
promise< T > make_rejected_promise (const char *error_message)
 Convenience function to create a rejected promise (const char* overload)
 
template<typename T>
promise< T > make_rejected_promise (const fl::string &error_message)
 Convenience function to create a rejected promise.
 
template<typename T>
promise< T > make_resolved_promise (T value)
 Convenience function to create a resolved promise.
 
FsImplPtr make_sdcard_filesystem (int cs_pin)
 
template<typename T, typename... Args>
shared_ptr< T > make_shared (Args &&... args)
 
template<typename T>
shared_ptr< T > make_shared_no_tracking (T &obj)
 
template<typename T, typename... Args>
fl::shared_ptr< T > make_shared_ptr (Args &&... args)
 
template<typename T, typename Deleter, typename... Args>
shared_ptr< T > make_shared_with_deleter (Deleter d, Args &&... args)
 
template<typename T>
result< T > make_success (const T &value)
 Helper function to create a successful result.
 
template<typename T>
result< T > make_success (T &&value)
 Helper function to create a successful result (move)
 
template<typename... Ts>
tuple< typename fl::decay< Ts >::type... > make_tuple (Ts &&... args)
 
template<typename T, typename... Args>
fl::enable_if<!fl::is_array< T >::value, unique_ptr< T > >::type make_unique (Args &&... args)
 
template<typename T>
fl::enable_if< fl::is_array< T >::value, unique_ptr< T > >::type make_unique (fl::size_t size)
 
void * Malloc (fl::size size)
 
template<typename Iterator>
Iterator max_element (Iterator first, Iterator last)
 
template<typename Iterator, typename Compare>
Iterator max_element (Iterator first, Iterator last, Compare comp)
 
void * memcopy (void *dst, const void *src, fl::size num)
 
template<typename T>
void * memfill (T *ptr, int value, fl::size num)
 
void * memfill (void *ptr, int value, fl::size num)
 
template<typename Iterator>
Iterator min_element (Iterator first, Iterator last)
 
template<typename Iterator, typename Compare>
Iterator min_element (Iterator first, Iterator last, Compare comp)
 
template<typename T>
constexpr remove_reference< T >::type && move (T &&t) noexcept
 
static u32 MurmurHash3_x86_32 (const void *key, fl::size len, u32 seed=0)
 
CRGBnapplyGamma_video (CRGB &rgb, float gamma)
 
CRGBnapplyGamma_video (CRGB &rgb, float gammaR, float gammaG, float gammaB)
 
void napplyGamma_video (CRGB *rgbarray, fl::u16 count, float gamma)
 
void napplyGamma_video (CRGB *rgbarray, fl::u16 count, float gammaR, float gammaG, float gammaB)
 
CHSVnblend (CHSV &existing, const CHSV &overlay, fract8 amountOfOverlay, TGradientDirectionCode directionCode)
 
void nblend (CHSV *existing, const CHSV *overlay, fl::u16 count, fract8 amountOfOverlay, TGradientDirectionCode directionCode)
 
CRGBnblend (CRGB &existing, const CRGB &overlay, fract8 amountOfOverlay)
 
void nblend (CRGB *existing, const CRGB *overlay, fl::u16 count, fract8 amountOfOverlay)
 
void nblendPaletteTowardPalette (CRGBPalette16 &current, CRGBPalette16 &target, fl::u8 maxChanges)
 
template<typename T, typename... Args>
Ptr< T > NewPtr (Args... args)
 
template<typename T, typename... Args>
Ptr< T > NewPtrNoTracking (Args... args)
 
template<typename T>
Ptr< T > NewPtrNoTracking (T &obj)
 
void nscale8 (CRGB *leds, fl::u16 num_leds, fl::u8 scale)
 
void nscale8_video (CRGB *leds, fl::u16 num_leds, fl::u8 scale)
 
template<typename T, fl::size N>
bool operator!= (const array< T, N > &lhs, const array< T, N > &rhs)
 
template<typename T1, typename T2, typename U1, typename U2>
bool operator!= (const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
 
template<typename T, typename Y>
bool operator!= (const shared_ptr< T > &lhs, const shared_ptr< Y > &rhs) noexcept
 
template<typename T>
bool operator!= (const shared_ptr< T > &lhs, fl::nullptr_t) noexcept
 
template<typename T, typename Deleter>
bool operator!= (const unique_ptr< T, Deleter > &ptr, fl::nullptr_t) noexcept
 
template<typename T1, typename Deleter1, typename T2, typename Deleter2>
bool operator!= (const unique_ptr< T1, Deleter1 > &lhs, const unique_ptr< T2, Deleter2 > &rhs)
 
template<typename T>
bool operator!= (fl::nullptr_t, const shared_ptr< T > &rhs) noexcept
 
template<typename T, typename Deleter>
bool operator!= (fl::nullptr_t, const unique_ptr< T, Deleter > &ptr) noexcept
 
string operator+ (const char *lhs, const string &rhs)
 
template<typename T>
string operator+ (const char *lhs, const T &rhs)
 
string operator+ (const string &lhs, const char *rhs)
 
string operator+ (const string &lhs, const string &rhs)
 
template<typename T>
string operator+ (const string &lhs, const T &rhs)
 
template<typename T>
string operator+ (const T &lhs, const char *rhs)
 
template<typename T>
string operator+ (const T &lhs, const string &rhs)
 
template<typename T1, typename T2, typename U1, typename U2>
bool operator< (const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
 
template<typename T, typename Y>
bool operator< (const shared_ptr< T > &lhs, const shared_ptr< Y > &rhs) noexcept
 
ostreamoperator<< (ostream &os, const endl_t &)
 
template<typename T1, typename T2, typename U1, typename U2>
bool operator<= (const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
 
template<typename T, typename Y>
bool operator<= (const shared_ptr< T > &lhs, const shared_ptr< Y > &rhs) noexcept
 
template<typename T, fl::size N>
bool operator== (const array< T, N > &lhs, const array< T, N > &rhs)
 
template<typename T1, typename T2, typename U1, typename U2>
bool operator== (const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
 
template<typename T, typename Y>
bool operator== (const shared_ptr< T > &lhs, const shared_ptr< Y > &rhs) noexcept
 
template<typename T>
bool operator== (const shared_ptr< T > &lhs, fl::nullptr_t) noexcept
 
template<typename T, typename Deleter>
bool operator== (const unique_ptr< T, Deleter > &ptr, fl::nullptr_t) noexcept
 
template<typename T1, typename Deleter1, typename T2, typename Deleter2>
bool operator== (const unique_ptr< T1, Deleter1 > &lhs, const unique_ptr< T2, Deleter2 > &rhs)
 
template<typename T>
bool operator== (fl::nullptr_t, const shared_ptr< T > &rhs) noexcept
 
template<typename T, typename Deleter>
bool operator== (fl::nullptr_t, const unique_ptr< T, Deleter > &ptr) noexcept
 
template<typename T1, typename T2, typename U1, typename U2>
bool operator> (const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
 
template<typename T, typename Y>
bool operator> (const shared_ptr< T > &lhs, const shared_ptr< Y > &rhs) noexcept
 
template<typename T1, typename T2, typename U1, typename U2>
bool operator>= (const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
 
template<typename T, typename Y>
bool operator>= (const shared_ptr< T > &lhs, const shared_ptr< Y > &rhs) noexcept
 
template<typename Iterator>
void pop_heap (Iterator first, Iterator last)
 
template<typename Iterator, typename Compare>
void pop_heap (Iterator first, Iterator last, Compare comp)
 
void print (const char *str)
 
template<typename... Args>
void printf (const char *format, const Args &... args)
 Printf-like formatting function that prints directly to the platform output.
 
void println (const char *str)
 
void * PSRamAllocate (fl::size size, bool zero)
 
void PSRamDeallocate (void *ptr)
 
template<typename T>
uptr ptr_to_int (T *ptr) noexcept
 
template<typename Iterator>
void push_heap (Iterator first, Iterator last)
 
template<typename Iterator, typename Compare>
void push_heap (Iterator first, Iterator last, Compare comp)
 
int read ()
 
template<typename T, typename Y>
shared_ptr< T > reinterpret_pointer_cast (const shared_ptr< Y > &other) noexcept
 
template<typename Iterator, typename T>
Iterator remove (Iterator first, Iterator last, const T &value)
 
template<typename Iterator, typename UnaryPredicate>
Iterator remove_if (Iterator first, Iterator last, UnaryPredicate pred)
 
template<typename Iterator>
void reverse (Iterator first, Iterator last)
 
FASTLED_FORCE_INLINE void rgb_2_rgbw (RGBW_MODE mode, uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 Converts RGB to RGBW using one of the functions.
 
template<RGBW_MODE MODE>
FASTLED_FORCE_INLINE void rgb_2_rgbw (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 
void rgb_2_rgbw_exact (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 Converts RGB to RGBW using a color transfer method from saturated color channels to white.
 
void rgb_2_rgbw_max_brightness (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 The minimum brigthness of the RGB channels is used to set the W channel.
 
void rgb_2_rgbw_null_white_pixel (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 Converts RGB to RGBW with the W channel set to black, always.
 
void rgb_2_rgbw_user_function (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 
void rgb_2_rgbw_white_boosted (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
 Converts RGB to RGBW with a boosted white channel.
 
static HSV16 RGBtoHSV16 (const CRGB &rgb)
 
void rgbw_partial_reorder (EOrderW w_placement, uint8_t b0, uint8_t b1, uint8_t b2, uint8_t w, uint8_t *out_b0, uint8_t *out_b1, uint8_t *out_b2, uint8_t *out_b3)
 
static u16 scale8_to_16_accurate (u8 x)
 
fl::string serializeValue (const JsonValue &value)
 
void set_rgb_2_rgbw_function (rgb_2_rgbw_function func)
 
void SetPSRamAllocator (void *(*alloc)(fl::size), void(*free)(void *))
 
template<typename Iterator>
void shuffle (Iterator first, Iterator last)
 
template<typename Iterator>
void shuffle (Iterator first, Iterator last, fl_random &rng)
 
template<typename Iterator, typename RandomGenerator>
void shuffle (Iterator first, Iterator last, RandomGenerator &g)
 
template<typename Iterator, typename Compare>
void sift_down (Iterator first, Iterator last, Iterator start, Compare comp)
 
static FASTLED_FORCE_INLINE i16 sin16lut (u16 angle)
 
static FASTLED_FORCE_INLINE i32 sin32 (u32 angle)
 
template<typename... Args>
int snprintf (char *buffer, fl::size size, const char *format, const Args &... args)
 Snprintf-like formatting function that writes to a buffer.
 
template<typename Iterator>
void sort (Iterator first, Iterator last)
 
template<typename Iterator, typename Compare>
void sort (Iterator first, Iterator last, Compare comp)
 
Tile2x2_u8 splat (vec2f xy)
 "Splat" as in "splat pixel rendering" takes a pixel value in float x,y coordinates and "splats" it into a 2x2 tile of pixel values.
 
template<fl::size N, typename... Args>
int sprintf (char(&buffer)[N], const char *format, const Args &... args)
 Sprintf-like formatting function that writes to a buffer.
 
template<typename Iterator>
void stable_sort (Iterator first, Iterator last)
 
template<typename Iterator, typename Compare>
void stable_sort (Iterator first, Iterator last, Compare comp)
 
template<typename T, typename Y>
shared_ptr< T > static_pointer_cast (const shared_ptr< Y > &other) noexcept
 
template<typename T, fl::size N>
void swap (array< T, N > &lhs, array< T, N > &rhs) noexcept(noexcept(lhs.swap(rhs)))
 
template<typename T1, typename T2>
void swap (pair< T1, T2 > &lhs, pair< T1, T2 > &rhs) noexcept
 
template<typename T, typename Container>
void swap (queue< T, Container > &lhs, queue< T, Container > &rhs)
 Swap two queues.
 
template<typename T>
void swap (shared_ptr< T > &lhs, shared_ptr< T > &rhs) noexcept
 
template<typename T>
void swap (T &a, T &b)
 
template<typename T, typename Deleter>
void swap (unique_ptr< T, Deleter > &lhs, unique_ptr< T, Deleter > &rhs) noexcept
 
template<typename T>
void swap (weak_ptr< T > &lhs, weak_ptr< T > &rhs) noexcept
 
template<typename T>
void swap_by_copy (T &a, T &b)
 
fl::u32 time ()
 Universal millisecond timer - returns milliseconds since system startup.
 
u16 time_alpha16 (u32 now, u32 start, u32 end)
 
u8 time_alpha8 (u32 now, u32 start, u32 end)
 
float time_alphaf (u32 now, u32 start, u32 end)
 
string to_string (float value, int precision)
 
template<typename T>
string to_string (T value)
 
static u8 to_uint8 (float f)
 
template<typename GridVisitor>
void traverseGridSegment (const vec2f &start, const vec2f &end, GridVisitor &visitor)
 Traverse a grid segment by selecting the cells that are crossed.
 
template<typename GridVisitor>
void traverseGridSegment16 (const vec2f &start, const vec2f &end, GridVisitor &visitor)
 Traverse a grid segment using fixed-point 8.8 arithmetic.
 
template<typename GridVisitor>
void traverseGridSegment32 (const vec2f &start, const vec2f &end, GridVisitor &visitor)
 
template<typename GridVisitor>
void traverseGridSegmentFloat (const vec2f &start, const vec2f &end, GridVisitor &visitor)
 Traverse a grid segment using floating point arithmetic.
 
void upscale (const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const fl::XYMap &xyMap)
 
void upscaleArbitrary (const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const fl::XYMap &xyMap)
 Performs bilinear interpolation for upscaling an image.
 
void upscaleArbitraryFloat (const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const XYMap &xyMap)
 
void upscaleFloat (const CRGB *input, CRGB *output, u8 inputWidth, u8 inputHeight, const XYMap &xyMap)
 
u8 upscaleFloat (u8 v00, u8 v10, u8 v01, u8 v11, float dx, float dy)
 
void UpscalePalette (const class CHSVPalette16 &srcpal16, class CHSVPalette256 &destpal256)
 
void UpscalePalette (const class CHSVPalette16 &srcpal16, class CHSVPalette32 &destpal32)
 
void UpscalePalette (const class CHSVPalette32 &srcpal32, class CHSVPalette256 &destpal256)
 
void UpscalePalette (const class CRGBPalette16 &srcpal16, class CRGBPalette256 &destpal256)
 
void UpscalePalette (const class CRGBPalette16 &srcpal16, class CRGBPalette32 &destpal32)
 
void UpscalePalette (const class CRGBPalette32 &srcpal32, class CRGBPalette256 &destpal256)
 
void upscalePowerOf2 (const CRGB *input, CRGB *output, u8 inputWidth, u8 inputHeight, const fl::XYMap &xyMap)
 Performs bilinear interpolation for upscaling an image.
 
void upscaleRectangular (const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, u16 outputWidth, u16 outputHeight)
 Optimized upscale for rectangular/line-by-line XY maps.
 
void upscaleRectangularPowerOf2 (const CRGB *input, CRGB *output, u8 inputWidth, u8 inputHeight, u8 outputWidth, u8 outputHeight)
 Optimized upscale for rectangular/line-by-line XY maps (power-of-2 version).
 
i32 worley_noise_2d_q15 (i32 x, i32 y)
 
FASTLED_FORCE_INLINE u16 x_linear (u16 x, u16 length)
 
FASTLED_FORCE_INLINE u16 x_reverse (u16 x, u16 length)
 
fl::u16 XY (fl::u16 x, fl::u16 y)
 
fl::u16 XY (fl::u8 x, fl::u8 y)
 
FASTLED_FORCE_INLINE u16 xy_line_by_line (u16 x, u16 y, u16 width, u16 height)
 
FASTLED_FORCE_INLINE u16 xy_serpentine (u16 x, u16 y, u16 width, u16 height)
 

Variables

const TProgmemRGBPalette16ActivePaletteList []
 
static const AnimartrixEntry ANIMATION_TABLE []
 
const TProgmemRGBPalette16 BlueWhite_p
 
FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS istream cin
 
const i16 * cosArray = &sinLut[64]
 
ostream cout
 
const endl_t endl
 
const TProgmemRGBPalette16 FairyLight_p
 
rgb_2_rgbw_function g_user_function = rgb_2_rgbw_exact
 
const u16 gamma_2_8 [256]
 
const TProgmemRGBPalette16 Holly_p
 
const TProgmemRGBPalette16 Ice_p
 
void const fl::XYMap &xymap instead
 
constexpr nullopt_t nullopt {}
 
const TProgmemRGBPalette16 RedGreenWhite_p
 
const TProgmemRGBPalette16 RedWhite_p
 
const TProgmemRGBPalette16 RetroC9_p
 
const i16 * sinArray = &sinLut[0]
 
const i16 sinLut []
 
const TProgmemRGBPalette16 Snow_p
 
Class Members
typedef T * type T *

◆ fl::add_pointer< T & >

struct fl::add_pointer< T & >
+ Inheritance diagram for fl::add_pointer< T & >:
+ Collaboration diagram for fl::add_pointer< T & >:
Class Members
typedef T * type
typedef T * type T *

◆ fl::add_pointer< T && >

struct fl::add_pointer< T && >
+ Inheritance diagram for fl::add_pointer< T && >:
+ Collaboration diagram for fl::add_pointer< T && >:
Class Members
typedef T * type
typedef T * type T *

◆ fl::add_rvalue_reference

struct fl::add_rvalue_reference
+ Inheritance diagram for fl::add_rvalue_reference< T >:
Class Members
typedef T && type T&&

◆ fl::add_rvalue_reference< T & >

struct fl::add_rvalue_reference< T & >
+ Inheritance diagram for fl::add_rvalue_reference< T & >:
+ Collaboration diagram for fl::add_rvalue_reference< T & >:
Class Members
typedef T && type
typedef T & type T&

◆ fl::AnimartrixEntry

struct fl::AnimartrixEntry
Class Members
AnimartrixAnim anim
void(FastLEDANIMartRIX::*)() func
const char * name

◆ fl::AudioConfig

struct fl::AudioConfig
Class Members
bool agcEnabled = true
u8 attack = 50
u8 decay = 200
u8 gain = 128
bool noiseGate = true
u16 sampleRate = 22050
u8 scalingMode = 3
u8 sensitivity = 128

◆ fl::AudioData

struct fl::AudioData
Class Members
bool beatDetected = false
float dominantFrequency = 0.0f
float frequencyBins[16] = {0}
float magnitude = 0.0f
float peak = 0.0f
u32 timestamp = 0
float volume = 0.0f
float volumeRaw = 0.0f

◆ fl::BitsetFixed

class fl::BitsetFixed

◆ fl::BitsetInlined

class fl::BitsetInlined

◆ fl::Blend2dParams

struct fl::Blend2dParams
Class Members
uint8_t blur_amount = 0
uint8_t blur_passes = 1

◆ fl::choose_by_rank

struct fl::choose_by_rank
Class Members
typedef typename value > value), T, typename value > value), U, void >::type >::type type

◆ fl::choose_by_size

struct fl::choose_by_size
Class Members
typedef typename conditional<(sizeof(T) > sizeof(U)), T, typename conditional<(sizeof(U) > sizeof(T)), U, void >::type >::type type

◆ fl::common_type

struct fl::common_type
Class Members
typedef typename type type typename common_type_impl<T, U>::type

◆ fl::common_type_impl

struct fl::common_type_impl
+ Inheritance diagram for fl::common_type_impl< T, U, typename >:
Class Members
typedef T type T

◆ fl::common_type_impl< double, float >

struct fl::common_type_impl< double, float >
+ Inheritance diagram for fl::common_type_impl< double, float >:
+ Collaboration diagram for fl::common_type_impl< double, float >:
Class Members
typedef double type
typedef double type double

◆ fl::common_type_impl< double, long double >

struct fl::common_type_impl< double, long double >
+ Inheritance diagram for fl::common_type_impl< double, long double >:
+ Collaboration diagram for fl::common_type_impl< double, long double >:
Class Members
typedef double type
typedef long double type long double

◆ fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >

struct fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
+ Inheritance diagram for fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
+ Collaboration diagram for fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
Class Members
typedef double type
typedef double type double

◆ fl::common_type_impl< float, double >

struct fl::common_type_impl< float, double >
+ Inheritance diagram for fl::common_type_impl< float, double >:
+ Collaboration diagram for fl::common_type_impl< float, double >:
Class Members
typedef float type
typedef double type double

◆ fl::common_type_impl< float, long double >

struct fl::common_type_impl< float, long double >
+ Inheritance diagram for fl::common_type_impl< float, long double >:
+ Collaboration diagram for fl::common_type_impl< float, long double >:
Class Members
typedef float type
typedef long double type long double

◆ fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >

struct fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
+ Inheritance diagram for fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
+ Collaboration diagram for fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
Class Members
typedef float type
typedef float type float

◆ fl::common_type_impl< i8, u8, void >

struct fl::common_type_impl< i8, u8, void >
+ Inheritance diagram for fl::common_type_impl< i8, u8, void >:
+ Collaboration diagram for fl::common_type_impl< i8, u8, void >:
Class Members
typedef i8 type

◆ fl::common_type_impl< long double, double >

struct fl::common_type_impl< long double, double >
+ Inheritance diagram for fl::common_type_impl< long double, double >:
+ Collaboration diagram for fl::common_type_impl< long double, double >:
Class Members
typedef long double type
typedef long double type long double

◆ fl::common_type_impl< long double, float >

struct fl::common_type_impl< long double, float >
+ Inheritance diagram for fl::common_type_impl< long double, float >:
+ Collaboration diagram for fl::common_type_impl< long double, float >:
Class Members
typedef long double type
typedef long double type long double

◆ fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >

struct fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
+ Inheritance diagram for fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
+ Collaboration diagram for fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
Class Members
typedef T type
typedef double type double

◆ fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >

struct fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
+ Inheritance diagram for fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
+ Collaboration diagram for fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
Class Members
typedef T type
typedef float type float

◆ fl::common_type_impl< T, T >

struct fl::common_type_impl< T, T >
+ Inheritance diagram for fl::common_type_impl< T, T >:
+ Collaboration diagram for fl::common_type_impl< T, T >:
Class Members
typedef T type
typedef T type T

◆ fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >

struct fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >
+ Inheritance diagram for fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >:
+ Collaboration diagram for fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >:
Class Members
typedef T type
typedef typename type type typename integer_promotion_impl<T, U>::type

◆ fl::common_type_impl< u8, i8, void >

struct fl::common_type_impl< u8, i8, void >
+ Inheritance diagram for fl::common_type_impl< u8, i8, void >:
+ Collaboration diagram for fl::common_type_impl< u8, i8, void >:
Class Members
typedef u8 type

◆ fl::conditional

struct fl::conditional
+ Inheritance diagram for fl::conditional< B, T, F >:
Class Members
typedef T type T

◆ fl::conditional< false, T, F >

struct fl::conditional< false, T, F >
+ Inheritance diagram for fl::conditional< false, T, F >:
+ Collaboration diagram for fl::conditional< false, T, F >:
Class Members
typedef T type
typedef F type F

◆ fl::contains_type

struct fl::contains_type
+ Inheritance diagram for fl::contains_type< T, Types >:

◆ fl::Empty

struct fl::Empty

◆ fl::enable_if

struct fl::enable_if
+ Inheritance diagram for fl::enable_if< Condition, T >:

◆ fl::enable_if< true, T >

struct fl::enable_if< true, T >
+ Inheritance diagram for fl::enable_if< true, T >:
+ Collaboration diagram for fl::enable_if< true, T >:
Class Members
typedef T type T

◆ fl::endl_t

struct fl::endl_t

◆ fl::function

class fl::function
+ Inheritance diagram for fl::function< T >:

◆ fl::LuminovaParams

struct fl::LuminovaParams
Class Members
uint8_t blur_amount = 24
uint8_t fade_amount = 18
int max_particles = 256
uint8_t point_gain = 128

◆ fl::max_align

struct fl::max_align
+ Inheritance diagram for fl::max_align< Types >:

◆ fl::max_size

struct fl::max_size
+ Inheritance diagram for fl::max_size< Types >:

◆ fl::nullopt_t

struct fl::nullopt_t

◆ fl::pair_element

struct fl::pair_element
+ Inheritance diagram for fl::pair_element< I, T1, T2 >:

◆ fl::pair_element< 0, T1, T2 >

struct fl::pair_element< 0, T1, T2 >
+ Inheritance diagram for fl::pair_element< 0, T1, T2 >:
+ Collaboration diagram for fl::pair_element< 0, T1, T2 >:
Class Members
typedef T1 type T1

◆ fl::pair_element< 1, T1, T2 >

struct fl::pair_element< 1, T1, T2 >
+ Inheritance diagram for fl::pair_element< 1, T1, T2 >:
+ Collaboration diagram for fl::pair_element< 1, T1, T2 >:
Class Members
typedef T2 type T2

◆ fl::Pixel.__unnamed0__

union fl::Pixel.__unnamed0__
Class Members
struct Pixel.__unnamed0__.__unnamed0__ __unnamed__
uint8_t raw[3]

◆ fl::Pixel.__unnamed0__.__unnamed0__

struct fl::Pixel.__unnamed0__.__unnamed0__
Class Members
uint8_t blue
uint8_t green
uint8_t red

◆ fl::remove_const

struct fl::remove_const
+ Inheritance diagram for fl::remove_const< T >:
Class Members
typedef T type T

◆ fl::remove_const< const T >

struct fl::remove_const< const T >
+ Inheritance diagram for fl::remove_const< const T >:
+ Collaboration diagram for fl::remove_const< const T >:
Class Members
typedef T type
typedef T type T

◆ fl::remove_cv

struct fl::remove_cv
+ Inheritance diagram for fl::remove_cv< T >:
Class Members
typedef T type T

◆ fl::remove_cv< const T >

struct fl::remove_cv< const T >
+ Inheritance diagram for fl::remove_cv< const T >:
+ Collaboration diagram for fl::remove_cv< const T >:
Class Members
typedef T type
typedef T type T

◆ fl::remove_cv< const volatile T >

struct fl::remove_cv< const volatile T >
+ Inheritance diagram for fl::remove_cv< const volatile T >:
+ Collaboration diagram for fl::remove_cv< const volatile T >:
Class Members
typedef const volatile T type
typedef T type T

◆ fl::remove_cv< volatile T >

struct fl::remove_cv< volatile T >
+ Inheritance diagram for fl::remove_cv< volatile T >:
+ Collaboration diagram for fl::remove_cv< volatile T >:
Class Members
typedef T type
typedef T type T

◆ fl::remove_extent

struct fl::remove_extent
+ Inheritance diagram for fl::remove_extent< T >:
Class Members
typedef T type T

◆ fl::remove_extent< T[]>

struct fl::remove_extent< T[]>
+ Inheritance diagram for fl::remove_extent< T[]>:
+ Collaboration diagram for fl::remove_extent< T[]>:
Class Members
typedef T type
typedef T type T

◆ fl::remove_extent< T[N]>

struct fl::remove_extent< T[N]>
+ Inheritance diagram for fl::remove_extent< T[N]>:
+ Collaboration diagram for fl::remove_extent< T[N]>:
Class Members
typedef T type
typedef T type T

◆ fl::remove_reference

struct fl::remove_reference
+ Inheritance diagram for fl::remove_reference< T >:
Class Members
typedef T type T

◆ fl::remove_reference< T & >

struct fl::remove_reference< T & >
+ Inheritance diagram for fl::remove_reference< T & >:
+ Collaboration diagram for fl::remove_reference< T & >:
Class Members
typedef T type
typedef T type T

◆ fl::remove_reference< T && >

struct fl::remove_reference< T && >
+ Inheritance diagram for fl::remove_reference< T && >:
+ Collaboration diagram for fl::remove_reference< T && >:
Class Members
typedef T type
typedef T type T

◆ fl::swap_impl

struct fl::swap_impl
+ Inheritance diagram for fl::swap_impl< T, bool >:

◆ fl::tuple

struct fl::tuple
+ Inheritance diagram for fl::tuple< Ts >:

◆ fl::tuple<>

struct fl::tuple<>
+ Inheritance diagram for fl::tuple<>:
+ Collaboration diagram for fl::tuple<>:

◆ fl::tuple_element

struct fl::tuple_element
+ Inheritance diagram for fl::tuple_element< I, T >:

◆ fl::tuple_element< 0, pair< T1, T2 > >

struct fl::tuple_element< 0, pair< T1, T2 > >
+ Inheritance diagram for fl::tuple_element< 0, pair< T1, T2 > >:
+ Collaboration diagram for fl::tuple_element< 0, pair< T1, T2 > >:
Class Members
typedef T1 type T1

◆ fl::tuple_element< 0, tuple< Head, Tail... > >

struct fl::tuple_element< 0, tuple< Head, Tail... > >
+ Inheritance diagram for fl::tuple_element< 0, tuple< Head, Tail... > >:
+ Collaboration diagram for fl::tuple_element< 0, tuple< Head, Tail... > >:
Class Members
typedef Head type Head

◆ fl::tuple_element< 1, pair< T1, T2 > >

struct fl::tuple_element< 1, pair< T1, T2 > >
+ Inheritance diagram for fl::tuple_element< 1, pair< T1, T2 > >:
+ Collaboration diagram for fl::tuple_element< 1, pair< T1, T2 > >:
Class Members
typedef T2 type T2

◆ fl::tuple_size

struct fl::tuple_size
+ Inheritance diagram for fl::tuple_size< T >:

Typedef Documentation

◆ accum124

typedef u16 fl::accum124

no direct ANSI counterpart. 12 bits int, 4 bits fraction

Definition at line 74 of file int.h.

◆ accum1616

typedef u32 fl::accum1616

ANSI: signed _Accum. 16 bits int, 16 bits fraction.

Definition at line 72 of file int.h.

◆ accum88

typedef u16 fl::accum88

ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.

Definition at line 70 of file int.h.

◆ add_pointer_t

template<typename T>
using fl::add_pointer_t = typename add_pointer<T>::type

Definition at line 173 of file type_traits.h.

◆ advanceDataFunction

typedef void(* fl::advanceDataFunction) (void *pixel_controller)

Definition at line 85 of file pixel_iterator.h.

◆ allocator_inlined_psram

template<typename T, fl::size N>
using fl::allocator_inlined_psram = allocator_inlined<T, N, fl::allocator_psram<T>>

Definition at line 764 of file allocator.h.

◆ allocator_inlined_slab

template<typename T, fl::size N>
using fl::allocator_inlined_slab = allocator_inlined<T, N, fl::allocator_slab<T>>

Definition at line 772 of file allocator.h.

◆ allocator_inlined_slab_psram

template<typename T, fl::size N, fl::size SLAB_SIZE = 8>
using fl::allocator_inlined_slab_psram = allocator_inlined<T, N, fl::allocator_slab<T, SLAB_SIZE>>

Definition at line 768 of file allocator.h.

◆ alpha16

using fl::alpha16
Initial value:
u16

Definition at line 21 of file transform.h.

◆ atomic

template<typename T>
using fl::atomic = AtomicFake<T>

Definition at line 21 of file atomic.h.

◆ atomic_bool

using fl::atomic_bool = atomic<bool>

Definition at line 24 of file atomic.h.

◆ atomic_i32

using fl::atomic_i32 = atomic<fl::i32>

Definition at line 28 of file atomic.h.

◆ atomic_int

using fl::atomic_int = atomic<int>

Definition at line 25 of file atomic.h.

◆ atomic_u32

using fl::atomic_u32 = atomic<fl::u32>

Definition at line 27 of file atomic.h.

◆ atomic_uint

using fl::atomic_uint = atomic<unsigned int>

Definition at line 26 of file atomic.h.

◆ common_type_t

template<typename T, typename U>
using fl::common_type_t = typename common_type<T, U>::type

Definition at line 647 of file type_traits.h.

◆ conditional_t

template<bool B, typename T, typename F>
using fl::conditional_t = typename conditional<B, T, F>::type

Definition at line 108 of file type_traits.h.

◆ cycle_t

typedef fl::i64 fl::cycle_t

8.8 fixed point (signed) value

Definition at line 12 of file types.h.

◆ decay_t

template<typename T>
using fl::decay_t = typename decay<T>::type

Definition at line 257 of file type_traits.h.

◆ DefaultLess

template<typename T>
using fl::DefaultLess = less<T>

Definition at line 51 of file utility.h.

◆ deque_double

typedef deque<double> fl::deque_double

Definition at line 388 of file deque.h.

◆ deque_float

typedef deque<float> fl::deque_float

Definition at line 387 of file deque.h.

◆ deque_int

typedef deque<int> fl::deque_int

Definition at line 386 of file deque.h.

◆ enable_if_t

template<bool Condition, typename T = void>
using fl::enable_if_t = typename enable_if<Condition, T>::type

Definition at line 59 of file type_traits.h.

◆ equal_to

template<typename T>
using fl::equal_to = EqualTo<T>

Definition at line 712 of file hash_map.h.

◆ false_type

using fl::false_type = integral_constant<bool, false>

Definition at line 30 of file type_traits.h.

◆ FetchCallback

using fl::FetchCallback = fl::function<void(const response&)>

Callback type for simple fetch responses (backward compatible)

Definition at line 186 of file fetch.h.

◆ FixedSet

template<typename Key, size N>
using fl::FixedSet = VectorSetFixed<Key, N>

Definition at line 23 of file set.h.

◆ fl_map

template<typename Key, typename T, typename Compare = fl::less<Key>>
using fl::fl_map = MapRedBlackTree<Key, T, Compare, fl::allocator_slab<char>>

Definition at line 540 of file map.h.

◆ fract16

typedef u16 fl::fract16

ANSI: unsigned _Fract.

Range is 0 to 0.99998474121 in steps of 0.00001525878.
Should be interpreted as unsigned 65536ths.

Definition at line 59 of file int.h.

◆ fract32

typedef u32 fl::fract32

ANSI: unsigned long _Fract. 32 bits int, 32 bits fraction.

Definition at line 63 of file int.h.

◆ fract8

typedef u8 fl::fract8

Fixed-Point Fractional Types.

Types for storing fractional data.

Example: if a fract8 has the value "64", that should be interpreted as 64/256ths, or one-quarter.

accumXY types should be interpreted as X bits of integer, and Y bits of fraction.
E.g., accum88 has 8 bits of int, 8 bits of fraction ANSI: unsigned short _Fract. Range is 0 to 0.99609375 in steps of 0.00390625.
Should be interpreted as unsigned 256ths.

Definition at line 49 of file int.h.

◆ getHdScaleFunction

typedef void(* fl::getHdScaleFunction) (void *pixel_controller, uint8_t *c0, uint8_t *c1, uint8_t *c2, uint8_t *brightness)

Definition at line 89 of file pixel_iterator.h.

◆ globalBrightness

typedef uint8_t(* fl::globalBrightness) (void *pixel_controller)

Definition at line 88 of file pixel_iterator.h.

◆ hasFunction

typedef bool(* fl::hasFunction) (void *pixel_controller, int n)

Definition at line 87 of file pixel_iterator.h.

◆ hash_map

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = equal_to<Key>>
using fl::hash_map = HashMap<Key, T, Hash, KeyEqual>

Definition at line 716 of file hash_map.h.

◆ hash_set

template<typename Key, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>>
using fl::hash_set = HashSet<Key, Hash, KeyEqual>

Definition at line 30 of file hash_set.h.

◆ i8

typedef signed char fl::i8

Definition at line 16 of file int.h.

◆ intrusive_ptr

template<typename T>
using fl::intrusive_ptr = fl::Ptr<T>

Definition at line 14 of file memory.h.

◆ is_derived

template<typename Base, typename Derived>
using fl::is_derived = enable_if_t<is_base_of<Base, Derived>::value>

Definition at line 663 of file type_traits.h.

◆ JsonArray

using fl::JsonArray = fl::vector<fl::shared_ptr<JsonValue>>

Definition at line 170 of file json.h.

◆ JsonObject

using fl::JsonObject = fl::HashMap<fl::string, fl::shared_ptr<JsonValue>>

Definition at line 171 of file json.h.

◆ loadAndScale_WS2816_HDFunction

typedef void(* fl::loadAndScale_WS2816_HDFunction) (void *pixel_controller, uint16_t *b0_out, uint16_t *b1_out, uint16_t *b2_out)

Definition at line 83 of file pixel_iterator.h.

◆ loadAndScaleRGBFunction

typedef void(* fl::loadAndScaleRGBFunction) (void *pixel_controller, uint8_t *r_out, uint8_t *g_out, uint8_t *b_out)

Definition at line 79 of file pixel_iterator.h.

◆ loadAndScaleRGBWFunction

typedef void(* fl::loadAndScaleRGBWFunction) (void *pixel_controller, Rgbw rgbw, uint8_t *b0_out, uint8_t *b1_out, uint8_t *b2_out, uint8_t *b3_out)

Definition at line 78 of file pixel_iterator.h.

◆ LUT16

typedef LUT<u16> fl::LUT16

Definition at line 24 of file lut.h.

◆ LUTXY16

typedef LUT<vec2<u16> > fl::LUTXY16

Definition at line 25 of file lut.h.

◆ LUTXYFLOAT

typedef LUT<vec2f> fl::LUTXYFLOAT

Definition at line 26 of file lut.h.

◆ LUTXYZFLOAT

typedef LUT<vec3f> fl::LUTXYZFLOAT

Definition at line 27 of file lut.h.

◆ mutex

using fl::mutex = MutexFake<void>

Definition at line 18 of file mutex.h.

◆ nullptr_t

typedef decltype(nullptr) fl::nullptr_t

Definition at line 11 of file cstddef.h.

◆ optional

template<typename T>
using fl::optional = Optional<T>

Definition at line 14 of file optional.h.

◆ Pair

template<typename T1, typename T2>
using fl::Pair = pair<T1, T2>

Definition at line 205 of file pair.h.

◆ pair_xy_float

using fl::pair_xy_float = vec2<float>

Definition at line 342 of file geometry.h.

◆ pair_xyz_float

using fl::pair_xyz_float = vec3<float>

Definition at line 338 of file geometry.h.

◆ PromiseResult

template<typename T>
using fl::PromiseResult = result<T>

Type alias for backwards compatibility.

Deprecated
Use result<T> instead of PromiseResult<T>

Definition at line 185 of file promise_result.h.

◆ ptrdiff_t

typedef __PTRDIFF_TYPE__ fl::ptrdiff_t

Definition at line 22 of file cstddef.h.

◆ remove_cv_t

template<typename T>
using fl::remove_cv_t = typename remove_cv<T>::type

Definition at line 242 of file type_traits.h.

◆ remove_reference_t

template<typename T>
using fl::remove_reference_t = typename remove_reference<T>::type

Definition at line 23 of file move.h.

◆ rgb_2_rgbw_function

typedef void(* fl::rgb_2_rgbw_function) (uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)

Definition at line 84 of file rgbw.h.

◆ saccum114

typedef i32 fl::saccum114

no direct ANSI counterpart. 1 bit int, 14 bits fraction

Definition at line 75 of file int.h.

◆ saccum1516

typedef i32 fl::saccum1516

ANSI: signed _Accum. 15 bits int, 16 bits fraction.

Definition at line 73 of file int.h.

◆ saccum78

typedef i16 fl::saccum78

ANSI: signed short _Accum. 7 bits int, 8 bits fraction.

Definition at line 71 of file int.h.

◆ scoped_ptr

template<typename T, typename Deleter = default_delete<T>>
using fl::scoped_ptr = unique_ptr<T, Deleter>

Definition at line 12 of file scoped_ptr.h.

◆ set_inlined

template<typename T, fl::size N>
using fl::set_inlined = fl::set<T, fl::allocator_inlined_slab<T, N>>

Definition at line 377 of file set.h.

◆ sfract15

typedef i16 fl::sfract15

ANSI: signed _Fract.

Range is -0.99996948242 to 0.99996948242 in steps of 0.00003051757.
Should be interpreted as signed 32768ths.

Definition at line 68 of file int.h.

◆ sfract31

typedef i32 fl::sfract31

ANSI: signed long _Fract. 31 bits int, 1 bit fraction.

Definition at line 61 of file int.h.

◆ sfract7

typedef i8 fl::sfract7

ANSI: signed short _Fract.

Range is -0.9921875 to 0.9921875 in steps of 0.0078125.
Should be interpreted as signed 128ths.

Definition at line 54 of file int.h.

◆ size_t

typedef __SIZE_TYPE__ fl::size_t

Definition at line 17 of file cstddef.h.

◆ sizeFunction

typedef int(* fl::sizeFunction) (void *pixel_controller)

Definition at line 86 of file pixel_iterator.h.

◆ span

template<typename T>
using fl::span = Slice<T>

Definition at line 8 of file span.h.

◆ sstream

using fl::sstream = StrStream

Definition at line 6 of file sstream.h.

◆ stepDitheringFunction

typedef void(* fl::stepDitheringFunction) (void *pixel_controller)

Definition at line 84 of file pixel_iterator.h.

◆ Str

using fl::Str = fl::string

Definition at line 36 of file str.h.

◆ ThreadLocal

template<typename T>
using fl::ThreadLocal = ThreadLocalFake<T>

Definition at line 27 of file thread_local.h.

◆ TracePoint

using fl::TracePoint = fl::tuple<const char*, int, uint32_t>

A structure to hold source trace information.

Contains the file name, line number, and the time at which the trace was captured.

Definition at line 22 of file trace.h.

◆ true_type

using fl::true_type = integral_constant<bool, true>

Definition at line 29 of file type_traits.h.

◆ u8

typedef unsigned char fl::u8

Definition at line 17 of file int.h.

◆ uint

typedef unsigned int fl::uint

Definition at line 18 of file int.h.

◆ unordered_map

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = equal_to<Key>>
using fl::unordered_map = HashMap<Key, T, Hash, KeyEqual>

Definition at line 720 of file hash_map.h.

◆ vec2f

using fl::vec2f = vec2<float>

Definition at line 333 of file geometry.h.

◆ vec2i16

using fl::vec2i16 = vec2<i16>

Definition at line 335 of file geometry.h.

◆ vec2u8

using fl::vec2u8 = vec2<fl::u8>

Definition at line 334 of file geometry.h.

◆ vec3f

using fl::vec3f = vec3<float>

Definition at line 185 of file geometry.h.

◆ vector

template<typename T, typename Allocator = fl::allocator<T>>
using fl::vector = HeapVector<T, Allocator>

Definition at line 1214 of file vector.h.

◆ vector_fixed

template<typename T, fl::size INLINED_SIZE>
using fl::vector_fixed = FixedVector<T, INLINED_SIZE>

Definition at line 1217 of file vector.h.

◆ vector_inlined

template<typename T, fl::size INLINED_SIZE = 64>
using fl::vector_inlined = InlinedVector<T, INLINED_SIZE>

Definition at line 1220 of file vector.h.

◆ XFunction

typedef u16(* fl::XFunction) (u16 x, u16 length)

Definition at line 24 of file xmap.h.

◆ XYFunction

typedef u16(* fl::XYFunction) (u16 x, u16 y, u16 width, u16 height)

Definition at line 36 of file xymap.h.

◆ XYRaster

using fl::XYRaster = XYRasterU8Sparse

Definition at line 8 of file raster.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kRGBWDefaultColorTemp 

Definition at line 22 of file rgbw.h.

22 {
24};
@ kRGBWDefaultColorTemp
Definition rgbw.h:23

◆ AnimartrixAnim

enum fl::AnimartrixAnim
Enumerator
RGB_BLOBS5 
RGB_BLOBS4 
RGB_BLOBS3 
RGB_BLOBS2 
RGB_BLOBS 
POLAR_WAVES 
SLOW_FADE 
ZOOM2 
ZOOM 
HOT_BLOB 
SPIRALUS2 
SPIRALUS 
YVES 
SCALEDEMO1 
LAVA1 
CALEIDO3 
CALEIDO2 
CALEIDO1 
DISTANCE_EXPERIMENT 
CENTER_FIELD 
WAVES 
CHASING_SPIRALS 
ROTATING_BLOB 
RINGS 
COMPLEX_KALEIDO 
COMPLEX_KALEIDO_2 
COMPLEX_KALEIDO_3 
COMPLEX_KALEIDO_4 
COMPLEX_KALEIDO_5 
COMPLEX_KALEIDO_6 
WATER 
PARAMETRIC_WATER 
MODULE_EXPERIMENT1 
MODULE_EXPERIMENT2 
MODULE_EXPERIMENT3 
MODULE_EXPERIMENT4 
MODULE_EXPERIMENT5 
MODULE_EXPERIMENT6 
MODULE_EXPERIMENT7 
MODULE_EXPERIMENT8 
MODULE_EXPERIMENT9 
MODULE_EXPERIMENT10 
MODULE_EXPERIMENT_SM1 
MODULE_EXPERIMENT_SM2 
MODULE_EXPERIMENT_SM3 
MODULE_EXPERIMENT_SM4 
MODULE_EXPERIMENT_SM5 
MODULE_EXPERIMENT_SM6 
MODULE_EXPERIMENT_SM8 
MODULE_EXPERIMENT_SM9 
MODULE_EXPERIMENT_SM10 
NUM_ANIMATIONS 

Definition at line 27 of file animartrix.hpp.

27 {
28 RGB_BLOBS5 = 0,
35 ZOOM2,
36 ZOOM,
40 YVES,
42 LAVA1,
48 WAVES,
51 RINGS,
58 WATER,
80};
@ COMPLEX_KALEIDO
@ MODULE_EXPERIMENT_SM6
@ ZOOM2
@ CALEIDO2
@ ZOOM
@ CHASING_SPIRALS
@ MODULE_EXPERIMENT10
@ WATER
@ MODULE_EXPERIMENT_SM3
@ MODULE_EXPERIMENT6
@ MODULE_EXPERIMENT3
@ CENTER_FIELD
@ RGB_BLOBS4
@ DISTANCE_EXPERIMENT
@ POLAR_WAVES
@ PARAMETRIC_WATER
@ MODULE_EXPERIMENT_SM8
@ COMPLEX_KALEIDO_4
@ MODULE_EXPERIMENT7
@ SPIRALUS
@ MODULE_EXPERIMENT_SM9
@ WAVES
@ COMPLEX_KALEIDO_5
@ COMPLEX_KALEIDO_2
@ MODULE_EXPERIMENT8
@ NUM_ANIMATIONS
@ ROTATING_BLOB
@ MODULE_EXPERIMENT_SM1
@ MODULE_EXPERIMENT_SM4
@ SLOW_FADE
@ RGB_BLOBS
@ MODULE_EXPERIMENT_SM5
@ LAVA1
@ MODULE_EXPERIMENT9
@ COMPLEX_KALEIDO_6
@ MODULE_EXPERIMENT1
@ YVES
@ SCALEDEMO1
@ RGB_BLOBS2
@ MODULE_EXPERIMENT_SM10
@ MODULE_EXPERIMENT4
@ MODULE_EXPERIMENT5
@ HOT_BLOB
@ MODULE_EXPERIMENT2
@ RINGS
@ RGB_BLOBS5
@ COMPLEX_KALEIDO_3
@ CALEIDO3
@ CALEIDO1
@ RGB_BLOBS3
@ MODULE_EXPERIMENT_SM2
@ SPIRALUS2

◆ ButtonStrategy

enum fl::ButtonStrategy
Enumerator
kHighLowFloating 
kPullUp 

Definition at line 13 of file button.h.

13 {
14
15 // FastLED doesn't have reliable support for pullups/pulldowns.
16 // So we instead use a strategy where the pin is set to high, then
17 // checked if it's high, then set to low, and then checked if it's low
18 // if this is the case, then the pin is floating and thefore the button
19 // is not
20 // being pressed.
22 kPullUp,
23
24};
@ kHighLowFloating
Definition button.h:21
@ kPullUp
Definition button.h:22

◆ DrawMode

enum fl::DrawMode
Enumerator
DRAW_MODE_OVERWRITE 
DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS 

Definition at line 5 of file draw_mode.h.

◆ EaseType

enum fl::EaseType
Enumerator
EASE_NONE 
EASE_IN_QUAD 
EASE_OUT_QUAD 
EASE_IN_OUT_QUAD 
EASE_IN_CUBIC 
EASE_OUT_CUBIC 
EASE_IN_OUT_CUBIC 
EASE_IN_SINE 
EASE_OUT_SINE 
EASE_IN_OUT_SINE 

Definition at line 21 of file ease.h.

21 {
32};
@ EASE_OUT_CUBIC
Definition ease.h:27
@ EASE_NONE
Definition ease.h:22
@ EASE_IN_QUAD
Definition ease.h:23
@ EASE_IN_SINE
Definition ease.h:29
@ EASE_OUT_SINE
Definition ease.h:30
@ EASE_IN_CUBIC
Definition ease.h:26
@ EASE_OUT_QUAD
Definition ease.h:24
@ EASE_IN_OUT_CUBIC
Definition ease.h:28
@ EASE_IN_OUT_SINE
Definition ease.h:31
@ EASE_IN_OUT_QUAD
Definition ease.h:25

◆ EOrder

enum fl::EOrder

RGB color channel orderings, used when instantiating controllers to determine what order the controller should send data out in.

The default ordering is RGB. Within this enum, the red channel is 0, the green channel is 1, and the blue chanel is 2.

Enumerator
RGB 

Red, Green, Blue (0012)

RBG 

Red, Blue, Green (0021)

GRB 

Green, Red, Blue (0102)

GBR 

Green, Blue, Red (0120)

BRG 

Blue, Red, Green (0201)

BGR 

Blue, Green, Red (0210)

Definition at line 13 of file eorder.h.

13 {
14 RGB=0012,
15 RBG=0021,
16 GRB=0102,
17 GBR=0120,
18 BRG=0201,
19 BGR=0210
20};
@ RBG
Red, Blue, Green (0021)
Definition eorder.h:15
@ BGR
Blue, Green, Red (0210)
Definition eorder.h:19
@ GBR
Green, Blue, Red (0120)
Definition eorder.h:17
@ GRB
Green, Red, Blue (0102)
Definition eorder.h:16
@ BRG
Blue, Red, Green (0201)
Definition eorder.h:18
@ RGB
Red, Green, Blue (0012)
Definition eorder.h:14

◆ EOrderW

enum fl::EOrderW
Enumerator
W3 

White is fourth.

W2 

White is third.

W1 

White is second.

W0 

White is first.

WDefault 

Definition at line 23 of file eorder.h.

23 {
24 W3 = 0x3,
25 W2 = 0x2,
26 W1 = 0x1,
27 W0 = 0x0,
28 WDefault = W3
29};
@ W2
White is third.
Definition eorder.h:25
@ W3
White is fourth.
Definition eorder.h:24
@ WDefault
Definition eorder.h:28
@ W0
White is first.
Definition eorder.h:27
@ W1
White is second.
Definition eorder.h:26

◆ FiveBitGammaCorrectionMode

enum fl::FiveBitGammaCorrectionMode
Enumerator
kFiveBitGammaCorrectionMode_Null 
kFiveBitGammaCorrectionMode_BitShift 

Definition at line 15 of file five_bit_hd_gamma.h.

◆ HSVHue

enum fl::HSVHue

Pre-defined hue values for CHSV objects.

Enumerator
HUE_RED 

Red (0°)

HUE_ORANGE 

Orange (45°)

HUE_YELLOW 

Yellow (90°)

HUE_GREEN 

Green (135°)

HUE_AQUA 

Aqua (180°)

HUE_BLUE 

Blue (225°)

HUE_PURPLE 

Purple (270°)

HUE_PINK 

Pink (315°)

Definition at line 96 of file hsv.h.

96 {
97 HUE_RED = 0,
98 HUE_ORANGE = 32,
99 HUE_YELLOW = 64,
100 HUE_GREEN = 96,
101 HUE_AQUA = 128,
102 HUE_BLUE = 160,
103 HUE_PURPLE = 192,
104 HUE_PINK = 224
105} HSVHue;
HSVHue
Pre-defined hue values for CHSV objects.
Definition hsv.h:96
@ HUE_BLUE
Blue (225°)
Definition hsv.h:102
@ HUE_RED
Red (0°)
Definition hsv.h:97
@ HUE_AQUA
Aqua (180°)
Definition hsv.h:101
@ HUE_PINK
Pink (315°)
Definition hsv.h:104
@ HUE_GREEN
Green (135°)
Definition hsv.h:100
@ HUE_YELLOW
Yellow (90°)
Definition hsv.h:99
@ HUE_ORANGE
Orange (45°)
Definition hsv.h:98
@ HUE_PURPLE
Purple (270°)
Definition hsv.h:103

◆ InsertResult

enum fl::InsertResult
Enumerator
kInserted 
kExists 
kMaxSize 

Definition at line 10 of file insert_result.h.

10 {
11 kInserted = 0,
12 kExists = 1,
13 kMaxSize = 2,
14};
@ kMaxSize
@ kExists
@ kInserted

◆ leddirection

enum class fl::leddirection
strong
Enumerator
FORWARD 
BACKWARD 
MAP 

Definition at line 139 of file ___pixeltypes.h.

◆ RGBW_MODE

enum fl::RGBW_MODE
Enumerator
kRGBWInvalid 
kRGBWNullWhitePixel 
kRGBWExactColors 
kRGBWBoostedWhite 
kRGBWMaxBrightness 
kRGBWUserFunction 

Definition at line 13 of file rgbw.h.

13 {
20};
@ kRGBWMaxBrightness
Definition rgbw.h:18
@ kRGBWBoostedWhite
Definition rgbw.h:17
@ kRGBWInvalid
Definition rgbw.h:14
@ kRGBWUserFunction
Definition rgbw.h:19
@ kRGBWNullWhitePixel
Definition rgbw.h:15
@ kRGBWExactColors
Definition rgbw.h:16

◆ SuperSample

enum fl::SuperSample
Enumerator
SUPER_SAMPLE_NONE 
SUPER_SAMPLE_2X 
SUPER_SAMPLE_4X 
SUPER_SAMPLE_8X 

Definition at line 4 of file supersample.h.

4 {
5 SUPER_SAMPLE_NONE = 1, // 1x supersampling (no supersampling)
6 SUPER_SAMPLE_2X = 2, // 2x supersampling
7 SUPER_SAMPLE_4X = 4, // 4x supersampling
8 SUPER_SAMPLE_8X = 8 // 8x supersampling
9};
@ SUPER_SAMPLE_8X
Definition supersample.h:8
@ SUPER_SAMPLE_2X
Definition supersample.h:6
@ SUPER_SAMPLE_4X
Definition supersample.h:7
@ SUPER_SAMPLE_NONE
Definition supersample.h:5

◆ TaskType

enum class fl::TaskType
strong
Enumerator
kEveryMs 
kAtFramerate 
kBeforeFrame 
kAfterFrame 

Definition at line 43 of file task.h.

43 {
48};
@ kBeforeFrame
Definition task.h:46
@ kAfterFrame
Definition task.h:47
@ kAtFramerate
Definition task.h:45
@ kEveryMs
Definition task.h:44

◆ TGradientDirectionCode

enum fl::TGradientDirectionCode

Hue direction for calculating fill gradients.

Since "hue" is a value around a color wheel, there are always two directions to sweep from one hue to another.

Enumerator
FORWARD_HUES 

Hue always goes clockwise around the color wheel.

BACKWARD_HUES 

Hue always goes counter-clockwise around the color wheel.

SHORTEST_HUES 

Hue goes whichever way is shortest.

LONGEST_HUES 

Hue goes whichever way is longest.

Definition at line 34 of file colorutils_misc.h.

34 {
TGradientDirectionCode
Hue direction for calculating fill gradients.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
@ LONGEST_HUES
Hue goes whichever way is longest.
@ FORWARD_HUES
Hue always goes clockwise around the color wheel.
@ BACKWARD_HUES
Hue always goes counter-clockwise around the color wheel.

◆ U8EasingFunction

enum fl::U8EasingFunction
Enumerator
WAVE_U8_MODE_LINEAR 
WAVE_U8_MODE_SQRT 

Definition at line 33 of file wave_simulation.h.

Function Documentation

◆ allocate_shared()

template<typename T, typename A, typename... Args>
shared_ptr< T > fl::allocate_shared ( const A & alloc,
Args &&... args )

Definition at line 386 of file shared_ptr.h.

386 {
387 // For now, just delegate to make_shared
388 // Full allocator support would require more complex control block management
390}
shared_ptr< T > make_shared(Args &&... args)
Definition shared_ptr.h:348
constexpr T && forward(typename remove_reference< T >::type &t) noexcept
corkscrew_args args
Definition old.h:150

◆ AnimartrixLoop()

void fl::AnimartrixLoop ( Animartrix & self,
fl::u32 now )

Definition at line 162 of file animartrix.hpp.

162 {
163 if (self.prev_animation != self.current_animation) {
164 if (self.impl) {
165 // Re-initialize object.
166 self.impl->init(self.getWidth(), self.getHeight());
167 }
169 }
170 if (!self.impl) {
171 self.impl.reset(new FastLEDANIMartRIX(&self));
172 }
173 self.impl->setTime(now);
174 self.impl->loop();
175}
AnimartrixAnim current_animation
AnimartrixAnim prev_animation
fl::unique_ptr< FastLEDANIMartRIX > impl
uint16_t getHeight() const
Definition fx2d.h:24
uint16_t getWidth() const
Definition fx2d.h:25

◆ applyGamma_video() [1/3]

CRGB fl::applyGamma_video ( const CRGB & orig,
float gamma )

Definition at line 1069 of file colorutils.cpp.

1069 {
1070 CRGB adj;
1071 adj.r = applyGamma_video(orig.r, gamma);
1072 adj.g = applyGamma_video(orig.g, gamma);
1073 adj.b = applyGamma_video(orig.b, gamma);
1074 return adj;
1075}
fl::u8 applyGamma_video(fl::u8 brightness, float gamma)
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86

References applyGamma_video().

+ Here is the call graph for this function:

◆ applyGamma_video() [2/3]

CRGB fl::applyGamma_video ( const CRGB & orig,
float gammaR,
float gammaG,
float gammaB )

Definition at line 1077 of file colorutils.cpp.

1078 {
1079 CRGB adj;
1080 adj.r = applyGamma_video(orig.r, gammaR);
1081 adj.g = applyGamma_video(orig.g, gammaG);
1082 adj.b = applyGamma_video(orig.b, gammaB);
1083 return adj;
1084}

References applyGamma_video().

+ Here is the call graph for this function:

◆ applyGamma_video() [3/3]

fl::u8 fl::applyGamma_video ( fl::u8 brightness,
float gamma )

Definition at line 1057 of file colorutils.cpp.

1057 {
1058 float orig;
1059 float adj;
1060 orig = (float)(brightness) / (255.0);
1061 adj = pow(orig, gamma) * (255.0);
1062 fl::u8 result = (fl::u8)(adj);
1063 if ((brightness > 0) && (result == 0)) {
1064 result = 1; // never gamma-adjust a positive number down to zero
1065 }
1066 return result;
1067}
UISlider brightness("Brightness", 128, 0, 255, 1)
Result type for promise operations.
unsigned char u8
Definition int.h:17

References brightness().

Referenced by applyGamma_video(), applyGamma_video(), napplyGamma_video(), napplyGamma_video(), napplyGamma_video(), and napplyGamma_video().

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

◆ async_active_tasks()

size_t fl::async_active_tasks ( )

Get the number of active async tasks across all systems.

Returns
Total number of active async tasks

Definition at line 82 of file async.cpp.

82 {
84}
size_t total_active_tasks() const
Get total number of active tasks across all runners.
Definition async.cpp:51
static AsyncManager & instance()
Definition async.cpp:16

References fl::AsyncManager::instance(), and fl::AsyncManager::total_active_tasks().

+ Here is the call graph for this function:

◆ async_has_tasks()

bool fl::async_has_tasks ( )

Check if any async systems have active tasks.

Returns
True if any async tasks are running

Definition at line 86 of file async.cpp.

86 {
88}
bool has_active_tasks() const
Check if there are any active async tasks.
Definition async.cpp:42

References fl::AsyncManager::has_active_tasks(), and fl::AsyncManager::instance().

+ Here is the call graph for this function:

◆ async_run()

void fl::async_run ( )

Run all registered async tasks once.

This function updates all registered async runners (fetch, timers, etc.) and is automatically called during:

Note
This replaces the old fetch_update() function with a generic approach

Definition at line 63 of file async.cpp.

63 {
66}
void update_all()
Update all registered async runners.
Definition async.cpp:33

References fl::AsyncManager::instance(), fl::Scheduler::instance(), fl::Scheduler::update(), and fl::AsyncManager::update_all().

Referenced by async_yield(), fetch_update(), loop(), and fl::FetchEngineListener::onEndFrame().

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

◆ async_yield()

void fl::async_yield ( )

Platform-specific async yield function.

This function pumps all async tasks and yields control appropriately for the platform:

This centralizes platform-specific async behavior instead of having #ifdef in generic code.

Definition at line 68 of file async.cpp.

68 {
69 // Always pump all async tasks first
70 async_run();
71
72 // Platform-specific yielding behavior
73#ifdef __EMSCRIPTEN__
74 // WASM: Use emscripten_sleep to yield control to browser event loop
75 emscripten_sleep(1); // Sleep for 1ms to yield to browser
76#endif
77 for (int i = 0; i < 5; ++i) {
78 async_run(); // Give other async tasks a chance
79 }
80}
void async_run()
Run all registered async tasks once.
Definition async.cpp:63

References async_run().

Referenced by await_top_level().

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

◆ available()

int fl::available ( )

Definition at line 117 of file io.cpp.

117 {
118#ifdef FASTLED_TESTING
119 // Check for injected handler first
120 if (get_available_handler()) {
121 return get_available_handler()();
122 }
123#endif
124
125#ifdef __EMSCRIPTEN__
126 return available_wasm();
127#elif defined(FASTLED_TESTING) || defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
128 return available_native();
129#elif defined(ESP32) || defined(ESP8266)
130 return available_esp();
131#elif defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)
132 return available_avr();
133#elif defined(__MKL26Z64__)
134 // Teensy LC uses special no-op functions to avoid _write linker issues
135 return available_teensy_lc();
136#elif defined(__IMXRT1062__) || defined(__MK66FX1M0__) || defined(__MK64FX512__) || defined(__MK20DX256__) || defined(__MK20DX128__)
137 // All other Teensy platforms use lightweight implementation
138 return available_teensy();
139#else
140 // Use generic Arduino input for all other platforms including:
141 // - STM32 (STM32F1, STM32F4, STM32H7, ARDUINO_GIGA)
142 // - NRF (NRF52, NRF52832, NRF52840, ARDUINO_NRF52_DK)
143 // - All other Arduino-compatible platforms
144 return available_arduino();
145#endif
146}

Referenced by fl::istream_real::eof(), fl::istream_real::get(), fl::istream_real::getline(), fl::istream_real::operator>>(), fl::istream_real::peek(), fl::ByteStreamMemory::read(), fl::istream_real::readLine(), fl::istream_real::readToken(), and fl::istream_real::skipWhitespace().

+ Here is the caller graph for this function:

◆ await_top_level()

template<typename T>
fl::result< T > fl::await_top_level ( fl::promise< T > promise)

Synchronously wait for a promise to complete (ONLY safe in top-level contexts)

Template Parameters
TThe type of value the promise resolves to (automatically deduced)
Parameters
promiseThe promise to wait for
Returns
A PromiseResult containing either the resolved value T or an Error

This function blocks until the promise is either resolved or rejected, then returns a PromiseResult that can be checked with ok() for success/failure. While waiting, it continuously calls async_yield() to pump async tasks and yield appropriately.

SAFETY WARNING: This function should ONLY be called from top-level contexts like Arduino loop() function. Never call this from:

The "_top_level" suffix emphasizes this safety requirement.

Type Deduction: The template parameter T is automatically deduced from the promise parameter, so you don't need to specify it explicitly.

Usage

auto promise = fl::fetch_get("http://example.com");
auto result = fl::await_top_level(promise); // Type automatically deduced!
if (result.ok()) {
const Response& resp = result.value();
FL_WARN("Success: " << resp.text());
} else {
FL_WARN("Error: " << result.error().message);
}
// Or use operator bool
if (result) {
FL_WARN("Got response: " << result.value().status());
}
// You can still specify the type explicitly if needed:
auto explicit_result = fl::await_top_level<response>(promise);
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Definition promise.h:72
const T & value() const
Get the success value (const)
bool ok() const
Check if the result is successful.
fl::result< T > await_top_level(fl::promise< T > promise)
Synchronously wait for a promise to complete (ONLY safe in top-level contexts)
Definition async.h:175
fl::promise< response > fetch_get(const fl::string &url, const fetch_options &request)
HTTP GET request.
Definition fetch.cpp:180
#define FL_WARN
Definition warn.h:12

Definition at line 175 of file async.h.

175 {
176 // Handle invalid promises
177 if (!promise.valid()) {
178 return fl::result<T>(Error("Invalid promise"));
179 }
180
181 // If already completed, return immediately
182 if (promise.is_completed()) {
183 if (promise.is_resolved()) {
184 return fl::result<T>(promise.value());
185 } else {
186 return fl::result<T>(promise.error());
187 }
188 }
189
190 // Track recursion depth to prevent infinite loops
191 static fl::ThreadLocal<int> await_depth(0);
192 if (await_depth.access() > 10) {
193 return fl::result<T>(Error("await_top_level recursion limit exceeded - possible infinite loop"));
194 }
195
196 ++await_depth.access();
197
198 // Wait for promise to complete while pumping async tasks
199 int pump_count = 0;
200 const int max_pump_iterations = 10000; // Safety limit
201
202 while (!promise.is_completed() && pump_count < max_pump_iterations) {
203 // Update the promise first (in case it's not managed by async system)
204 promise.update();
205
206 // Check if completed after update
207 if (promise.is_completed()) {
208 break;
209 }
210
211 // Platform-agnostic async pump and yield
212 async_yield();
213
214 ++pump_count;
215 }
216
217 --await_depth.access();
218
219 // Check for timeout
220 if (pump_count >= max_pump_iterations) {
221 return fl::result<T>(Error("await_top_level timeout - promise did not complete"));
222 }
223
224 // Return the result
225 if (promise.is_resolved()) {
226 return fl::result<T>(promise.value());
227 } else {
228 return fl::result<T>(promise.error());
229 }
230}
const Error & error() const
Get the error (only valid if is_rejected() returns true)
Definition promise.h:181
void update()
Update promise state in main loop - should be called periodically This processes pending callbacks wh...
Definition promise.h:148
bool is_resolved() const
Check if promise is resolved (completed successfully)
Definition promise.h:160
bool valid() const
Check if promise is valid.
Definition promise.h:122
const T & value() const
Get the result value (only valid if is_resolved() returns true)
Definition promise.h:172
bool is_completed() const
Check if promise is completed (resolved or rejected)
Definition promise.h:154
ThreadLocalFake< T > ThreadLocal

References fl::ThreadLocalFake< T >::access(), async_yield(), fl::promise< T >::error(), fl::promise< T >::is_completed(), fl::promise< T >::is_resolved(), fl::promise< T >::update(), fl::promise< T >::valid(), and fl::promise< T >::value().

Referenced by test_await_approach(), and test_json_await().

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

◆ begin() [1/3]

template<typename Container>
auto fl::begin ( const Container & c) -> decltype(c.begin())
constexpr

Definition at line 27 of file range_access.h.

27 {
28 return c.begin();
29}

◆ begin() [2/3]

template<typename Container>
auto fl::begin ( Container & c) -> decltype(c.begin())
constexpr

Definition at line 21 of file range_access.h.

21 {
22 return c.begin();
23}

◆ begin() [3/3]

template<typename T, fl::size N>
T * fl::begin ( T(&) array[N])
constexprnoexcept

Definition at line 9 of file range_access.h.

9 {
10 return array;
11}
A fixed-size array implementation similar to std::array.
Definition array.h:27

Referenced by fl::UIDropdownImpl::UIDropdownImpl(), fl::AudioSampleImpl::assign(), LedRopeTCL::Draw(), LedRopeTCL::DrawSequentialRepeat(), FASTLED_SMART_PTR(), fl::InlinedVector< T, INLINED_SIZE >::find_if(), fl::InlinedMemoryBlock< T, N >::memory(), and fl::InlinedMemoryBlock< T, N >::memory().

+ Here is the caller graph for this function:

◆ bilinearInterpolate()

u8 fl::bilinearInterpolate ( u8 v00,
u8 v10,
u8 v01,
u8 v11,
u16 dx,
u16 dy )

Definition at line 151 of file upscale.cpp.

152 {
153 u16 dx_inv = 256 - dx;
154 u16 dy_inv = 256 - dy;
155
156 u32 w00 = (u32)dx_inv * dy_inv;
157 u32 w10 = (u32)dx * dy_inv;
158 u32 w01 = (u32)dx_inv * dy;
159 u32 w11 = (u32)dx * dy;
160
161 u32 sum = v00 * w00 + v10 * w10 + v01 * w01 + v11 * w11;
162
163 // Normalize the result by dividing by 65536 (shift right by 16 bits),
164 // with rounding
165 u8 result = (u8)((sum + 32768) >> 16);
166
167 return result;
168}

Referenced by upscaleArbitrary(), and upscaleRectangular().

+ Here is the caller graph for this function:

◆ bilinearInterpolatePowerOf2()

u8 fl::bilinearInterpolatePowerOf2 ( u8 v00,
u8 v10,
u8 v01,
u8 v11,
u8 dx,
u8 dy )

Definition at line 222 of file upscale.cpp.

223 {
224 u16 dx_inv = 256 - dx; // 0 to 256
225 u16 dy_inv = 256 - dy; // 0 to 256
226
227 // Scale down weights to fit into u16
228 u16 w00 = (dx_inv * dy_inv) >> 8; // Max value 256
229 u16 w10 = (dx * dy_inv) >> 8;
230 u16 w01 = (dx_inv * dy) >> 8;
231 u16 w11 = (dx * dy) >> 8;
232
233 // Sum of weights should be approximately 256
234 u16 weight_sum = w00 + w10 + w01 + w11;
235
236 // Compute the weighted sum of pixel values
237 u16 sum = v00 * w00 + v10 * w10 + v01 * w01 + v11 * w11;
238
239 // Normalize the result
240 u8 result = (sum + (weight_sum >> 1)) / weight_sum;
241
242 return result;
243}

Referenced by upscalePowerOf2(), and upscaleRectangularPowerOf2().

+ Here is the caller graph for this function:

◆ bit_cast()

template<typename To, typename From>
To fl::bit_cast ( const From & from)
noexcept

Definition at line 39 of file bit_cast.h.

39 {
40 static_assert(sizeof(To) == sizeof(From), "bit_cast: types must have the same size");
41 static_assert(is_bitcast_compatible<To>::value, "bit_cast: destination type must be bitcast compatible");
42 static_assert(is_bitcast_compatible<From>::value, "bit_cast: source type must be bitcast compatible");
43
44 union { // robust against strict aliasing rules
45 From from_val;
46 To to_val;
47 } u;
48 u.from_val = from;
49 return u.to_val;
50}
static constexpr bool value
Definition bit_cast.h:19

References fl::is_bitcast_compatible< T >::value.

Referenced by bit_cast_ptr(), bit_cast_ptr(), int_to_ptr(), fl::Hash< float >::operator()(), fl::HashMap< Key, T, Hash, KeyEqual, INLINED_COUNT >::iterator::operator->(), ptr_to_int(), fl::WeakPtr< T >::ptr_value(), and reinterpret_pointer_cast().

+ Here is the caller graph for this function:

◆ bit_cast_ptr() [1/2]

template<typename To>
const To * fl::bit_cast_ptr ( const void * storage)
noexcept

Definition at line 59 of file bit_cast.h.

59 {
60 return bit_cast<const To*>(storage);
61}
To bit_cast(const From &from) noexcept
Definition bit_cast.h:39

References bit_cast().

+ Here is the call graph for this function:

◆ bit_cast_ptr() [2/2]

template<typename To>
To * fl::bit_cast_ptr ( void * storage)
noexcept

Definition at line 54 of file bit_cast.h.

54 {
55 return bit_cast<To*>(storage);
56}

References bit_cast().

Referenced by fl::PSRamAllocator< T >::Alloc(), fl::string::append(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::copy_fn(), fl::SlabAllocator< T, SLAB_SIZE >::deallocate(), fl::SlabAllocator< T, SLAB_SIZE >::deallocateToSlab(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::destroy_fn(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::move_fn(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::ptr(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::ptr(), RGBWEmulatedController< CONTROLLER, RGB_ORDER >::showPixels(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::visit_fn(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::visit_fn_const(), fl::StrN< SIZE >::write(), and fl::StrN< SIZE >::write().

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

◆ blend() [1/4]

CHSV fl::blend ( const CHSV & p1,
const CHSV & p2,
fract8 amountOfP2,
TGradientDirectionCode directionCode )

Definition at line 133 of file colorutils.cpp.

134 {
135 CHSV nu(p1);
136 nblend(nu, p2, amountOfP2, directionCode);
137 return nu;
138}
CRGB & nblend(CRGB &existing, const CRGB &overlay, fract8 amountOfOverlay)
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition hsv.h:15

References nblend().

+ Here is the call graph for this function:

◆ blend() [2/4]

CHSV * fl::blend ( const CHSV * src1,
const CHSV * src2,
CHSV * dest,
fl::u16 count,
fract8 amountOfsrc2,
TGradientDirectionCode directionCode )

Definition at line 140 of file colorutils.cpp.

141 {
142 for (fl::u16 i = 0; i < count; ++i) {
143 dest[i] = blend(src1[i], src2[i], amountOfsrc2, directionCode);
144 }
145 return dest;
146}
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)

References blend().

+ Here is the call graph for this function:

◆ blend() [3/4]

CRGB fl::blend ( const CRGB & p1,
const CRGB & p2,
fract8 amountOfP2 )

Definition at line 61 of file colorutils.cpp.

61 {
62 CRGB nu(p1);
63 nblend(nu, p2, amountOfP2);
64 return nu;
65}

References nblend().

Referenced by blend(), blend(), ColorFromPalette(), ColorFromPalette(), ColorFromPalette(), ColorFromPalette(), ColorFromPalette(), ColorFromPalette(), ColorFromPaletteExtended(), ColorFromPaletteExtended(), ColorFromPaletteExtended(), draw(), fl::TwinkleFox::drawTwinkleFox(), drawTwinkles(), fl::LUT< u16 >::interp16(), fl::LUT< u16 >::interp8(), and MyColorFromPaletteExtended().

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

◆ blend() [4/4]

CRGB * fl::blend ( const CRGB * src1,
const CRGB * src2,
CRGB * dest,
fl::u16 count,
fract8 amountOfsrc2 )

Definition at line 67 of file colorutils.cpp.

68 {
69 for (fl::u16 i = 0; i < count; ++i) {
70 dest[i] = blend(src1[i], src2[i], amountOfsrc2);
71 }
72 return dest;
73}

References blend().

+ Here is the call graph for this function:

◆ blur1d() [1/2]

void fl::blur1d ( CRGB * leds,
fl::u16 numLeds,
fract8 blur_amount )

Definition at line 55 of file blur.cpp.

55 {
56 fl::u8 keep = 255 - blur_amount;
57 fl::u8 seep = blur_amount >> 1;
58 CRGB carryover = CRGB::Black;
59 for (fl::u16 i = 0; i < numLeds; ++i) {
60 CRGB cur = leds[i];
61 CRGB part = cur;
62 part.nscale8(seep);
63 cur.nscale8(keep);
64 cur += carryover;
65 if (i)
66 leds[i - 1] += part;
67 leds[i] = cur;
68 carryover = part;
69 }
70}
CRGB leds[NUM_LEDS]
CRGB & nscale8(fl::u8 scaledown)
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:567

References CRGB::Black, leds, and CRGB::nscale8().

+ Here is the call graph for this function:

◆ blur1d() [2/2]

void fl::blur1d ( CRGB * leds,
u16 numLeds,
fract8 blur_amount )

One-dimensional blur filter.

Spreads light to 2 line neighbors.

Total light is NOT entirely conserved, so many repeated calls to 'blur' will also result in the light fading, eventually all the way to black; this is by design so that it can be used to (slowly) clear the LEDs to black.

Parameters
ledsa pointer to the LED array to blur
numLedsthe number of LEDs to blur
blur_amountthe amount of blur to apply

References leds, and xymap.

◆ blur2d() [1/2]

void fl::blur2d ( CRGB * leds,
fl::u8 width,
fl::u8 height,
fract8 blur_amount )

Legacy version of blur2d, which does not require an XYMap but instead implicitly binds to XY() function.

If you are hitting a linker error here, then use blur2d(..., const fl::XYMap& xymap) instead.

Definition at line 78 of file blur.cpp.

78 {
79 XYMap xy =
80 XYMap::constructWithUserFunction(width, height, xy_legacy_wrapper);
81 blur2d(leds, width, height, blur_amount, xy);
82}
unsigned int xy(unsigned int x, unsigned int y)
static XYMap constructWithUserFunction(u16 width, u16 height, XYFunction xyFunction, u16 offset=0)
Definition xymap.cpp:26
void blur2d(CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xymap)
Two-dimensional blur filter.
Definition blur.cpp:72

References blur2d(), fl::XYMap::constructWithUserFunction(), leds, and xy().

+ Here is the call graph for this function:

◆ blur2d() [2/2]

void fl::blur2d ( CRGB * leds,
fl::u8 width,
fl::u8 height,
fract8 blur_amount,
const fl::XYMap & xymap )

Two-dimensional blur filter.

Spreads light to 8 XY neighbors.

Total light is NOT entirely conserved, so many repeated calls to 'blur' will also result in the light fading, eventually all the way to black; this is by design so that it can be used to (slowly) clear the LEDs to black.

Parameters
ledsa pointer to the LED array to blur
widththe width of the matrix
heightthe height of the matrix
blur_amountthe amount of blur to apply

Definition at line 72 of file blur.cpp.

73 {
74 blurRows(leds, width, height, blur_amount, xymap);
75 blurColumns(leds, width, height, blur_amount, xymap);
76}
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
void blurColumns(CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap)
Perform a blur1d() on every column of a rectangular matrix.
Definition blur.cpp:112
void blurRows(CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap)
Perform a blur1d() on every row of a rectangular matrix.
Definition blur.cpp:84

References blurColumns(), blurRows(), leds, and xymap.

Referenced by blur2d(), fl::Blend2d::draw(), fl::Luminova::draw(), and loop().

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

◆ blurColumns()

void fl::blurColumns ( CRGB * leds,
fl::u8 width,
fl::u8 height,
fract8 blur_amount,
const fl::XYMap & xymap )

Perform a blur1d() on every column of a rectangular matrix.

See also
blur1d()
Parameters
ledsa pointer to the LED array to blur
widththe width of the matrix
heightthe height of the matrix
blur_amountthe amount of blur to apply

Definition at line 112 of file blur.cpp.

113 {
114 // blur columns
115 fl::u8 keep = 255 - blur_amount;
116 fl::u8 seep = blur_amount >> 1;
117 for (fl::u8 col = 0; col < width; ++col) {
118 CRGB carryover = CRGB::Black;
119 for (fl::u8 i = 0; i < height; ++i) {
120 CRGB cur = leds[xyMap.mapToIndex(col, i)];
121 CRGB part = cur;
122 part.nscale8(seep);
123 cur.nscale8(keep);
124 cur += carryover;
125 if (i)
126 leds[xyMap.mapToIndex(col, i - 1)] += part;
127 leds[xyMap.mapToIndex(col, i)] = cur;
128 carryover = part;
129 }
130 }
131}
fl::XYMap xyMap
Definition ColorBoost.h:61

References CRGB::Black, leds, CRGB::nscale8(), and xyMap.

Referenced by blur2d().

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

◆ blurRows()

void fl::blurRows ( CRGB * leds,
fl::u8 width,
fl::u8 height,
fract8 blur_amount,
const fl::XYMap & xymap )

Perform a blur1d() on every row of a rectangular matrix.

See also
blur1d()
Parameters
ledsa pointer to the LED array to blur
widththe width of the matrix
heightthe height of the matrix
blur_amountthe amount of blur to apply

Definition at line 84 of file blur.cpp.

85 {
86
87 /* for( fl::u8 row = 0; row < height; row++) {
88 CRGB* rowbase = leds + (row * width);
89 blur1d( rowbase, width, blur_amount);
90 }
91 */
92 // blur rows same as columns, for irregular matrix
93 fl::u8 keep = 255 - blur_amount;
94 fl::u8 seep = blur_amount >> 1;
95 for (fl::u8 row = 0; row < height; row++) {
96 CRGB carryover = CRGB::Black;
97 for (fl::u8 i = 0; i < width; i++) {
98 CRGB cur = leds[xyMap.mapToIndex(i, row)];
99 CRGB part = cur;
100 part.nscale8(seep);
101 cur.nscale8(keep);
102 cur += carryover;
103 if (i)
104 leds[xyMap.mapToIndex(i - 1, row)] += part;
105 leds[xyMap.mapToIndex(i, row)] = cur;
106 carryover = part;
107 }
108 }
109}

References CRGB::Black, leds, CRGB::nscale8(), and xyMap.

Referenced by blur2d().

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

◆ calculateCorkscrewHeight()

fl::u16 fl::calculateCorkscrewHeight ( float totalTurns,
fl::u16 numLeds )
constexpr

Definition at line 57 of file corkscrew.h.

57 {
58 return (calculateCorkscrewWidth(totalTurns, numLeds) * static_cast<int>(ceil_constexpr(totalTurns)) > numLeds) ?
59 static_cast<fl::u16>(ceil_constexpr(static_cast<float>(numLeds) / static_cast<float>(calculateCorkscrewWidth(totalTurns, numLeds)))) :
60 static_cast<fl::u16>(ceil_constexpr(totalTurns));
61}
constexpr int ceil_constexpr(float value)
Definition math.h:72
constexpr fl::u16 calculateCorkscrewWidth(float totalTurns, fl::u16 numLeds)
Definition corkscrew.h:53
IMPORTANT!
Definition crgb.h:20

References calculateCorkscrewWidth(), and ceil_constexpr().

+ Here is the call graph for this function:

◆ calculateCorkscrewWidth()

fl::u16 fl::calculateCorkscrewWidth ( float totalTurns,
fl::u16 numLeds )
constexpr

Definition at line 53 of file corkscrew.h.

53 {
54 return static_cast<fl::u16>(ceil_constexpr(static_cast<float>(numLeds) / totalTurns));
55}

References ceil_constexpr().

Referenced by calculateCorkscrewHeight().

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

◆ ceil()

template<typename T>
T fl::ceil ( T value)
inline

Definition at line 39 of file math.h.

39 {
40 if (value <= 0) {
41 return static_cast<T>(static_cast<int>(value));
42 }
43 return static_cast<T>(::ceil(static_cast<float>(value)));
44}
T ceil(T value)
Definition math.h:39

References ceil().

Referenced by fl::anonymous_namespace{corkscrew.cpp}::calculateDimensions(), ceil(), and fl::Luminova::plotSoftDot().

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

◆ ceil_constexpr()

int fl::ceil_constexpr ( float value)
constexpr

Definition at line 72 of file math.h.

72 {
73 return static_cast<int>((value > static_cast<float>(static_cast<int>(value)))
74 ? static_cast<int>(value) + 1
75 : static_cast<int>(value));
76}

Referenced by calculateCorkscrewHeight(), and calculateCorkscrewWidth().

+ Here is the caller graph for this function:

◆ cin_real()

istream_real & fl::cin_real ( )

Definition at line 129 of file istream.cpp.

129 {
130 // Local static instance - only constructed when first called
131 // This allows the linker to eliminate it if never referenced
132 static istream_real instance;
133 return instance;
134}

◆ clamp()

template<typename T>
FASTLED_FORCE_INLINE T fl::clamp ( T value,
T min,
T max )

Definition at line 10 of file clamp.h.

10 {
11 if (value < min) {
12 return min;
13 }
14 if (value > max) {
15 return max;
16 }
17 return value;
18}

References FASTLED_FORCE_INLINE.

Referenced by fl::XYPath::calculateSteps(), drawRadialSpectrum(), drawSpectrumBars(), drawWaveform(), FL_DISABLE_WARNING(), fl::wave_detail::float_to_fixed(), fl::MatrixSlice< T >::getLocalCoord(), loop(), fl::XYMap::mapToIndex(), fl::Luminova::plotSoftDot(), fl::WaveSimulation1D::setf(), fl::WaveSimulation2D::setf(), fl::HashMap< Key, T, Hash, KeyEqual >::setLoadFactor(), showGenerative(), and updateAutoGain().

+ Here is the caller graph for this function:

◆ clear() [1/5]

template<typename Container>
void fl::clear ( Container & container)
inline

Definition at line 33 of file clear.h.

33 {
34 container.clear();
35}

◆ clear() [2/5]

template<int N>
void fl::clear ( CRGB(&) arr[N])
inline

Definition at line 13 of file clear.h.

13 {
14 for (int i = 0; i < N; ++i) {
15 arr[i] = CRGB::Black;
16 }
17}

References CRGB::Black.

Referenced by fl::InlinedVector< T, INLINED_SIZE >::assign(), fl::InlinedVector< T, INLINED_SIZE >::assign(), clearLeds(), loop(), and fl::InlinedVector< T, INLINED_SIZE >::operator=().

+ Here is the caller graph for this function:

◆ clear() [3/5]

template<typename T>
void fl::clear ( Grid< T > & grid)
inline

Definition at line 27 of file clear.h.

27 {
28 grid.clear();
29}
void clear()
Definition grid.h:30

References fl::Grid< T >::clear().

+ Here is the call graph for this function:

◆ clear() [4/5]

void fl::clear ( Leds & leds)
inline

Definition at line 19 of file clear.h.

19{ leds.fill(CRGB::Black); }

References CRGB::Black, and leds.

◆ clear() [5/5]

template<fl::size W, fl::size H>
void fl::clear ( LedsXY< W, H > & leds)
inline

Definition at line 22 of file clear.h.

22 {
23 leds.fill(CRGB::Black);
24}

References CRGB::Black, and leds.

◆ ColorFromPalette() [1/8]

CHSV fl::ColorFromPalette ( const CHSVPalette16 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 772 of file colorutils.cpp.

773 {
774 if (blendType == LINEARBLEND_NOWRAP) {
775 index = map8(index, 0, 239); // Blend range is affected by lo4 blend of
776 // values, remap to avoid wrapping
777 }
778
779 // hi4 = index >> 4;
780 fl::u8 hi4 = lsrX4(index);
781 fl::u8 lo4 = index & 0x0F;
782
783 // CRGB rgb1 = pal[ hi4];
784 const CHSV *entry = &(pal[0]) + hi4;
785
786 fl::u8 hue1 = entry->hue;
787 fl::u8 sat1 = entry->sat;
788 fl::u8 val1 = entry->val;
789
790 fl::u8 blend = lo4 && (blendType != NOBLEND);
791
792 if (blend) {
793
794 if (hi4 == 15) {
795 entry = &(pal[0]);
796 } else {
797 ++entry;
798 }
799
800 fl::u8 f2 = lo4 << 4;
801 fl::u8 f1 = 255 - f2;
802
803 fl::u8 hue2 = entry->hue;
804 fl::u8 sat2 = entry->sat;
805 fl::u8 val2 = entry->val;
806
807 // Now some special casing for blending to or from
808 // either black or white. Black and white don't have
809 // proper 'hue' of their own, so when ramping from
810 // something else to/from black/white, we set the 'hue'
811 // of the black/white color to be the same as the hue
812 // of the other color, so that you get the expected
813 // brightness or saturation ramp, with hue staying
814 // constant:
815
816 // If we are starting from white (sat=0)
817 // or black (val=0), adopt the target hue.
818 if (sat1 == 0 || val1 == 0) {
819 hue1 = hue2;
820 }
821
822 // If we are ending at white (sat=0)
823 // or black (val=0), adopt the starting hue.
824 if (sat2 == 0 || val2 == 0) {
825 hue2 = hue1;
826 }
827
828 sat1 = scale8_LEAVING_R1_DIRTY(sat1, f1);
829 val1 = scale8_LEAVING_R1_DIRTY(val1, f1);
830
831 sat2 = scale8_LEAVING_R1_DIRTY(sat2, f2);
832 val2 = scale8_LEAVING_R1_DIRTY(val2, f2);
833
834 // cleanup_R1();
835
836 // These sums can't overflow, so no qadd8 needed.
837 sat1 += sat2;
838 val1 += val2;
839
840 fl::u8 deltaHue = (fl::u8)(hue2 - hue1);
841 if (deltaHue & 0x80) {
842 // go backwards
843 hue1 -= scale8(256 - deltaHue, f2);
844 } else {
845 // go forwards
846 hue1 += scale8(deltaHue, f2);
847 }
848
849 cleanup_R1();
850 }
851
852 if (brightness != 255) {
853 val1 = scale8_video(val1, brightness);
854 }
855
856 return CHSV(hue1, sat1, val1);
857}
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
LIB8STATIC uint8_t map8(uint8_t in, uint8_t rangeStart, uint8_t rangeEnd)
Map from one full-range 8-bit value into a narrower range of 8-bit values, possibly a range of hues.
Definition lib8tion.h:397
LIB8STATIC_ALWAYS_INLINE void cleanup_R1()
Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls.
Definition scale8.h:343
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8() does not clean up the R1 register on AVR.
Definition scale8.h:180
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_video(uint8_t i, fract8 scale)
The "video" version of scale8() guarantees that the output will be only be zero if one or both of the...
Definition scale8.h:127
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
Definition scale8.h:44
fl::u8 lsrX4(fl::u8 dividend)
Helper function to divide a number by 16, aka four logical shift right (LSR)'s.

References blend(), brightness(), cleanup_R1(), lsrX4(), map8(), scale8(), scale8_LEAVING_R1_DIRTY(), and scale8_video().

+ Here is the call graph for this function:

◆ ColorFromPalette() [2/8]

CHSV fl::ColorFromPalette ( const CHSVPalette256 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType  )

Definition at line 952 of file colorutils.cpp.

953 {
954 CHSV hsv = *(&(pal[0]) + index);
955
956 if (brightness != 255) {
957 hsv.value = scale8_video(hsv.value, brightness);
958 }
959
960 return hsv;
961}

References brightness(), and scale8_video().

+ Here is the call graph for this function:

◆ ColorFromPalette() [3/8]

CHSV fl::ColorFromPalette ( const CHSVPalette32 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 859 of file colorutils.cpp.

860 {
861 if (blendType == LINEARBLEND_NOWRAP) {
862 index = map8(index, 0, 247); // Blend range is affected by lo3 blend of
863 // values, remap to avoid wrapping
864 }
865
866 fl::u8 hi5 = index;
867#if defined(__AVR__)
868 hi5 /= 2;
869 hi5 /= 2;
870 hi5 /= 2;
871#else
872 hi5 >>= 3;
873#endif
874 fl::u8 lo3 = index & 0x07;
875
876 fl::u8 hi5XsizeofCHSV = hi5 * sizeof(CHSV);
877 const CHSV *entry = (CHSV *)((fl::u8 *)(&(pal[0])) + hi5XsizeofCHSV);
878
879 fl::u8 hue1 = entry->hue;
880 fl::u8 sat1 = entry->sat;
881 fl::u8 val1 = entry->val;
882
883 fl::u8 blend = lo3 && (blendType != NOBLEND);
884
885 if (blend) {
886
887 if (hi5 == 31) {
888 entry = &(pal[0]);
889 } else {
890 ++entry;
891 }
892
893 fl::u8 f2 = lo3 << 5;
894 fl::u8 f1 = 255 - f2;
895
896 fl::u8 hue2 = entry->hue;
897 fl::u8 sat2 = entry->sat;
898 fl::u8 val2 = entry->val;
899
900 // Now some special casing for blending to or from
901 // either black or white. Black and white don't have
902 // proper 'hue' of their own, so when ramping from
903 // something else to/from black/white, we set the 'hue'
904 // of the black/white color to be the same as the hue
905 // of the other color, so that you get the expected
906 // brightness or saturation ramp, with hue staying
907 // constant:
908
909 // If we are starting from white (sat=0)
910 // or black (val=0), adopt the target hue.
911 if (sat1 == 0 || val1 == 0) {
912 hue1 = hue2;
913 }
914
915 // If we are ending at white (sat=0)
916 // or black (val=0), adopt the starting hue.
917 if (sat2 == 0 || val2 == 0) {
918 hue2 = hue1;
919 }
920
921 sat1 = scale8_LEAVING_R1_DIRTY(sat1, f1);
922 val1 = scale8_LEAVING_R1_DIRTY(val1, f1);
923
924 sat2 = scale8_LEAVING_R1_DIRTY(sat2, f2);
925 val2 = scale8_LEAVING_R1_DIRTY(val2, f2);
926
927 // cleanup_R1();
928
929 // These sums can't overflow, so no qadd8 needed.
930 sat1 += sat2;
931 val1 += val2;
932
933 fl::u8 deltaHue = (fl::u8)(hue2 - hue1);
934 if (deltaHue & 0x80) {
935 // go backwards
936 hue1 -= scale8(256 - deltaHue, f2);
937 } else {
938 // go forwards
939 hue1 += scale8(deltaHue, f2);
940 }
941
942 cleanup_R1();
943 }
944
945 if (brightness != 255) {
946 val1 = scale8_video(val1, brightness);
947 }
948
949 return CHSV(hue1, sat1, val1);
950}

References blend(), brightness(), cleanup_R1(), map8(), scale8(), scale8_LEAVING_R1_DIRTY(), and scale8_video().

+ Here is the call graph for this function:

◆ ColorFromPalette() [4/8]

CRGB fl::ColorFromPalette ( const CRGBPalette16 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 300 of file colorutils.cpp.

301 {
302 if (blendType == LINEARBLEND_NOWRAP) {
303 index = map8(index, 0, 239); // Blend range is affected by lo4 blend of
304 // values, remap to avoid wrapping
305 }
306
307 // hi4 = index >> 4;
308 fl::u8 hi4 = lsrX4(index);
309 fl::u8 lo4 = index & 0x0F;
310
311 // const CRGB* entry = &(pal[0]) + hi4;
312 // since hi4 is always 0..15, hi4 * sizeof(CRGB) can be a single-byte value,
313 // instead of the two byte 'int' that avr-gcc defaults to.
314 // So, we multiply hi4 X sizeof(CRGB), giving hi4XsizeofCRGB;
315 fl::u8 hi4XsizeofCRGB = hi4 * sizeof(CRGB);
316 // We then add that to a base array pointer.
317 const CRGB *entry = (CRGB *)((fl::u8 *)(&(pal[0])) + hi4XsizeofCRGB);
318
319 fl::u8 blend = lo4 && (blendType != NOBLEND);
320
321 fl::u8 red1 = entry->red;
322 fl::u8 green1 = entry->green;
323 fl::u8 blue1 = entry->blue;
324
325 if (blend) {
326
327 if (hi4 == 15) {
328 entry = &(pal[0]);
329 } else {
330 ++entry;
331 }
332
333 fl::u8 f2 = lo4 << 4;
334 fl::u8 f1 = 255 - f2;
335
336 // rgb1.nscale8(f1);
337 fl::u8 red2 = entry->red;
338 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
339 red2 = scale8_LEAVING_R1_DIRTY(red2, f2);
340 red1 += red2;
341
342 fl::u8 green2 = entry->green;
343 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
344 green2 = scale8_LEAVING_R1_DIRTY(green2, f2);
345 green1 += green2;
346
347 fl::u8 blue2 = entry->blue;
348 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
349 blue2 = scale8_LEAVING_R1_DIRTY(blue2, f2);
350 blue1 += blue2;
351
352 cleanup_R1();
353 }
354
355 if (brightness != 255) {
356 if (brightness) {
357 ++brightness; // adjust for rounding
358 // Now, since brightness is nonzero, we don't need the full
359 // scale8_video logic; we can just to scale8 and then add one
360 // (unless scale8 fixed) to all nonzero inputs.
361 if (red1) {
363#if !(FASTLED_SCALE8_FIXED == 1)
364 ++red1;
365#endif
366 }
367 if (green1) {
368 green1 = scale8_LEAVING_R1_DIRTY(green1, brightness);
369#if !(FASTLED_SCALE8_FIXED == 1)
370 ++green1;
371#endif
372 }
373 if (blue1) {
374 blue1 = scale8_LEAVING_R1_DIRTY(blue1, brightness);
375#if !(FASTLED_SCALE8_FIXED == 1)
376 ++blue1;
377#endif
378 }
379 cleanup_R1();
380 } else {
381 red1 = 0;
382 green1 = 0;
383 blue1 = 0;
384 }
385 }
386
387 return CRGB(red1, green1, blue1);
388}

References blend(), brightness(), cleanup_R1(), lsrX4(), map8(), and scale8_LEAVING_R1_DIRTY().

Referenced by fl::DemoReel100::bpm(), computeOneTwinkle(), fl::TwinkleFox::computeOneTwinkle(), fl::Fire2012::draw(), fillFrameBufferFire(), fillFrameBufferNoise(), Fire2023(), loop(), fl::NoisePalette::mapNoiseToLEDsUsingPalette(), fl::Pacifica::pacifica_one_layer(), UpscalePalette(), UpscalePalette(), UpscalePalette(), and UpscalePalette().

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

◆ ColorFromPalette() [5/8]

CRGB fl::ColorFromPalette ( const CRGBPalette256 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType  )

Definition at line 705 of file colorutils.cpp.

706 {
707 const CRGB *entry = &(pal[0]) + index;
708
709 fl::u8 red = entry->red;
710 fl::u8 green = entry->green;
711 fl::u8 blue = entry->blue;
712
713 if (brightness != 255) {
714 ++brightness; // adjust for rounding
718 cleanup_R1();
719 }
720
721 return CRGB(red, green, blue);
722}
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_video_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8_video() does not clean up the R1 register on AVR.
Definition scale8.h:272

References brightness(), cleanup_R1(), and scale8_video_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ ColorFromPalette() [6/8]

CRGB fl::ColorFromPalette ( const CRGBPalette32 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 521 of file colorutils.cpp.

522 {
523 if (blendType == LINEARBLEND_NOWRAP) {
524 index = map8(index, 0, 247); // Blend range is affected by lo3 blend of
525 // values, remap to avoid wrapping
526 }
527
528 fl::u8 hi5 = index;
529#if defined(__AVR__)
530 hi5 /= 2;
531 hi5 /= 2;
532 hi5 /= 2;
533#else
534 hi5 >>= 3;
535#endif
536 fl::u8 lo3 = index & 0x07;
537
538 // const CRGB* entry = &(pal[0]) + hi5;
539 // since hi5 is always 0..31, hi4 * sizeof(CRGB) can be a single-byte value,
540 // instead of the two byte 'int' that avr-gcc defaults to.
541 // So, we multiply hi5 X sizeof(CRGB), giving hi5XsizeofCRGB;
542 fl::u8 hi5XsizeofCRGB = hi5 * sizeof(CRGB);
543 // We then add that to a base array pointer.
544 const CRGB *entry = (CRGB *)((fl::u8 *)(&(pal[0])) + hi5XsizeofCRGB);
545
546 fl::u8 red1 = entry->red;
547 fl::u8 green1 = entry->green;
548 fl::u8 blue1 = entry->blue;
549
550 fl::u8 blend = lo3 && (blendType != NOBLEND);
551
552 if (blend) {
553
554 if (hi5 == 31) {
555 entry = &(pal[0]);
556 } else {
557 ++entry;
558 }
559
560 fl::u8 f2 = lo3 << 5;
561 fl::u8 f1 = 255 - f2;
562
563 fl::u8 red2 = entry->red;
564 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
565 red2 = scale8_LEAVING_R1_DIRTY(red2, f2);
566 red1 += red2;
567
568 fl::u8 green2 = entry->green;
569 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
570 green2 = scale8_LEAVING_R1_DIRTY(green2, f2);
571 green1 += green2;
572
573 fl::u8 blue2 = entry->blue;
574 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
575 blue2 = scale8_LEAVING_R1_DIRTY(blue2, f2);
576 blue1 += blue2;
577
578 cleanup_R1();
579 }
580
581 if (brightness != 255) {
582 if (brightness) {
583 ++brightness; // adjust for rounding
584 // Now, since brightness is nonzero, we don't need the full
585 // scale8_video logic; we can just to scale8 and then add one
586 // (unless scale8 fixed) to all nonzero inputs.
587 if (red1) {
589#if !(FASTLED_SCALE8_FIXED == 1)
590 ++red1;
591#endif
592 }
593 if (green1) {
594 green1 = scale8_LEAVING_R1_DIRTY(green1, brightness);
595#if !(FASTLED_SCALE8_FIXED == 1)
596 ++green1;
597#endif
598 }
599 if (blue1) {
600 blue1 = scale8_LEAVING_R1_DIRTY(blue1, brightness);
601#if !(FASTLED_SCALE8_FIXED == 1)
602 ++blue1;
603#endif
604 }
605 cleanup_R1();
606 } else {
607 red1 = 0;
608 green1 = 0;
609 blue1 = 0;
610 }
611 }
612
613 return CRGB(red1, green1, blue1);
614}

References blend(), brightness(), cleanup_R1(), map8(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ ColorFromPalette() [7/8]

CRGB fl::ColorFromPalette ( const TProgmemRGBPalette16 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 438 of file colorutils.cpp.

439 {
440 if (blendType == LINEARBLEND_NOWRAP) {
441 index = map8(index, 0, 239); // Blend range is affected by lo4 blend of
442 // values, remap to avoid wrapping
443 }
444
445 // hi4 = index >> 4;
446 fl::u8 hi4 = lsrX4(index);
447 fl::u8 lo4 = index & 0x0F;
448
449 CRGB entry(FL_PGM_READ_DWORD_NEAR(&(pal[0]) + hi4));
450
451 fl::u8 red1 = entry.red;
452 fl::u8 green1 = entry.green;
453 fl::u8 blue1 = entry.blue;
454
455 fl::u8 blend = lo4 && (blendType != NOBLEND);
456
457 if (blend) {
458
459 if (hi4 == 15) {
460 entry = FL_PGM_READ_DWORD_NEAR(&(pal[0]));
461 } else {
462 entry = FL_PGM_READ_DWORD_NEAR(&(pal[1]) + hi4);
463 }
464
465 fl::u8 f2 = lo4 << 4;
466 fl::u8 f1 = 255 - f2;
467
468 fl::u8 red2 = entry.red;
469 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
470 red2 = scale8_LEAVING_R1_DIRTY(red2, f2);
471 red1 += red2;
472
473 fl::u8 green2 = entry.green;
474 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
475 green2 = scale8_LEAVING_R1_DIRTY(green2, f2);
476 green1 += green2;
477
478 fl::u8 blue2 = entry.blue;
479 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
480 blue2 = scale8_LEAVING_R1_DIRTY(blue2, f2);
481 blue1 += blue2;
482
483 cleanup_R1();
484 }
485
486 if (brightness != 255) {
487 if (brightness) {
488 ++brightness; // adjust for rounding
489 // Now, since brightness is nonzero, we don't need the full
490 // scale8_video logic; we can just to scale8 and then add one
491 // (unless scale8 fixed) to all nonzero inputs.
492 if (red1) {
494#if !(FASTLED_SCALE8_FIXED == 1)
495 ++red1;
496#endif
497 }
498 if (green1) {
499 green1 = scale8_LEAVING_R1_DIRTY(green1, brightness);
500#if !(FASTLED_SCALE8_FIXED == 1)
501 ++green1;
502#endif
503 }
504 if (blue1) {
505 blue1 = scale8_LEAVING_R1_DIRTY(blue1, brightness);
506#if !(FASTLED_SCALE8_FIXED == 1)
507 ++blue1;
508#endif
509 }
510 cleanup_R1();
511 } else {
512 red1 = 0;
513 green1 = 0;
514 blue1 = 0;
515 }
516 }
517
518 return CRGB(red1, green1, blue1);
519}
#define FL_PGM_READ_DWORD_NEAR(x)
Read a double word (32-bit) from PROGMEM memory.

References blend(), brightness(), cleanup_R1(), FL_PGM_READ_DWORD_NEAR, lsrX4(), map8(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ ColorFromPalette() [8/8]

CRGB fl::ColorFromPalette ( const TProgmemRGBPalette32 & pal,
fl::u8 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 616 of file colorutils.cpp.

617 {
618 if (blendType == LINEARBLEND_NOWRAP) {
619 index = map8(index, 0, 247); // Blend range is affected by lo3 blend of
620 // values, remap to avoid wrapping
621 }
622
623 fl::u8 hi5 = index;
624#if defined(__AVR__)
625 hi5 /= 2;
626 hi5 /= 2;
627 hi5 /= 2;
628#else
629 hi5 >>= 3;
630#endif
631 fl::u8 lo3 = index & 0x07;
632
633 CRGB entry(FL_PGM_READ_DWORD_NEAR(&(pal[0]) + hi5));
634
635 fl::u8 red1 = entry.red;
636 fl::u8 green1 = entry.green;
637 fl::u8 blue1 = entry.blue;
638
639 fl::u8 blend = lo3 && (blendType != NOBLEND);
640
641 if (blend) {
642
643 if (hi5 == 31) {
644 entry = FL_PGM_READ_DWORD_NEAR(&(pal[0]));
645 } else {
646 entry = FL_PGM_READ_DWORD_NEAR(&(pal[1]) + hi5);
647 }
648
649 fl::u8 f2 = lo3 << 5;
650 fl::u8 f1 = 255 - f2;
651
652 fl::u8 red2 = entry.red;
653 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
654 red2 = scale8_LEAVING_R1_DIRTY(red2, f2);
655 red1 += red2;
656
657 fl::u8 green2 = entry.green;
658 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
659 green2 = scale8_LEAVING_R1_DIRTY(green2, f2);
660 green1 += green2;
661
662 fl::u8 blue2 = entry.blue;
663 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
664 blue2 = scale8_LEAVING_R1_DIRTY(blue2, f2);
665 blue1 += blue2;
666
667 cleanup_R1();
668 }
669
670 if (brightness != 255) {
671 if (brightness) {
672 ++brightness; // adjust for rounding
673 // Now, since brightness is nonzero, we don't need the full
674 // scale8_video logic; we can just to scale8 and then add one
675 // (unless scale8 fixed) to all nonzero inputs.
676 if (red1) {
678#if !(FASTLED_SCALE8_FIXED == 1)
679 ++red1;
680#endif
681 }
682 if (green1) {
683 green1 = scale8_LEAVING_R1_DIRTY(green1, brightness);
684#if !(FASTLED_SCALE8_FIXED == 1)
685 ++green1;
686#endif
687 }
688 if (blue1) {
689 blue1 = scale8_LEAVING_R1_DIRTY(blue1, brightness);
690#if !(FASTLED_SCALE8_FIXED == 1)
691 ++blue1;
692#endif
693 }
694 cleanup_R1();
695 } else {
696 red1 = 0;
697 green1 = 0;
698 blue1 = 0;
699 }
700 }
701
702 return CRGB(red1, green1, blue1);
703}

References blend(), brightness(), cleanup_R1(), FL_PGM_READ_DWORD_NEAR, map8(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ ColorFromPaletteExtended() [1/3]

CRGB fl::ColorFromPaletteExtended ( const CRGBPalette16 & pal,
fl::u16 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 390 of file colorutils.cpp.

391 {
392 // Extract the four most significant bits of the index as a palette index.
393 fl::u8 index_4bit = index >> 12;
394 // Calculate the 8-bit offset from the palette index.
395 fl::u8 offset = (fl::u8)(index >> 4);
396 // Get the palette entry from the 4-bit index
397 const CRGB *entry = &(pal[0]) + index_4bit;
398 fl::u8 red1 = entry->red;
399 fl::u8 green1 = entry->green;
400 fl::u8 blue1 = entry->blue;
401
402 fl::u8 blend = offset && (blendType != NOBLEND);
403 if (blend) {
404 if (index_4bit == 15) {
405 entry = &(pal[0]);
406 } else {
407 entry++;
408 }
409
410 // Calculate the scaling factor and scaled values for the lower palette
411 // value.
412 fl::u8 f1 = 255 - offset;
413 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
414 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
415 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
416
417 // Calculate the scaled values for the neighbouring palette value.
418 fl::u8 red2 = entry->red;
419 fl::u8 green2 = entry->green;
420 fl::u8 blue2 = entry->blue;
421 red2 = scale8_LEAVING_R1_DIRTY(red2, offset);
422 green2 = scale8_LEAVING_R1_DIRTY(green2, offset);
423 blue2 = scale8_LEAVING_R1_DIRTY(blue2, offset);
424 cleanup_R1();
425
426 // These sums can't overflow, so no qadd8 needed.
427 red1 += red2;
428 green1 += green2;
429 blue1 += blue2;
430 }
431 if (brightness != 255) {
432 // nscale8x3_video(red1, green1, blue1, brightness);
433 nscale8x3(red1, green1, blue1, brightness);
434 }
435 return CRGB(red1, green1, blue1);
436}
UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
LIB8STATIC void nscale8x3(uint8_t &r, uint8_t &g, uint8_t &b, fract8 scale)
Scale three one-byte values by a fourth one, which is treated as the numerator of a fraction whose de...
Definition scale8.h:367

References blend(), brightness(), cleanup_R1(), nscale8x3(), offset(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ ColorFromPaletteExtended() [2/3]

CRGB fl::ColorFromPaletteExtended ( const CRGBPalette256 & pal,
fl::u16 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 724 of file colorutils.cpp.

725 {
726 // Extract the eight most significant bits of the index as a palette index.
727 fl::u8 index_8bit = index >> 8;
728 // Calculate the 8-bit offset from the palette index.
729 fl::u8 offset = index & 0xff;
730 // Get the palette entry from the 8-bit index
731 const CRGB *entry = &(pal[0]) + index_8bit;
732 fl::u8 red1 = entry->red;
733 fl::u8 green1 = entry->green;
734 fl::u8 blue1 = entry->blue;
735
736 fl::u8 blend = offset && (blendType != NOBLEND);
737 if (blend) {
738 if (index_8bit == 255) {
739 entry = &(pal[0]);
740 } else {
741 entry++;
742 }
743
744 // Calculate the scaling factor and scaled values for the lower palette
745 // value.
746 fl::u8 f1 = 255 - offset;
747 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
748 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
749 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
750
751 // Calculate the scaled values for the neighbouring palette value.
752 fl::u8 red2 = entry->red;
753 fl::u8 green2 = entry->green;
754 fl::u8 blue2 = entry->blue;
755 red2 = scale8_LEAVING_R1_DIRTY(red2, offset);
756 green2 = scale8_LEAVING_R1_DIRTY(green2, offset);
757 blue2 = scale8_LEAVING_R1_DIRTY(blue2, offset);
758 cleanup_R1();
759
760 // These sums can't overflow, so no qadd8 needed.
761 red1 += red2;
762 green1 += green2;
763 blue1 += blue2;
764 }
765 if (brightness != 255) {
766 // nscale8x3_video(red1, green1, blue1, brightness);
767 nscale8x3(red1, green1, blue1, brightness);
768 }
769 return CRGB(red1, green1, blue1);
770}

References blend(), brightness(), cleanup_R1(), nscale8x3(), offset(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ ColorFromPaletteExtended() [3/3]

CRGB fl::ColorFromPaletteExtended ( const CRGBPalette32 & pal,
fl::u16 index,
fl::u8 brightness,
TBlendType blendType )

Definition at line 253 of file colorutils.cpp.

254 {
255 // Extract the five most significant bits of the index as a palette index.
256 fl::u8 index_5bit = (index >> 11);
257 // Calculate the 8-bit offset from the palette index.
258 fl::u8 offset = (fl::u8)(index >> 3);
259 // Get the palette entry from the 5-bit index
260 const CRGB *entry = &(pal[0]) + index_5bit;
261 fl::u8 red1 = entry->red;
262 fl::u8 green1 = entry->green;
263 fl::u8 blue1 = entry->blue;
264
265 fl::u8 blend = offset && (blendType != NOBLEND);
266 if (blend) {
267 if (index_5bit == 31) {
268 entry = &(pal[0]);
269 } else {
270 entry++;
271 }
272
273 // Calculate the scaling factor and scaled values for the lower palette
274 // value.
275 fl::u8 f1 = 255 - offset;
276 red1 = scale8_LEAVING_R1_DIRTY(red1, f1);
277 green1 = scale8_LEAVING_R1_DIRTY(green1, f1);
278 blue1 = scale8_LEAVING_R1_DIRTY(blue1, f1);
279
280 // Calculate the scaled values for the neighbouring palette value.
281 fl::u8 red2 = entry->red;
282 fl::u8 green2 = entry->green;
283 fl::u8 blue2 = entry->blue;
284 red2 = scale8_LEAVING_R1_DIRTY(red2, offset);
285 green2 = scale8_LEAVING_R1_DIRTY(green2, offset);
286 blue2 = scale8_LEAVING_R1_DIRTY(blue2, offset);
287 cleanup_R1();
288
289 // These sums can't overflow, so no qadd8 needed.
290 red1 += red2;
291 green1 += green2;
292 blue1 += blue2;
293 }
294 if (brightness != 255) {
295 nscale8x3_video(red1, green1, blue1, brightness);
296 }
297 return CRGB(red1, green1, blue1);
298}
LIB8STATIC void nscale8x3_video(uint8_t &r, uint8_t &g, uint8_t &b, fract8 scale)
Scale three one-byte values by a fourth one, which is treated as the numerator of a fraction whose de...
Definition scale8.h:401

References blend(), brightness(), cleanup_R1(), nscale8x3_video(), offset(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ const_pointer_cast()

template<typename T, typename Y>
shared_ptr< T > fl::const_pointer_cast ( const shared_ptr< Y > & other)
noexcept

Definition at line 458 of file shared_ptr.h.

458 {
459 auto ptr = const_cast<T*>(other.get());
461}
T * get() const noexcept
Definition shared_ptr.h:271
detail::ControlBlockBase * control_block_
Definition shared_ptr.h:109

◆ cos16lut()

static FASTLED_FORCE_INLINE i16 fl::cos16lut ( u16 angle)
static

Definition at line 64 of file sin32.h.

64 {
65 u8 angle256 = angle / 256;
66 i32 subAngle = angle % 256;
67 return (cosArray[angle256] * (256 - subAngle) +
68 cosArray[angle256 + 1] * subAngle) /
69 256;
70}
const i16 * cosArray
Definition sin32.cpp:48

References cosArray, and FASTLED_FORCE_INLINE.

◆ cos32()

static FASTLED_FORCE_INLINE i32 fl::cos32 ( u32 angle)
static

Definition at line 45 of file sin32.h.

45 {
46 u8 angle256 = angle / 65536;
47 i32 subAngle = angle % 65536;
48 return cosArray[angle256] * (65536 - subAngle) +
49 cosArray[angle256 + 1] * subAngle;
50}

References cosArray, and FASTLED_FORCE_INLINE.

Referenced by easeInOutSine16(), and easeInSine16().

+ Here is the caller graph for this function:

◆ declval()

template<typename T>
add_rvalue_reference< T >::type fl::declval ( )
noexcept

◆ default_random()

fl_random & fl::default_random ( )

Global default random number generator instance.

This provides a convenient global instance that can be used when you don't need to manage multiple separate random generators.

// Using the global instance
auto value = fl::default_random()();
fl::shuffle(vec.begin(), vec.end(), fl::default_random());
void shuffle(Iterator first, Iterator last, RandomGenerator &g)
Definition algorithm.h:527
fl_random & default_random()
Global default random number generator instance.
Definition random.cpp:8

Definition at line 8 of file random.cpp.

8 {
9 static ThreadLocal<fl_random> instance;
10 return instance.access();
11}

References fl::ThreadLocalFake< T >::access().

Referenced by shuffle().

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

◆ downscale()

void fl::downscale ( const CRGB * src,
const XYMap & srcXY,
CRGB * dst,
const XYMap & dstXY )

Definition at line 154 of file downscale.cpp.

155 {
156 fl::u16 srcWidth = srcXY.getWidth();
157 fl::u16 srcHeight = srcXY.getHeight();
158 fl::u16 dstWidth = dstXY.getWidth();
159 fl::u16 dstHeight = dstXY.getHeight();
160
161 FASTLED_ASSERT(dstWidth <= srcWidth,
162 "Destination width must be <= source width");
163 FASTLED_ASSERT(dstHeight <= srcHeight,
164 "Destination height must be <= source height");
165 const bool destination_is_half_of_source =
166 (dstWidth * 2 == srcWidth) && (dstHeight * 2 == srcHeight);
167 // Attempt to use the downscaleHalf function if the destination is half the
168 // size of the source.
169 if (destination_is_half_of_source) {
170 const bool both_rectangles = (srcXY.getType() == XYMap::kLineByLine) &&
171 (dstXY.getType() == XYMap::kLineByLine);
172 if (both_rectangles) {
173 // If both source and destination are rectangular, we can use the
174 // optimized version
175 downscaleHalf(src, srcWidth, srcHeight, dst);
176 } else {
177 // Otherwise, we need to use the mapped version
178 downscaleHalf(src, srcXY, dst, dstXY);
179 }
180 return;
181 }
182
183 downscaleArbitrary(src, srcXY, dst, dstXY);
184}
XyMapType getType() const
Definition xymap.cpp:128
u16 getWidth() const
Definition xymap.cpp:122
@ kLineByLine
Definition xymap.h:47
u16 getHeight() const
Definition xymap.cpp:124
void downscaleArbitrary(const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY)
Definition downscale.cpp:82
void downscaleHalf(const CRGB *src, fl::u16 srcWidth, fl::u16 srcHeight, CRGB *dst)
Definition downscale.cpp:18

References downscaleArbitrary(), downscaleHalf(), fl::XYMap::getHeight(), fl::XYMap::getType(), fl::XYMap::getWidth(), and fl::XYMap::kLineByLine.

Referenced by CRGB::downscale(), and loop().

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

◆ downscaleArbitrary()

void fl::downscaleArbitrary ( const CRGB * src,
const XYMap & srcXY,
CRGB * dst,
const XYMap & dstXY )

Definition at line 82 of file downscale.cpp.

83 {
84 const fl::u16 srcWidth = srcXY.getWidth();
85 const fl::u16 srcHeight = srcXY.getHeight();
86 const fl::u16 dstWidth = dstXY.getWidth();
87 const fl::u16 dstHeight = dstXY.getHeight();
88
89 const fl::u32 FP_ONE = 256; // Q8.8 fixed-point multiplier
90
91 FASTLED_ASSERT(dstWidth <= srcWidth,
92 "Destination width must be <= source width");
93 FASTLED_ASSERT(dstHeight <= srcHeight,
94 "Destination height must be <= source height");
95
96 for (fl::u16 dy = 0; dy < dstHeight; ++dy) {
97 // Fractional boundaries in Q8.8
98 fl::u32 dstY0 = (dy * srcHeight * FP_ONE) / dstHeight;
99 fl::u32 dstY1 = ((dy + 1) * srcHeight * FP_ONE) / dstHeight;
100
101 for (fl::u16 dx = 0; dx < dstWidth; ++dx) {
102 fl::u32 dstX0 = (dx * srcWidth * FP_ONE) / dstWidth;
103 fl::u32 dstX1 = ((dx + 1) * srcWidth * FP_ONE) / dstWidth;
104
105 fl::u64 rSum = 0, gSum = 0, bSum = 0;
106 fl::u32 totalWeight = 0;
107
108 // Find covered source pixels
109 fl::u16 srcY_start = dstY0 / FP_ONE;
110 fl::u16 srcY_end = (dstY1 + FP_ONE - 1) / FP_ONE; // ceil
111
112 fl::u16 srcX_start = dstX0 / FP_ONE;
113 fl::u16 srcX_end = (dstX1 + FP_ONE - 1) / FP_ONE; // ceil
114
115 for (fl::u16 sy = srcY_start; sy < srcY_end; ++sy) {
116 // Calculate vertical overlap in Q8.8
117 fl::u32 sy0 = sy * FP_ONE;
118 fl::u32 sy1 = (sy + 1) * FP_ONE;
119 fl::u32 y_overlap = MIN(dstY1, sy1) - MAX(dstY0, sy0);
120 if (y_overlap == 0)
121 continue;
122
123 for (fl::u16 sx = srcX_start; sx < srcX_end; ++sx) {
124 fl::u32 sx0 = sx * FP_ONE;
125 fl::u32 sx1 = (sx + 1) * FP_ONE;
126 fl::u32 x_overlap = MIN(dstX1, sx1) - MAX(dstX0, sx0);
127 if (x_overlap == 0)
128 continue;
129
130 fl::u32 weight = (x_overlap * y_overlap + (FP_ONE >> 1)) >>
131 8; // Q8.8 * Q8.8 → Q16.16 → Q8.8
132
133 const CRGB &p = src[srcXY.mapToIndex(sx, sy)];
134 rSum += p.r * weight;
135 gSum += p.g * weight;
136 bSum += p.b * weight;
137 totalWeight += weight;
138 }
139 }
140
141 // Final division, rounding
142 fl::u8 r =
143 totalWeight ? (rSum + (totalWeight >> 1)) / totalWeight : 0;
144 fl::u8 g =
145 totalWeight ? (gSum + (totalWeight >> 1)) / totalWeight : 0;
146 fl::u8 b =
147 totalWeight ? (bSum + (totalWeight >> 1)) / totalWeight : 0;
148
149 dst[dstXY.mapToIndex(dx, dy)] = CRGB(r, g, b);
150 }
151 }
152}
u16 mapToIndex(const u16 &x, const u16 &y) const
Definition xymap.cpp:95
#define MIN(a, b)
Definition math_macros.h:41
#define MAX(a, b)
Definition math_macros.h:37

References fl::XYMap::getHeight(), fl::XYMap::getWidth(), fl::XYMap::mapToIndex(), MAX, and MIN.

Referenced by downscale().

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

◆ downscaleHalf() [1/2]

void fl::downscaleHalf ( const CRGB * src,
const XYMap & srcXY,
CRGB * dst,
const XYMap & dstXY )

Definition at line 47 of file downscale.cpp.

48 {
49 fl::u16 dstWidth = dstXY.getWidth();
50 fl::u16 dstHeight = dstXY.getHeight();
51
52 FASTLED_ASSERT(srcXY.getWidth() == dstXY.getWidth() * 2,
53 "Source width must be double the destination width");
54 FASTLED_ASSERT(srcXY.getHeight() == dstXY.getHeight() * 2,
55 "Source height must be double the destination height");
56
57 for (fl::u16 y = 0; y < dstHeight; ++y) {
58 for (fl::u16 x = 0; x < dstWidth; ++x) {
59 // Map to top-left of the 2x2 block in source
60 fl::u16 srcX = x * 2;
61 fl::u16 srcY = y * 2;
62
63 // Fetch 2x2 block
64 const CRGB &p00 = src[srcXY.mapToIndex(srcX, srcY)];
65 const CRGB &p10 = src[srcXY.mapToIndex(srcX + 1, srcY)];
66 const CRGB &p01 = src[srcXY.mapToIndex(srcX, srcY + 1)];
67 const CRGB &p11 = src[srcXY.mapToIndex(srcX + 1, srcY + 1)];
68
69 // Average each color channel
70 fl::u16 r =
71 (p00.r + p10.r + p01.r + p11.r + 2) / 4; // +2 for rounding
72 fl::u16 g = (p00.g + p10.g + p01.g + p11.g + 2) / 4;
73 fl::u16 b = (p00.b + p10.b + p01.b + p11.b + 2) / 4;
74
75 // Store result
76 dst[dstXY.mapToIndex(x, y)] =
77 CRGB((fl::u8)r, (fl::u8)g, (fl::u8)b);
78 }
79 }
80}
int y
Definition simple.h:93
int x
Definition simple.h:92

References fl::XYMap::getHeight(), fl::XYMap::getWidth(), fl::XYMap::mapToIndex(), x, and y.

+ Here is the call graph for this function:

◆ downscaleHalf() [2/2]

void fl::downscaleHalf ( const CRGB * src,
fl::u16 srcWidth,
fl::u16 srcHeight,
CRGB * dst )

Definition at line 18 of file downscale.cpp.

19 {
20 fl::u16 dstWidth = srcWidth / 2;
21 fl::u16 dstHeight = srcHeight / 2;
22
23 for (fl::u16 y = 0; y < dstHeight; ++y) {
24 for (fl::u16 x = 0; x < dstWidth; ++x) {
25 // Map to top-left of the 2x2 block in source
26 fl::u16 srcX = x * 2;
27 fl::u16 srcY = y * 2;
28
29 // Fetch 2x2 block
30 const CRGB &p00 = src[(srcY)*srcWidth + (srcX)];
31 const CRGB &p10 = src[(srcY)*srcWidth + (srcX + 1)];
32 const CRGB &p01 = src[(srcY + 1) * srcWidth + (srcX)];
33 const CRGB &p11 = src[(srcY + 1) * srcWidth + (srcX + 1)];
34
35 // Average each color channel
36 fl::u16 r =
37 (p00.r + p10.r + p01.r + p11.r + 2) / 4; // +2 for rounding
38 fl::u16 g = (p00.g + p10.g + p01.g + p11.g + 2) / 4;
39 fl::u16 b = (p00.b + p10.b + p01.b + p11.b + 2) / 4;
40
41 // Store result
42 dst[y * dstWidth + x] = CRGB((fl::u8)r, (fl::u8)g, (fl::u8)b);
43 }
44 }
45}

References x, and y.

Referenced by downscale(), and loop().

+ Here is the caller graph for this function:

◆ drawSquare()

void fl::drawSquare ( void * ,
uint16_t ,
uint16_t ,
int ,
int ,
uint32_t ,
uint32_t  )

◆ ease16() [1/2]

void fl::ease16 ( EaseType type,
u16 * src,
u16 * dst,
u16 count )
inline

Definition at line 142 of file ease.h.

142 {
143 switch (type) {
144 case EASE_NONE: return;
145 case EASE_IN_QUAD: {
146 for (u16 i = 0; i < count; i++) {
147 dst[i] = easeInQuad16(src[i]);
148 }
149 break;
150 }
151 case EASE_OUT_QUAD: {
152 for (u16 i = 0; i < count; i++) {
153 dst[i] = easeOutQuad16(src[i]);
154 }
155 break;
156 }
157 case EASE_IN_OUT_QUAD: {
158 for (u16 i = 0; i < count; i++) {
159 dst[i] = easeInOutQuad16(src[i]);
160 }
161 break;
162 }
163 case EASE_IN_CUBIC: {
164 for (u16 i = 0; i < count; i++) {
165 dst[i] = easeInCubic16(src[i]);
166 }
167 break;
168 }
169 case EASE_OUT_CUBIC: {
170 for (u16 i = 0; i < count; i++) {
171 dst[i] = easeOutCubic16(src[i]);
172 }
173 break;
174 }
175 case EASE_IN_OUT_CUBIC: {
176 for (u16 i = 0; i < count; i++) {
177 dst[i] = easeInOutCubic16(src[i]);
178 }
179 break;
180 }
181 case EASE_IN_SINE: {
182 for (u16 i = 0; i < count; i++) {
183 dst[i] = easeInSine16(src[i]);
184 }
185 break;
186 }
187 case EASE_OUT_SINE: {
188 for (u16 i = 0; i < count; i++) {
189 dst[i] = easeOutSine16(src[i]);
190 }
191 break;
192 }
193 case EASE_IN_OUT_SINE: {
194 for (u16 i = 0; i < count; i++) {
195 dst[i] = easeInOutSine16(src[i]);
196 }
197 break;
198 }
199 }
200}
u16 easeInOutSine16(u16 i)
16-bit sine ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
Definition ease.cpp:317
u16 easeOutQuad16(u16 i)
16-bit quadratic ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
Definition ease.cpp:228
u16 easeInSine16(u16 i)
16-bit sine ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
Definition ease.cpp:265
u16 easeOutSine16(u16 i)
16-bit sine ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
Definition ease.cpp:296
u16 easeInOutCubic16(u16 x)
16-bit cubic ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-6553...
Definition ease.cpp:206
u16 easeOutCubic16(u16 i)
16-bit cubic ease-out function Takes an input value 0-65535 and returns an eased value 0-65535
Definition ease.cpp:252
u16 easeInCubic16(u16 i)
16-bit cubic ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
Definition ease.cpp:239
u16 easeInOutQuad16(u16 x)
16-bit quadratic ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-...
Definition ease.cpp:186
u16 easeInQuad16(u16 i)
16-bit quadratic ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
Definition ease.cpp:180

References EASE_IN_CUBIC, EASE_IN_OUT_CUBIC, EASE_IN_OUT_QUAD, EASE_IN_OUT_SINE, EASE_IN_QUAD, EASE_IN_SINE, EASE_NONE, EASE_OUT_CUBIC, EASE_OUT_QUAD, EASE_OUT_SINE, easeInCubic16(), easeInOutCubic16(), easeInOutQuad16(), easeInOutSine16(), easeInQuad16(), easeInSine16(), easeOutCubic16(), easeOutQuad16(), and easeOutSine16().

+ Here is the call graph for this function:

◆ ease16() [2/2]

u16 fl::ease16 ( EaseType type,
u16 i )
inline

Definition at line 126 of file ease.h.

126 {
127 switch (type) {
128 case EASE_NONE: return i;
129 case EASE_IN_QUAD: return easeInQuad16(i);
130 case EASE_OUT_QUAD: return easeOutQuad16(i);
131 case EASE_IN_OUT_QUAD: return easeInOutQuad16(i);
132 case EASE_IN_CUBIC: return easeInCubic16(i);
133 case EASE_OUT_CUBIC: return easeOutCubic16(i);
134 case EASE_IN_OUT_CUBIC: return easeInOutCubic16(i);
135 case EASE_IN_SINE: return easeInSine16(i);
136 case EASE_OUT_SINE: return easeOutSine16(i);
137 case EASE_IN_OUT_SINE: return easeInOutSine16(i);
138 default: return i;
139 }
140}

References EASE_IN_CUBIC, EASE_IN_OUT_CUBIC, EASE_IN_OUT_QUAD, EASE_IN_OUT_SINE, EASE_IN_QUAD, EASE_IN_SINE, EASE_NONE, EASE_OUT_CUBIC, EASE_OUT_QUAD, EASE_OUT_SINE, easeInCubic16(), easeInOutCubic16(), easeInOutQuad16(), easeInOutSine16(), easeInQuad16(), easeInSine16(), easeOutCubic16(), easeOutQuad16(), and easeOutSine16().

Referenced by fl::HSV16::colorBoost(), and loop().

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

◆ ease8() [1/2]

void fl::ease8 ( EaseType type,
u8 * src,
u8 * dst,
u8 count )
inline

Definition at line 218 of file ease.h.

218 {
219 switch (type) {
220 case EASE_NONE: return;
221 case EASE_IN_QUAD: {
222 for (u8 i = 0; i < count; i++) {
223 dst[i] = easeInQuad8(src[i]);
224 }
225 break;
226 }
227 case EASE_OUT_QUAD: {
228 for (u8 i = 0; i < count; i++) {
229 dst[i] = easeOutQuad8(src[i]);
230 }
231 break;
232 }
233 case EASE_IN_OUT_QUAD: {
234 for (u8 i = 0; i < count; i++) {
235 dst[i] = easeInOutQuad8(src[i]);
236 }
237 break;
238 }
239 case EASE_IN_CUBIC: {
240 for (u8 i = 0; i < count; i++) {
241 dst[i] = easeInCubic8(src[i]);
242 }
243 break;
244 }
245 case EASE_OUT_CUBIC: {
246 for (u8 i = 0; i < count; i++) {
247 dst[i] = easeOutCubic8(src[i]);
248 }
249 break;
250 }
251 case EASE_IN_OUT_CUBIC: {
252 for (u8 i = 0; i < count; i++) {
253 dst[i] = easeInOutCubic8(src[i]);
254 }
255 break;
256 }
257 case EASE_IN_SINE: {
258 for (u8 i = 0; i < count; i++) {
259 dst[i] = easeInSine8(src[i]);
260 }
261 break;
262 }
263 case EASE_OUT_SINE: {
264 for (u8 i = 0; i < count; i++) {
265 dst[i] = easeOutSine8(src[i]);
266 }
267 break;
268 }
269 case EASE_IN_OUT_SINE: {
270 for (u8 i = 0; i < count; i++) {
271 dst[i] = easeInOutSine8(src[i]);
272 }
273 break;
274 }
275 }
276}
u8 easeInCubic8(u8 i)
8-bit cubic ease-in function Takes an input value 0-255 and returns an eased value 0-255 More pronoun...
Definition ease.cpp:107
u8 easeInOutSine8(u8 i)
8-bit sine ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 Smoo...
Definition ease.cpp:170
u8 easeOutSine8(u8 i)
8-bit sine ease-out function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinus...
Definition ease.cpp:161
u8 easeOutCubic8(u8 i)
8-bit cubic ease-out function Takes an input value 0-255 and returns an eased value 0-255 More pronou...
Definition ease.cpp:120
u8 easeInSine8(u8 i)
8-bit sine ease-in function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinuso...
Definition ease.cpp:133
u8 easeOutQuad8(u8 i)
8-bit quadratic ease-out function Takes an input value 0-255 and returns an eased value 0-255 The cur...
Definition ease.cpp:98
u8 easeInQuad8(u8 i)
8-bit quadratic ease-in function Takes an input value 0-255 and returns an eased value 0-255 The curv...
Definition ease.cpp:49
u8 easeInOutCubic8(u8 i)
8-bit cubic ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 Mor...
Definition ease.cpp:75
u8 easeInOutQuad8(u8 i)
8-bit quadratic ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255...
Definition ease.cpp:55

References EASE_IN_CUBIC, EASE_IN_OUT_CUBIC, EASE_IN_OUT_QUAD, EASE_IN_OUT_SINE, EASE_IN_QUAD, EASE_IN_SINE, EASE_NONE, EASE_OUT_CUBIC, EASE_OUT_QUAD, EASE_OUT_SINE, easeInCubic8(), easeInOutCubic8(), easeInOutQuad8(), easeInOutSine8(), easeInQuad8(), easeInSine8(), easeOutCubic8(), easeOutQuad8(), and easeOutSine8().

+ Here is the call graph for this function:

◆ ease8() [2/2]

u8 fl::ease8 ( EaseType type,
u8 i )
inline

Definition at line 202 of file ease.h.

202 {
203 switch (type) {
204 case EASE_NONE: return i;
205 case EASE_IN_QUAD: return easeInQuad8(i);
206 case EASE_OUT_QUAD: return easeOutQuad8(i);
207 case EASE_IN_OUT_QUAD: return easeInOutQuad8(i);
208 case EASE_IN_CUBIC: return easeInCubic8(i);
209 case EASE_OUT_CUBIC: return easeOutCubic8(i);
210 case EASE_IN_OUT_CUBIC: return easeInOutCubic8(i);
211 case EASE_IN_SINE: return easeInSine8(i);
212 case EASE_OUT_SINE: return easeOutSine8(i);
213 case EASE_IN_OUT_SINE: return easeInOutSine8(i);
214 default: return i;
215 }
216}

References EASE_IN_CUBIC, EASE_IN_OUT_CUBIC, EASE_IN_OUT_QUAD, EASE_IN_OUT_SINE, EASE_IN_QUAD, EASE_IN_SINE, EASE_NONE, EASE_OUT_CUBIC, EASE_OUT_QUAD, EASE_OUT_SINE, easeInCubic8(), easeInOutCubic8(), easeInOutQuad8(), easeInOutSine8(), easeInQuad8(), easeInSine8(), easeOutCubic8(), easeOutQuad8(), and easeOutSine8().

Referenced by loop().

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

◆ easeInCubic16()

u16 fl::easeInCubic16 ( u16 i)

16-bit cubic ease-in function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 239 of file ease.cpp.

239 {
240 // Simple cubic ease-in: i³ scaled to 16-bit range
241 // y = i³ / MAX²
242 constexpr u32 MAX = 0xFFFF; // 65535
243 constexpr fl::u64 DENOM = (fl::u64)MAX * MAX; // 65535²
244 constexpr fl::u64 ROUND = DENOM >> 1; // for rounding
245
246 fl::u64 ii = i;
247 fl::u64 cube = ii * ii * ii; // i³
248 fl::u64 num = cube + ROUND;
249 return u16(num / DENOM);
250}

References MAX.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function:

◆ easeInCubic8()

u8 fl::easeInCubic8 ( u8 i)

8-bit cubic ease-in function Takes an input value 0-255 and returns an eased value 0-255 More pronounced acceleration than quadratic

Definition at line 107 of file ease.cpp.

107 {
108 // Simple cubic ease-in: i³ scaled to 8-bit range
109 // y = i³ / MAX²
110 constexpr u16 MAX = 0xFF;
111 constexpr u32 DENOM = (u32)MAX * MAX;
112 constexpr u32 ROUND = DENOM >> 1;
113
114 u32 ii = i;
115 u32 cube = ii * ii * ii; // i³
116 u32 num = cube + ROUND;
117 return u8(num / DENOM);
118}

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function:

◆ easeInOutCubic16()

u16 fl::easeInOutCubic16 ( u16 x)

16-bit cubic ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 206 of file ease.cpp.

206 {
207 const u32 MAX = 0xFFFF; // 65535
208 const u32 HALF = (MAX + 1) >> 1; // 32768
209 const fl::u64 M2 = (fl::u64)MAX * MAX; // 65535² = 4 294 836 225
210
211 if (x < HALF) {
212 // first half: y = 4·(x/MAX)³ → y_i = 4·x³ / MAX²
213 fl::u64 xi = x;
214 fl::u64 cube = xi * xi * xi; // x³
215 // add M2/2 for rounding
216 fl::u64 num = 4 * cube + (M2 >> 1);
217 return (u16)(num / M2);
218 } else {
219 // second half: y = 1 − ((2·(1−x/MAX))³)/2
220 // → y_i = MAX − (4·(MAX−x)³ / MAX²)
221 fl::u64 d = MAX - x;
222 fl::u64 cube = d * d * d; // (MAX−x)³
223 fl::u64 num = 4 * cube + (M2 >> 1);
224 return (u16)(MAX - (num / M2));
225 }
226}

References MAX, and x.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function:

◆ easeInOutCubic8()

u8 fl::easeInOutCubic8 ( u8 i)

8-bit cubic ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 More pronounced easing curve than quadratic

Definition at line 75 of file ease.cpp.

75 {
76 constexpr u16 MAX = 0xFF; // 255
77 constexpr u16 HALF = (MAX + 1) >> 1; // 128
78 constexpr u32 DENOM = (u32)MAX * MAX; // 255*255 = 65025
79 constexpr u32 ROUND = DENOM >> 1; // for rounding
80
81 if (i < HALF) {
82 // first half: y = 4·(i/MAX)³ → y_i = 4·i³ / MAX²
83 u32 ii = i;
84 u32 cube = ii * ii * ii; // i³
85 u32 num = 4 * cube + ROUND; // 4·i³, +half denom for rounding
86 return u8(num / DENOM);
87 } else {
88 // second half: y = 1 − ((−2·t+2)³)/2
89 // where t = i/MAX; equivalently:
90 // y_i = MAX − (4·(MAX−i)³ / MAX²)
91 u32 d = MAX - i;
92 u32 cube = d * d * d; // (MAX−i)³
93 u32 num = 4 * cube + ROUND;
94 return u8(MAX - (num / DENOM));
95 }
96}

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function:

◆ easeInOutQuad16()

u16 fl::easeInOutQuad16 ( u16 x)

16-bit quadratic ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 186 of file ease.cpp.

186 {
187 // 16-bit quadratic ease-in / ease-out function
188 constexpr u32 MAX = 0xFFFF; // 65535
189 constexpr u32 HALF = (MAX + 1) >> 1; // 32768
190 constexpr u32 DENOM = MAX; // divisor
191 constexpr u32 ROUND = DENOM >> 1; // for rounding
192
193 if (x < HALF) {
194 // first half: y = 2·(x/MAX)² → y_i = 2·x² / MAX
195 fl::u64 xi = x;
196 fl::u64 num = 2 * xi * xi + ROUND; // 2*x², +half for rounding
197 return u16(num / DENOM);
198 } else {
199 // second half: y = 1 − 2·(1−x/MAX)² → y_i = MAX − (2·(MAX−x)² / MAX)
200 fl::u64 d = MAX - x;
201 fl::u64 num = 2 * d * d + ROUND; // 2*(MAX−x)², +half for rounding
202 return u16(MAX - (num / DENOM));
203 }
204}

References MAX, and x.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function:

◆ easeInOutQuad8()

u8 fl::easeInOutQuad8 ( u8 i)

8-bit quadratic ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 The curve starts slow, accelerates in the middle, then slows down again

Definition at line 55 of file ease.cpp.

55 {
56 constexpr u16 MAX = 0xFF; // 255
57 constexpr u16 HALF = (MAX + 1) >> 1; // 128
58 constexpr u16 DENOM = MAX; // divisor for scaling
59 constexpr u16 ROUND = DENOM >> 1; // for rounding
60
61 if (i < HALF) {
62 // first half: y = 2·(i/MAX)² → y_i = 2·i² / MAX
63 u32 t = i;
64 u32 num = 2 * t * t + ROUND; // 2*i², +half for rounding
65 return u8(num / DENOM);
66 } else {
67 // second half: y = 1 − 2·(1−i/MAX)²
68 // → y_i = MAX − (2·(MAX−i)² / MAX)
69 u32 d = MAX - i;
70 u32 num = 2 * d * d + ROUND; // 2*(MAX−i)², +half for rounding
71 return u8(MAX - (num / DENOM));
72 }
73}
static uint32_t t
Definition Luminova.h:54

References MAX, and t.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function:

◆ easeInOutSine16()

u16 fl::easeInOutSine16 ( u16 i)

16-bit sine ease-in/ease-out function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 317 of file ease.cpp.

317 {
318 // ease-in-out sine: -(cos(π*t) - 1) / 2
319 // Handle boundary conditions explicitly
320 if (i == 0)
321 return 0;
322 if (i == 65535)
323 return 65535;
324
325 // For 16-bit: use cos32 for efficiency and accuracy
326 // Map i from [0,65535] to [0,8388608] in cos32 space (0 to half wave)
327 // Formula: (1 - cos(π*t)) / 2 where t goes from 0 to 1
328 // sin32/cos32 half cycle is 16777216/2 = 8388608
329 u32 angle = ((fl::u64)i * 8388608ULL) / 65535ULL;
330 i32 cos_result = fl::cos32(angle);
331
332 // Convert cos32 output and apply easing formula: (1 - cos(π*t)) / 2
333 // cos32 output range is [-2147418112, 2147418112]
334 // We want: (2147418112 - cos_result) / 2, then scale to [0, 65535]
335 fl::i64 adjusted = (2147418112LL - (fl::i64)cos_result) / 2;
336 return (u16)((fl::u64)adjusted * 65535ULL / 2147418112ULL);
337}
static FASTLED_FORCE_INLINE i32 cos32(u32 angle)
Definition sin32.h:45

References cos32().

Referenced by ease16(), ease16(), and easeInOutSine8().

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

◆ easeInOutSine8()

u8 fl::easeInOutSine8 ( u8 i)

8-bit sine ease-in/ease-out function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinusoidal acceleration and deceleration

Definition at line 170 of file ease.cpp.

170 {
171 // ease-in-out sine: -(cos(π*t) - 1) / 2
172 // Delegate to 16-bit version for consistency and accuracy
173 // Scale 8-bit input to 16-bit range, call 16-bit function, scale result back
174 u16 input16 = map8_to_16(i);
175 u16 result16 = easeInOutSine16(input16);
176 return map16_to_8(result16);
177}
LIB8STATIC_ALWAYS_INLINE uint8_t map16_to_8(uint16_t x)
Definition intmap.h:35
LIB8STATIC_ALWAYS_INLINE uint16_t map8_to_16(uint8_t x)
Definition intmap.h:25

References easeInOutSine16(), map16_to_8(), and map8_to_16().

Referenced by ease8(), and ease8().

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

◆ easeInQuad16()

u16 fl::easeInQuad16 ( u16 i)

16-bit quadratic ease-in function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 180 of file ease.cpp.

180 {
181 // Simple quadratic ease-in: i^2 scaled to 16-bit range
182 // Using scale16(i, i) which computes (i * i) / 65535
183 return scale16(i, i);
184}
LIB8STATIC uint16_t scale16(uint16_t i, fract16 scale)
Scale a 16-bit unsigned value by an 16-bit value, which is treated as the numerator of a fraction who...
Definition scale8.h:551

References scale16().

Referenced by ease16(), and ease16().

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

◆ easeInQuad8()

u8 fl::easeInQuad8 ( u8 i)

8-bit quadratic ease-in function Takes an input value 0-255 and returns an eased value 0-255 The curve starts slow and accelerates (ease-in only)

Definition at line 49 of file ease.cpp.

49 {
50 // Simple quadratic ease-in: i^2 scaled to 8-bit range
51 // Using scale8(i, i) which computes (i * i) / 255
52 return scale8(i, i);
53}

References scale8().

Referenced by ease8(), and ease8().

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

◆ easeInSine16()

u16 fl::easeInSine16 ( u16 i)

16-bit sine ease-in function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 265 of file ease.cpp.

265 {
266 // ease-in sine: 1 - cos(t * π/2)
267 // Handle boundary conditions explicitly
268 if (i == 0)
269 return 0;
270 // Remove the hard-coded boundary for 65535 and let math handle it
271
272 // For 16-bit: use cos32 for efficiency and accuracy
273 // Map i from [0,65535] to [0,4194304] in cos32 space (zero to quarter wave)
274 // Formula: 1 - cos(t * π/2) where t goes from 0 to 1
275 // sin32/cos32 quarter cycle is 16777216/4 = 4194304
276 u32 angle = ((fl::u64)i * 4194304ULL) / 65535ULL;
277 i32 cos_result = fl::cos32(angle);
278
279 // Convert cos32 output and apply easing formula: 1 - cos(t * π/2)
280 // cos32 output range is [-2147418112, 2147418112]
281 // At t=0: cos(0) = 2147418112, result should be 0
282 // At t=1: cos(π/2) = 0, result should be 65535
283
284 const fl::i64 MAX_COS32 = 2147418112LL;
285
286 // Calculate: (MAX_COS32 - cos_result) and scale to [0, 65535]
287 fl::i64 adjusted = MAX_COS32 - (fl::i64)cos_result;
288
289 // Scale from [0, 2147418112] to [0, 65535]
290 fl::u64 result = (fl::u64)adjusted * 65535ULL + (MAX_COS32 >> 1); // Add half for rounding
291 u16 final_result = (u16)(result / (fl::u64)MAX_COS32);
292
293 return final_result;
294}

References cos32().

Referenced by ease16(), and ease16().

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

◆ easeInSine8()

u8 fl::easeInSine8 ( u8 i)

8-bit sine ease-in function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinusoidal acceleration

Definition at line 133 of file ease.cpp.

133 {
134
135 static const u8 easeInSineTable[256] = {
136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
137 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4,
138 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8,
139 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14,
140 15, 16, 16, 17, 17, 18, 18, 19, 20, 20, 21, 21, 22, 23,
141 23, 24, 25, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33,
142 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 42, 43, 44,
143 45, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57,
144 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72,
145 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88,
146 89, 90, 91, 93, 94, 95, 96, 98, 99, 100, 101, 103, 104, 105,
147 106, 108, 109, 110, 112, 113, 114, 115, 117, 118, 119, 121, 122, 123,
148 125, 126, 127, 129, 130, 132, 133, 134, 136, 137, 139, 140, 141, 143,
149 144, 146, 147, 148, 150, 151, 153, 154, 156, 157, 159, 160, 161, 163,
150 164, 166, 167, 169, 170, 172, 173, 175, 176, 178, 179, 181, 182, 184,
151 185, 187, 188, 190, 191, 193, 194, 196, 197, 199, 200, 202, 204, 205,
152 207, 208, 210, 211, 213, 214, 216, 217, 219, 221, 222, 224, 225, 227,
153 228, 230, 231, 233, 235, 236, 238, 239, 241, 242, 244, 246, 247, 249,
154 250, 252, 253, 255};
155
156 // ease-in sine: 1 - cos(t * π/2)
157 // Handle boundary conditions explicitly
158 return easeInSineTable[i];
159}

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function:

◆ easeOutCubic16()

u16 fl::easeOutCubic16 ( u16 i)

16-bit cubic ease-out function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 252 of file ease.cpp.

252 {
253 // ease-out cubic: 1 - (1-t)³
254 // For 16-bit: y = MAX - (MAX-i)³ / MAX²
255 constexpr u32 MAX = 0xFFFF; // 65535
256 constexpr fl::u64 DENOM = (fl::u64)MAX * MAX; // 65535²
257 constexpr fl::u64 ROUND = DENOM >> 1; // for rounding
258
259 fl::u64 d = MAX - i; // (MAX - i)
260 fl::u64 cube = d * d * d; // (MAX-i)³
261 fl::u64 num = cube + ROUND;
262 return u16(MAX - (num / DENOM));
263}

References MAX.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function:

◆ easeOutCubic8()

u8 fl::easeOutCubic8 ( u8 i)

8-bit cubic ease-out function Takes an input value 0-255 and returns an eased value 0-255 More pronounced deceleration than quadratic

Definition at line 120 of file ease.cpp.

120 {
121 // ease-out cubic: 1 - (1-t)³
122 // For 8-bit: y = MAX - (MAX-i)³ / MAX²
123 constexpr u16 MAX = 0xFF;
124 constexpr u32 DENOM = (u32)MAX * MAX;
125 constexpr u32 ROUND = DENOM >> 1;
126
127 u32 d = MAX - i; // (MAX - i)
128 u32 cube = d * d * d; // (MAX-i)³
129 u32 num = cube + ROUND;
130 return u8(MAX - (num / DENOM));
131}

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function:

◆ easeOutQuad16()

u16 fl::easeOutQuad16 ( u16 i)

16-bit quadratic ease-out function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 228 of file ease.cpp.

228 {
229 // ease-out quadratic: 1 - (1-t)²
230 // For 16-bit: y = MAX - (MAX-i)² / MAX
231 constexpr u32 MAX = 0xFFFF; // 65535
232 constexpr u32 ROUND = MAX >> 1; // for rounding
233
234 fl::u64 d = MAX - i; // (MAX - i)
235 fl::u64 num = d * d + ROUND; // (MAX-i)² + rounding
236 return u16(MAX - (num / MAX));
237}

References MAX.

Referenced by ease16(), and ease16().

+ Here is the caller graph for this function:

◆ easeOutQuad8()

u8 fl::easeOutQuad8 ( u8 i)

8-bit quadratic ease-out function Takes an input value 0-255 and returns an eased value 0-255 The curve starts fast and decelerates (ease-out only)

Definition at line 98 of file ease.cpp.

98 {
99 // ease-out is the inverse of ease-in: 1 - (1-t)²
100 // For 8-bit: y = MAX - (MAX-i)² / MAX
101 constexpr u16 MAX = 0xFF;
102 u32 d = MAX - i; // (MAX - i)
103 u32 num = d * d + (MAX >> 1); // (MAX-i)² + rounding
104 return u8(MAX - (num / MAX));
105}

References MAX.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function:

◆ easeOutSine16()

u16 fl::easeOutSine16 ( u16 i)

16-bit sine ease-out function Takes an input value 0-65535 and returns an eased value 0-65535

Definition at line 296 of file ease.cpp.

296 {
297 // ease-out sine: sin(t * π/2)
298 // Handle boundary conditions explicitly
299 if (i == 0)
300 return 0;
301 if (i == 65535)
302 return 65535;
303
304 // For 16-bit: use sin32 for efficiency and accuracy
305 // Map i from [0,65535] to [0,4194304] in sin32 space (zero to quarter wave)
306 // Formula: sin(t * π/2) where t goes from 0 to 1
307 // sin32 quarter cycle is 16777216/4 = 4194304
308 u32 angle = ((fl::u64)i * 4194304ULL) / 65535ULL;
309 i32 sin_result = fl::sin32(angle);
310
311 // Convert sin32 output range [-2147418112, 2147418112] to [0, 65535]
312 // sin32 output is in range -32767*65536 to +32767*65536
313 // For ease-out sine, we only use positive portion [0, 2147418112] -> [0, 65535]
314 return (u16)((fl::u64)sin_result * 65535ULL / 2147418112ULL);
315}
static FASTLED_FORCE_INLINE i32 sin32(u32 angle)
Definition sin32.h:36

References sin32().

Referenced by ease16(), ease16(), and easeOutSine8().

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

◆ easeOutSine8()

u8 fl::easeOutSine8 ( u8 i)

8-bit sine ease-out function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinusoidal deceleration

Definition at line 161 of file ease.cpp.

161 {
162 // ease-out sine: sin(t * π/2)
163 // Delegate to 16-bit version for consistency and accuracy
164 // Scale 8-bit input to 16-bit range, call 16-bit function, scale result back
165 u16 input16 = map8_to_16(i);
166 u16 result16 = easeOutSine16(input16);
167 return map16_to_8(result16);
168}

References easeOutSine16(), map16_to_8(), and map8_to_16().

Referenced by ease8(), and ease8().

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

◆ end() [1/3]

template<typename Container>
auto fl::end ( const Container & c) -> decltype(c.end())
constexpr

Definition at line 39 of file range_access.h.

39 {
40 return c.end();
41}

◆ end() [2/3]

template<typename Container>
auto fl::end ( Container & c) -> decltype(c.end())
constexpr

Definition at line 33 of file range_access.h.

33 {
34 return c.end();
35}

◆ end() [3/3]

template<typename T, fl::size N>
T * fl::end ( T(&) array[N])
constexprnoexcept

Definition at line 15 of file range_access.h.

15 {
16 return array + N;
17}

Referenced by fl::UIDropdownImpl::UIDropdownImpl(), fl::AudioSampleImpl::assign(), LedRopeTCL::Draw(), LedRopeTCL::DrawSequentialRepeat(), FASTLED_SMART_PTR(), fl::InlinedVector< T, INLINED_SIZE >::find_if(), fl::detail::heap_sort(), fl::detail::sift_down(), time_alpha16(), time_alpha8(), time_alphaf(), traverseGridSegment(), traverseGridSegment16(), traverseGridSegment32(), and traverseGridSegmentFloat().

+ Here is the caller graph for this function:

◆ equal() [1/4]

template<typename Iterator1, typename Iterator2>
bool fl::equal ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2 )

Definition at line 95 of file algorithm.h.

95 {
96 while (first1 != last1) {
97 if (*first1 != *first2) {
98 return false;
99 }
100 ++first1;
101 ++first2;
102 }
103 return true;
104}

Referenced by fl::line_xy< T >::distance_to_line_with_point(), equal_container(), equal_container(), fl::WeakPtr< T >::operator!=(), and fl::FFT_Args::operator==().

+ Here is the caller graph for this function:

◆ equal() [2/4]

template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
bool fl::equal ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
BinaryPredicate pred )

Definition at line 107 of file algorithm.h.

107 {
108 while (first1 != last1) {
109 if (!pred(*first1, *first2)) {
110 return false;
111 }
112 ++first1;
113 ++first2;
114 }
115 return true;
116}

◆ equal() [3/4]

template<typename Iterator1, typename Iterator2>
bool fl::equal ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2 )

Definition at line 119 of file algorithm.h.

119 {
120 while (first1 != last1 && first2 != last2) {
121 if (*first1 != *first2) {
122 return false;
123 }
124 ++first1;
125 ++first2;
126 }
127 return first1 == last1 && first2 == last2;
128}

◆ equal() [4/4]

template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
bool fl::equal ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2,
BinaryPredicate pred )

Definition at line 131 of file algorithm.h.

131 {
132 while (first1 != last1 && first2 != last2) {
133 if (!pred(*first1, *first2)) {
134 return false;
135 }
136 ++first1;
137 ++first2;
138 }
139 return first1 == last1 && first2 == last2;
140}

◆ equal_container() [1/2]

template<typename Container1, typename Container2>
bool fl::equal_container ( const Container1 & c1,
const Container2 & c2 )

Definition at line 143 of file algorithm.h.

143 {
144 fl::size size1 = c1.size();
145 fl::size size2 = c2.size();
146 if (size1 != size2) {
147 return false;
148 }
149 return equal(c1.begin(), c1.end(), c2.begin(), c2.end());
150}
bool equal(Iterator1 first1, Iterator1 last1, Iterator2 first2)
Definition algorithm.h:95

References equal().

+ Here is the call graph for this function:

◆ equal_container() [2/2]

template<typename Container1, typename Container2, typename BinaryPredicate>
bool fl::equal_container ( const Container1 & c1,
const Container2 & c2,
BinaryPredicate pred )

Definition at line 153 of file algorithm.h.

153 {
154 fl::size size1 = c1.size();
155 fl::size size2 = c2.size();
156 if (size1 != size2) {
157 return false;
158 }
159 return equal(c1.begin(), c1.end(), c2.begin(), c2.end(), pred);
160}

References equal().

+ Here is the call graph for this function:

◆ execute_fetch_request()

fl::promise< response > fl::execute_fetch_request ( const fl::string & url,
const fetch_options & request )

Internal helper to execute a fetch request and return a promise.

Definition at line 72 of file fetch.cpp.

72 {
73 (void)request; // Unused in stub implementation
74 FL_WARN("HTTP fetch is not supported on non-WASM platforms. URL: " << url);
75
76 // Create error response
77 response error_response(501, "Not Implemented");
78 error_response.set_body("HTTP fetch is only available in WASM/browser builds. This platform does not support network requests.");
79
80 // Create resolved promise with error response
81 auto promise = fl::promise<response>::resolve(error_response);
82
83 return promise;
84}
static promise< T > resolve(const T &value)
Create a resolved promise with value.
Definition promise.h:81
HTTP response class (unified interface)
Definition fetch.h:83

References FL_WARN, fl::promise< T >::resolve(), and fl::response::set_body().

Referenced by fetch_delete(), fetch_get(), fetch_head(), fetch_http_options(), fetch_patch(), fetch_post(), fetch_put(), and fetch_request().

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

◆ exp()

template<typename T>
T fl::exp ( T value)
inline

Definition at line 47 of file math.h.

47 {
48#if defined(FASTLED_HAS_EXP)
49 return static_cast<T>(::exp(static_cast<double>(value)));
50#else
51 // Fallback implementation using Taylor series approximation
52 // e^x ≈ 1 + x + x²/2! + x³/3! + x⁴/4! + x⁵/5! + ...
53 // This is a simple approximation for small values
54 double x = static_cast<double>(value);
55 if (x > 10.0)
56 return static_cast<T>(22026.465794806718); // e^10 approx
57 if (x < -10.0)
58 return static_cast<T>(0.0000453999297625); // e^-10 approx
59
60 double result = 1.0;
61 double term = 1.0;
62 for (int i = 1; i < 10; ++i) {
63 term *= x / i;
64 result += term;
65 }
66 return static_cast<T>(result);
67#endif
68}
T exp(T value)
Definition math.h:47

References exp(), and x.

Referenced by exp(), and MaxFadeTracker::operator()().

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

◆ fade_raw()

void fl::fade_raw ( CRGB * leds,
fl::u16 num_leds,
fl::u8 fadeBy )

Definition at line 166 of file colorutils.cpp.

166 {
167 nscale8(leds, num_leds, 255 - fadeBy);
168}
void nscale8(CRGB *leds, fl::u16 num_leds, fl::u8 scale)

References leds, and nscale8().

+ Here is the call graph for this function:

◆ fade_video()

void fl::fade_video ( CRGB * leds,
fl::u16 num_leds,
fl::u8 fadeBy )

Definition at line 154 of file colorutils.cpp.

154 {
155 nscale8_video(leds, num_leds, 255 - fadeBy);
156}
void nscale8_video(CRGB *leds, fl::u16 num_leds, fl::u8 scale)

References leds, and nscale8_video().

+ Here is the call graph for this function:

◆ fadeLightBy()

void fl::fadeLightBy ( CRGB * leds,
fl::u16 num_leds,
fl::u8 fadeBy )

Definition at line 158 of file colorutils.cpp.

158 {
159 nscale8_video(leds, num_leds, 255 - fadeBy);
160}

References leds, and nscale8_video().

+ Here is the call graph for this function:

◆ fadeToBlackBy()

void fl::fadeToBlackBy ( CRGB * leds,
fl::u16 num_leds,
fl::u8 fadeBy )

Definition at line 162 of file colorutils.cpp.

162 {
163 nscale8(leds, num_leds, 255 - fadeBy);
164}

References leds, and nscale8().

Referenced by fl::DemoReel100::confetti(), fl::Luminova::draw(), fl::DemoReel100::juggle(), and fl::DemoReel100::sinelon().

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

◆ fadeToColorBy()

void fl::fadeToColorBy ( void * ,
uint16_t ,
uint32_t ,
uint8_t  )

◆ fadeUsingColor()

void fl::fadeUsingColor ( CRGB * leds,
fl::u16 numLeds,
const CRGB & colormask )

Definition at line 176 of file colorutils.cpp.

176 {
177 fl::u8 fr, fg, fb;
178 fr = colormask.r;
179 fg = colormask.g;
180 fb = colormask.b;
181
182 for (fl::u16 i = 0; i < numLeds; ++i) {
183 leds[i].r = scale8_LEAVING_R1_DIRTY(leds[i].r, fr);
184 leds[i].g = scale8_LEAVING_R1_DIRTY(leds[i].g, fg);
185 leds[i].b = scale8(leds[i].b, fb);
186 }
187}

References leds, scale8(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function:

◆ fast_hash32()

static u32 fl::fast_hash32 ( u32 x)
inlinestaticnoexcept

Definition at line 82 of file hash.h.

82 {
83 x = (x ^ 61u) ^ (x >> 16);
84 x = x + (x << 3);
85 x = x ^ (x >> 4);
86 x = x * 0x27d4eb2dU;
87 x = x ^ (x >> 15);
88 return x;
89}

References x.

Referenced by hash_pair(), fl::FastHash< Key >::operator()(), fl::FastHash< vec2< T > >::operator()(), fl::Hash< bool >::operator()(), fl::Hash< fl::u8 >::operator()(), fl::Hash< float >::operator()(), fl::Hash< i16 >::operator()(), fl::Hash< i32 >::operator()(), fl::Hash< i8 >::operator()(), fl::Hash< T * >::operator()(), fl::Hash< u16 >::operator()(), and fl::Hash< u32 >::operator()().

+ Here is the caller graph for this function:

◆ fast_hash64()

static u32 fl::fast_hash64 ( u64 x)
inlinestaticnoexcept

Definition at line 99 of file hash.h.

99 {
100 u32 x1 = static_cast<u32>(x & 0x00000000FFFFFFFF);
101 u32 x2 = static_cast<u32>(x >> 32);
102 return hash_pair(x1, x2);
103}
static u32 hash_pair(u32 a, u32 b, u32 seed=0) noexcept
Definition hash.h:92

References hash_pair(), and x.

+ Here is the call graph for this function:

◆ fastled_file_offset()

const char * fl::fastled_file_offset ( const char * file)
inline

Definition at line 20 of file dbg.h.

20 {
21 const char *p = file;
22 const char *last_slash = nullptr;
23
24 while (*p) {
25 if (p[0] == 's' && p[1] == 'r' && p[2] == 'c' && p[3] == '/') {
26 return p; // Skip past "src/"
27 }
28 if (*p == '/') { // fallback to using last slash
29 last_slash = p;
30 }
31 p++;
32 }
33 // If "src/" not found but we found at least one slash, return after the
34 // last slash
35 if (last_slash) {
36 return last_slash + 1;
37 }
38 return file; // If no slashes found at all, return original path
39}

◆ FASTLED_SMART_PTR() [1/52]

fl::FASTLED_SMART_PTR ( Animartrix )

◆ FASTLED_SMART_PTR() [2/52]

fl::FASTLED_SMART_PTR ( ArchimedeanSpiralPath )

◆ FASTLED_SMART_PTR() [3/52]

fl::FASTLED_SMART_PTR ( AudioSampleImpl )

◆ FASTLED_SMART_PTR() [4/52]

fl::FASTLED_SMART_PTR ( Blend2d )

◆ FASTLED_SMART_PTR() [5/52]

fl::FASTLED_SMART_PTR ( ByteStream )

◆ FASTLED_SMART_PTR() [6/52]

fl::FASTLED_SMART_PTR ( ByteStreamMemory )

◆ FASTLED_SMART_PTR() [7/52]

fl::FASTLED_SMART_PTR ( CatmullRomParams )

◆ FASTLED_SMART_PTR() [8/52]

fl::FASTLED_SMART_PTR ( CatmullRomPath )

◆ FASTLED_SMART_PTR() [9/52]

fl::FASTLED_SMART_PTR ( CirclePath )

◆ FASTLED_SMART_PTR() [10/52]

fl::FASTLED_SMART_PTR ( Cylon )

◆ FASTLED_SMART_PTR() [11/52]

fl::FASTLED_SMART_PTR ( DemoReel100 )

◆ FASTLED_SMART_PTR() [12/52]

fl::FASTLED_SMART_PTR ( DigitalPinImpl )

◆ FASTLED_SMART_PTR() [13/52]

fl::FASTLED_SMART_PTR ( FileHandle )

◆ FASTLED_SMART_PTR() [14/52]

fl::FASTLED_SMART_PTR ( FileSystem )

◆ FASTLED_SMART_PTR() [15/52]

fl::FASTLED_SMART_PTR ( Fire2012 )

Simple one-dimensional fire animation function.

◆ FASTLED_SMART_PTR() [16/52]

fl::FASTLED_SMART_PTR ( Frame )

◆ FASTLED_SMART_PTR() [17/52]

fl::FASTLED_SMART_PTR ( FrameInterpolator )

◆ FASTLED_SMART_PTR() [18/52]

fl::FASTLED_SMART_PTR ( FsImpl )

◆ FASTLED_SMART_PTR() [19/52]

fl::FASTLED_SMART_PTR ( Fx )

◆ FASTLED_SMART_PTR() [20/52]

fl::FASTLED_SMART_PTR ( Fx2d )

◆ FASTLED_SMART_PTR() [21/52]

fl::FASTLED_SMART_PTR ( FxLayer )

◆ FASTLED_SMART_PTR() [22/52]

fl::FASTLED_SMART_PTR ( GielisCurvePath )

◆ FASTLED_SMART_PTR() [23/52]

fl::FASTLED_SMART_PTR ( HeartPath )

◆ FASTLED_SMART_PTR() [24/52]

fl::FASTLED_SMART_PTR ( LinePath )

◆ FASTLED_SMART_PTR() [25/52]

fl::FASTLED_SMART_PTR ( LinePathParams )

◆ FASTLED_SMART_PTR() [26/52]

fl::FASTLED_SMART_PTR ( Luminova )

◆ FASTLED_SMART_PTR() [27/52]

fl::FASTLED_SMART_PTR ( NoisePalette )

◆ FASTLED_SMART_PTR() [28/52]

fl::FASTLED_SMART_PTR ( NoiseWave )

◆ FASTLED_SMART_PTR() [29/52]

fl::FASTLED_SMART_PTR ( Pacifica )

◆ FASTLED_SMART_PTR() [30/52]

fl::FASTLED_SMART_PTR ( PhyllotaxisPath )

◆ FASTLED_SMART_PTR() [31/52]

fl::FASTLED_SMART_PTR ( PixelStream )

Definition at line 20 of file video_impl.h.

22 {
23 public:
24 enum {
25 kSizeRGB8 = 3,
26 };
27 // frameHistoryCount is the number of frames to keep in the buffer after
28 // draw. This allows for time based effects like syncing video speed to
29 // audio triggers.
30 VideoImpl(size_t pixelsPerFrame, float fpsVideo,
31 size_t frameHistoryCount = 0);
32 ~VideoImpl();
33 // Api
34 void begin(fl::FileHandlePtr h);
35 void beginStream(fl::ByteStreamPtr s);
36 void setFade(fl::u32 fadeInTime, fl::u32 fadeOutTime);
37 bool draw(fl::u32 now, CRGB *leds);
38 void end();
39 bool rewind();
40 // internal use
41 bool draw(fl::u32 now, Frame *frame);
42 bool full() const;
43 void setTimeScale(float timeScale);
44 float timeScale() const { return mTimeScale; }
45 size_t pixelsPerFrame() const { return mPixelsPerFrame; }
46 void pause(fl::u32 now);
47 void resume(fl::u32 now);
48 bool needsFrame(fl::u32 now) const;
49 int32_t durationMicros() const; // -1 if this is a stream.
50
51 private:
52 bool updateBufferIfNecessary(fl::u32 prev, fl::u32 now);
53 bool updateBufferFromFile(fl::u32 now, bool forward);
54 bool updateBufferFromStream(fl::u32 now);
55 fl::u32 mPixelsPerFrame = 0;
56 PixelStreamPtr mStream;
57 fl::u32 mPrevNow = 0;
58 FrameInterpolatorPtr mFrameInterpolator;
59 TimeWarpPtr mTime;
60 fl::u32 mFadeInTime = 1000;
61 fl::u32 mFadeOutTime = 1000;
62 float mTimeScale = 1.0f;
63};
TimeWarp timeScale(0, 1.0f)
void draw(float pos)
Definition curr.h:538
constexpr T * begin(T(&array)[N]) noexcept
Definition range_access.h:9
constexpr T * end(T(&array)[N]) noexcept

References begin(), draw(), end(), forward(), leds, and timeScale().

+ Here is the call graph for this function:

◆ FASTLED_SMART_PTR() [32/52]

fl::FASTLED_SMART_PTR ( PointPath )

◆ FASTLED_SMART_PTR() [33/52]

fl::FASTLED_SMART_PTR ( Pride2015 )

◆ FASTLED_SMART_PTR() [34/52]

fl::FASTLED_SMART_PTR ( RedSquare )

◆ FASTLED_SMART_PTR() [35/52]

fl::FASTLED_SMART_PTR ( RosePath )

◆ FASTLED_SMART_PTR() [36/52]

fl::FASTLED_SMART_PTR ( RosePathParams )

◆ FASTLED_SMART_PTR() [37/52]

fl::FASTLED_SMART_PTR ( ScaleUp )

◆ FASTLED_SMART_PTR() [38/52]

fl::FASTLED_SMART_PTR ( StringHolder )

◆ FASTLED_SMART_PTR() [39/52]

fl::FASTLED_SMART_PTR ( TimeFunction )

◆ FASTLED_SMART_PTR() [40/52]

fl::FASTLED_SMART_PTR ( TimeWarp )

◆ FASTLED_SMART_PTR() [41/52]

fl::FASTLED_SMART_PTR ( TransformFloatImpl )

◆ FASTLED_SMART_PTR() [42/52]

fl::FASTLED_SMART_PTR ( TwinkleFox )

◆ FASTLED_SMART_PTR() [43/52]

fl::FASTLED_SMART_PTR ( VideoFxWrapper )

◆ FASTLED_SMART_PTR() [44/52]

fl::FASTLED_SMART_PTR ( VideoImpl )

◆ FASTLED_SMART_PTR() [45/52]

fl::FASTLED_SMART_PTR ( WaveCrgbGradientMap )

◆ FASTLED_SMART_PTR() [46/52]

fl::FASTLED_SMART_PTR ( WaveCrgbMap )

◆ FASTLED_SMART_PTR() [47/52]

fl::FASTLED_SMART_PTR ( WaveCrgbMapDefault )

◆ FASTLED_SMART_PTR() [48/52]

fl::FASTLED_SMART_PTR ( WaveFx )

◆ FASTLED_SMART_PTR() [49/52]

fl::FASTLED_SMART_PTR ( XYPath )

◆ FASTLED_SMART_PTR() [50/52]

fl::FASTLED_SMART_PTR ( XYPathFunction )

◆ FASTLED_SMART_PTR() [51/52]

fl::FASTLED_SMART_PTR ( XYPathGenerator )

◆ FASTLED_SMART_PTR() [52/52]

fl::FASTLED_SMART_PTR ( XYPathRenderer )

◆ FASTLED_SMART_PTR_NO_FWD() [1/4]

fl::FASTLED_SMART_PTR_NO_FWD ( LUT16 )

◆ FASTLED_SMART_PTR_NO_FWD() [2/4]

fl::FASTLED_SMART_PTR_NO_FWD ( LUTXY16 )

◆ FASTLED_SMART_PTR_NO_FWD() [3/4]

fl::FASTLED_SMART_PTR_NO_FWD ( LUTXYFLOAT )

◆ FASTLED_SMART_PTR_NO_FWD() [4/4]

fl::FASTLED_SMART_PTR_NO_FWD ( LUTXYZFLOAT )

◆ FASTLED_UI_DEFINE_OPERATORS() [1/5]

fl::FASTLED_UI_DEFINE_OPERATORS ( UIButton )

◆ FASTLED_UI_DEFINE_OPERATORS() [2/5]

fl::FASTLED_UI_DEFINE_OPERATORS ( UICheckbox )

◆ FASTLED_UI_DEFINE_OPERATORS() [3/5]

fl::FASTLED_UI_DEFINE_OPERATORS ( UIDropdown )

◆ FASTLED_UI_DEFINE_OPERATORS() [4/5]

fl::FASTLED_UI_DEFINE_OPERATORS ( UINumberField )

◆ FASTLED_UI_DEFINE_OPERATORS() [5/5]

fl::FASTLED_UI_DEFINE_OPERATORS ( UISlider )

◆ fetch() [1/2]

void fl::fetch ( const char * url,
const FetchCallback & callback )
inline

Make an HTTP GET request with URL string literal (cross-platform)

Parameters
urlThe URL to fetch (C-string)
callbackFunction to call with the response

Definition at line 286 of file fetch.h.

286 {
287 fetch(fl::string(url), callback);
288}
void fetch(const fl::string &url, const FetchCallback &callback)
Make an HTTP GET request (cross-platform, backward compatible)
Definition fetch.cpp:63

References fetch().

+ Here is the call graph for this function:

◆ fetch() [2/2]

void fl::fetch ( const fl::string & url,
const FetchCallback & callback )

Make an HTTP GET request (cross-platform, backward compatible)

Parameters
urlThe URL to fetch
callbackFunction to call with the response

On WASM/browser platforms: Uses native JavaScript fetch() API On Arduino/embedded platforms: Immediately calls callback with error response

Definition at line 63 of file fetch.cpp.

63 {
64 (void)url; // Unused in stub implementation
65 // For embedded platforms, immediately call callback with a "not supported" response
66 response resp(501, "Not Implemented");
67 resp.set_text("HTTP fetch not supported on this platform");
68 callback(resp);
69}

References fl::response::set_text().

Referenced by fetch().

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

◆ fetch_active_requests()

fl::size fl::fetch_active_requests ( )

Get number of active requests.

Definition at line 313 of file fetch.cpp.

313 {
315}
fl::size active_requests() const
Definition fetch.cpp:160
static FetchManager & instance()
Definition fetch.cpp:112

References fl::FetchManager::active_requests(), and fl::FetchManager::instance().

+ Here is the call graph for this function:

◆ fetch_delete()

fl::promise< response > fl::fetch_delete ( const fl::string & url,
const fetch_options & request )

HTTP DELETE request.

Definition at line 231 of file fetch.cpp.

231 {
232 // Create a new request with DELETE method
233 fetch_options delete_request(url, RequestOptions("DELETE"));
234
235 // Apply any additional options from the provided request
236 const auto& opts = request.options();
237 delete_request.timeout(opts.timeout_ms);
238 for (const auto& header : opts.headers) {
239 delete_request.header(header.first, header.second);
240 }
241 if (!opts.body.empty()) {
242 delete_request.body(opts.body);
243 }
244
245 return execute_fetch_request(url, delete_request);
246}
const RequestOptions & options() const
Get the options for this request.
Definition fetch.h:241
Fetch options builder (fluent interface)
Definition fetch.h:200
fl::promise< response > execute_fetch_request(const fl::string &url, const fetch_options &request)
Internal helper to execute a fetch request and return a promise.
Definition fetch.cpp:72
Request options (matches JavaScript fetch RequestInit)
Definition fetch.h:189

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

+ Here is the call graph for this function:

◆ fetch_get()

fl::promise< response > fl::fetch_get ( const fl::string & url,
const fetch_options & request )

HTTP GET request.

Definition at line 180 of file fetch.cpp.

180 {
181 // Create a new request with GET method
182 fetch_options get_request(url, RequestOptions("GET"));
183
184 // Apply any additional options from the provided request
185 const auto& opts = request.options();
186 get_request.timeout(opts.timeout_ms);
187 for (const auto& header : opts.headers) {
188 get_request.header(header.first, header.second);
189 }
190 if (!opts.body.empty()) {
191 get_request.body(opts.body);
192 }
193
194 return execute_fetch_request(url, get_request);
195}

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

Referenced by test_await_approach(), test_json_await(), test_json_response(), and test_promise_approach().

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

◆ fetch_head()

fl::promise< response > fl::fetch_head ( const fl::string & url,
const fetch_options & request )

HTTP HEAD request.

Definition at line 248 of file fetch.cpp.

248 {
249 // Create a new request with HEAD method
250 fetch_options head_request(url, RequestOptions("HEAD"));
251
252 // Apply any additional options from the provided request
253 const auto& opts = request.options();
254 head_request.timeout(opts.timeout_ms);
255 for (const auto& header : opts.headers) {
256 head_request.header(header.first, header.second);
257 }
258 if (!opts.body.empty()) {
259 head_request.body(opts.body);
260 }
261
262 return execute_fetch_request(url, head_request);
263}

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

+ Here is the call graph for this function:

◆ fetch_http_options()

fl::promise< response > fl::fetch_http_options ( const fl::string & url,
const fetch_options & request )

HTTP OPTIONS request.

Definition at line 265 of file fetch.cpp.

265 {
266 // Create a new request with OPTIONS method
267 fetch_options options_request(url, RequestOptions("OPTIONS"));
268
269 // Apply any additional options from the provided request
270 const auto& opts = request.options();
271 options_request.timeout(opts.timeout_ms);
272 for (const auto& header : opts.headers) {
273 options_request.header(header.first, header.second);
274 }
275 if (!opts.body.empty()) {
276 options_request.body(opts.body);
277 }
278
279 return execute_fetch_request(url, options_request);
280}

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

+ Here is the call graph for this function:

◆ fetch_patch()

fl::promise< response > fl::fetch_patch ( const fl::string & url,
const fetch_options & request )

HTTP PATCH request.

Definition at line 282 of file fetch.cpp.

282 {
283 // Create a new request with PATCH method
284 fetch_options patch_request(url, RequestOptions("PATCH"));
285
286 // Apply any additional options from the provided request
287 const auto& opts = request.options();
288 patch_request.timeout(opts.timeout_ms);
289 for (const auto& header : opts.headers) {
290 patch_request.header(header.first, header.second);
291 }
292 if (!opts.body.empty()) {
293 patch_request.body(opts.body);
294 }
295
296 return execute_fetch_request(url, patch_request);
297}

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

+ Here is the call graph for this function:

◆ fetch_post()

fl::promise< response > fl::fetch_post ( const fl::string & url,
const fetch_options & request )

HTTP POST request.

Definition at line 197 of file fetch.cpp.

197 {
198 // Create a new request with POST method
199 fetch_options post_request(url, RequestOptions("POST"));
200
201 // Apply any additional options from the provided request
202 const auto& opts = request.options();
203 post_request.timeout(opts.timeout_ms);
204 for (const auto& header : opts.headers) {
205 post_request.header(header.first, header.second);
206 }
207 if (!opts.body.empty()) {
208 post_request.body(opts.body);
209 }
210
211 return execute_fetch_request(url, post_request);
212}

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

+ Here is the call graph for this function:

◆ fetch_put()

fl::promise< response > fl::fetch_put ( const fl::string & url,
const fetch_options & request )

HTTP PUT request.

Definition at line 214 of file fetch.cpp.

214 {
215 // Create a new request with PUT method
216 fetch_options put_request(url, RequestOptions("PUT"));
217
218 // Apply any additional options from the provided request
219 const auto& opts = request.options();
220 put_request.timeout(opts.timeout_ms);
221 for (const auto& header : opts.headers) {
222 put_request.header(header.first, header.second);
223 }
224 if (!opts.body.empty()) {
225 put_request.body(opts.body);
226 }
227
228 return execute_fetch_request(url, put_request);
229}

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

+ Here is the call graph for this function:

◆ fetch_request()

fl::promise< response > fl::fetch_request ( const fl::string & url,
const RequestOptions & options )

Generic request with options (like fetch(url, options))

Definition at line 299 of file fetch.cpp.

299 {
300 // Create a fetch_options with the provided options
301 fetch_options request(url, options);
302
303 // Use the helper function to execute the request
304 return execute_fetch_request(url, request);
305}

References execute_fetch_request().

+ Here is the call graph for this function:

◆ fetch_update()

void fl::fetch_update ( )

Legacy manual update for fetch promises (use fl::async_run() for new code)

Deprecated
Use fl::async_run() instead - this calls async_run() internally

Definition at line 307 of file fetch.cpp.

307 {
308 // Legacy function - use fl::async_run() for new code
309 // This provides backwards compatibility for existing code
311}

References async_run().

+ Here is the call graph for this function:

◆ fill()

template<typename Iterator, typename T>
void fl::fill ( Iterator first,
Iterator last,
const T & value )

Definition at line 164 of file algorithm.h.

164 {
165 while (first != last) {
166 *first = value;
167 ++first;
168 }
169}

◆ fill_gradient() [1/4]

template<typename T>
void fl::fill_gradient ( T * targetArray,
u16 numLeds,
const CHSV & c1,
const CHSV & c2,
const CHSV & c3,
const CHSV & c4,
TGradientDirectionCode directionCode = SHORTEST_HUES )

Fill a range of LEDs with a smooth HSV gradient between four HSV colors.

See also
fill_gradient()
Parameters
targetArraya pointer to the color array to fill
numLedsthe number of LEDs to fill
c1the starting color in the gradient
c2the first middle color for the gradient
c3the second middle color for the gradient
c4the end color for the gradient
directionCodethe direction to travel around the color wheel

Definition at line 233 of file fill.h.

235 {
236 u16 onethird = (numLeds / 3);
237 u16 twothirds = ((numLeds * 2) / 3);
238 u16 last = numLeds - 1;
239 fill_gradient(targetArray, 0, c1, onethird, c2, directionCode);
240 fill_gradient(targetArray, onethird, c2, twothirds, c3, directionCode);
241 fill_gradient(targetArray, twothirds, c3, last, c4, directionCode);
242}
void fill_gradient(T *targetArray, u16 startpos, CHSV startcolor, u16 endpos, CHSV endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES)
Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
Definition fill.h:87

References fill_gradient(), and SHORTEST_HUES.

+ Here is the call graph for this function:

◆ fill_gradient() [2/4]

template<typename T>
void fl::fill_gradient ( T * targetArray,
u16 numLeds,
const CHSV & c1,
const CHSV & c2,
const CHSV & c3,
TGradientDirectionCode directionCode = SHORTEST_HUES )

Fill a range of LEDs with a smooth HSV gradient between three HSV colors.

See also
fill_gradient()
Parameters
targetArraya pointer to the color array to fill
numLedsthe number of LEDs to fill
c1the starting color in the gradient
c2the middle color for the gradient
c3the end color for the gradient
directionCodethe direction to travel around the color wheel

Definition at line 214 of file fill.h.

216 {
217 u16 half = (numLeds / 2);
218 u16 last = numLeds - 1;
219 fill_gradient(targetArray, 0, c1, half, c2, directionCode);
220 fill_gradient(targetArray, half, c2, last, c3, directionCode);
221}

References fill_gradient(), and SHORTEST_HUES.

+ Here is the call graph for this function:

◆ fill_gradient() [3/4]

template<typename T>
void fl::fill_gradient ( T * targetArray,
u16 numLeds,
const CHSV & c1,
const CHSV & c2,
TGradientDirectionCode directionCode = SHORTEST_HUES )

Fill a range of LEDs with a smooth HSV gradient between two HSV colors.

See also
fill_gradient()
Parameters
targetArraya pointer to the color array to fill
numLedsthe number of LEDs to fill
c1the starting color in the gradient
c2the end color for the gradient
directionCodethe direction to travel around the color wheel

Definition at line 198 of file fill.h.

200 {
201 u16 last = numLeds - 1;
202 fill_gradient(targetArray, 0, c1, last, c2, directionCode);
203}

References fill_gradient(), and SHORTEST_HUES.

+ Here is the call graph for this function:

◆ fill_gradient() [4/4]

template<typename T>
void fl::fill_gradient ( T * targetArray,
u16 startpos,
CHSV startcolor,
u16 endpos,
CHSV endcolor,
TGradientDirectionCode directionCode = SHORTEST_HUES )

Fill a range of LEDs with a smooth HSV gradient between two HSV colors.

This function can write the gradient colors either:

  1. Into an array of CRGBs (e.g., an leds[] array, or a CRGB palette)
  2. Into an array of CHSVs (e.g. a CHSV palette).

In the case of writing into a CRGB array, the gradient is computed in HSV space, and then HSV values are converted to RGB as they're written into the CRGB array.

Parameters
targetArraya pointer to the color array to fill
startposthe starting position in the array
startcolorthe starting color for the gradient
endposthe ending position in the array
endcolorthe end color for the gradient
directionCodethe direction to travel around the color wheel

Definition at line 87 of file fill.h.

89 {
90 // if the points are in the wrong order, straighten them
91 if (endpos < startpos) {
92 u16 t = endpos;
93 CHSV tc = endcolor;
94 endcolor = startcolor;
95 endpos = startpos;
96 startpos = t;
97 startcolor = tc;
98 }
99
100 // If we're fading toward black (val=0) or white (sat=0),
101 // then set the endhue to the starthue.
102 // This lets us ramp smoothly to black or white, regardless
103 // of what 'hue' was set in the endcolor (since it doesn't matter)
104 if (endcolor.value == 0 || endcolor.saturation == 0) {
105 endcolor.hue = startcolor.hue;
106 }
107
108 // Similarly, if we're fading in from black (val=0) or white (sat=0)
109 // then set the starthue to the endhue.
110 // This lets us ramp smoothly up from black or white, regardless
111 // of what 'hue' was set in the startcolor (since it doesn't matter)
112 if (startcolor.value == 0 || startcolor.saturation == 0) {
113 startcolor.hue = endcolor.hue;
114 }
115
116 saccum87 huedistance87;
117 saccum87 satdistance87;
118 saccum87 valdistance87;
119
120 satdistance87 = (endcolor.sat - startcolor.sat) << 7;
121 valdistance87 = (endcolor.val - startcolor.val) << 7;
122
123 fl::u8 huedelta8 = endcolor.hue - startcolor.hue;
124
125 if (directionCode == SHORTEST_HUES) {
126 directionCode = FORWARD_HUES;
127 if (huedelta8 > 127) {
128 directionCode = BACKWARD_HUES;
129 }
130 }
131
132 if (directionCode == LONGEST_HUES) {
133 directionCode = FORWARD_HUES;
134 if (huedelta8 < 128) {
135 directionCode = BACKWARD_HUES;
136 }
137 }
138
139 if (directionCode == FORWARD_HUES) {
140 huedistance87 = huedelta8 << 7;
141 } else /* directionCode == BACKWARD_HUES */
142 {
143 huedistance87 = (fl::u8)(256 - huedelta8) << 7;
144 huedistance87 = -huedistance87;
145 }
146
147 u16 pixeldistance = endpos - startpos;
148 i16 divisor = pixeldistance ? pixeldistance : 1;
149
150#if FASTLED_USE_32_BIT_GRADIENT_FILL
151 // Use higher precision 32 bit math for new micros.
152 i32 huedelta823 = (huedistance87 * 65536) / divisor;
153 i32 satdelta823 = (satdistance87 * 65536) / divisor;
154 i32 valdelta823 = (valdistance87 * 65536) / divisor;
155
156 huedelta823 *= 2;
157 satdelta823 *= 2;
158 valdelta823 *= 2;
159 u32 hue824 = static_cast<u32>(startcolor.hue) << 24;
160 u32 sat824 = static_cast<u32>(startcolor.sat) << 24;
161 u32 val824 = static_cast<u32>(startcolor.val) << 24;
162 for (u16 i = startpos; i <= endpos; ++i) {
163 targetArray[i] = CHSV(hue824 >> 24, sat824 >> 24, val824 >> 24);
164 hue824 += huedelta823;
165 sat824 += satdelta823;
166 val824 += valdelta823;
167 }
168#else
169 // Use 8-bit math for older micros.
170 saccum87 huedelta87 = huedistance87 / divisor;
171 saccum87 satdelta87 = satdistance87 / divisor;
172 saccum87 valdelta87 = valdistance87 / divisor;
173
174 huedelta87 *= 2;
175 satdelta87 *= 2;
176 valdelta87 *= 2;
177
178 accum88 hue88 = startcolor.hue << 8;
179 accum88 sat88 = startcolor.sat << 8;
180 accum88 val88 = startcolor.val << 8;
181 for (u16 i = startpos; i <= endpos; ++i) {
182 targetArray[i] = CHSV(hue88 >> 8, sat88 >> 8, val88 >> 8);
183 hue88 += huedelta87;
184 sat88 += satdelta87;
185 val88 += valdelta87;
186 }
187#endif // defined(__AVR__)
188}
#define saccum87
ANSI: signed short _Accum.
Definition fill.h:19
u16 accum88
ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.
Definition int.h:70

References BACKWARD_HUES, FORWARD_HUES, LONGEST_HUES, saccum87, SHORTEST_HUES, and t.

Referenced by fill_gradient(), fill_gradient(), and fill_gradient().

+ Here is the caller graph for this function:

◆ fill_gradient_RGB() [1/4]

void fl::fill_gradient_RGB ( CRGB * leds,
u16 numLeds,
const CRGB & c1,
const CRGB & c2 )

Fill a range of LEDs with a smooth RGB gradient between two RGB colors.

See also
fill_gradient_RGB()
Parameters
ledsa pointer to the LED array to fill
numLedsthe number of LEDs to fill
c1the starting color in the gradient
c2the end color for the gradient

Definition at line 149 of file fill.cpp.

150 {
151 u16 last = numLeds - 1;
152 fill_gradient_RGB(leds, 0, c1, last, c2);
153}
void fill_gradient_RGB(CRGB *leds, u16 startpos, CRGB startcolor, u16 endpos, CRGB endcolor)
Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
Definition fill.cpp:107

References fill_gradient_RGB(), and leds.

+ Here is the call graph for this function:

◆ fill_gradient_RGB() [2/4]

void fl::fill_gradient_RGB ( CRGB * leds,
u16 numLeds,
const CRGB & c1,
const CRGB & c2,
const CRGB & c3 )

Fill a range of LEDs with a smooth RGB gradient between three RGB colors.

See also
fill_gradient_RGB()
Parameters
ledsa pointer to the LED array to fill
numLedsthe number of LEDs to fill
c1the starting color in the gradient
c2the middle color for the gradient
c3the end color for the gradient

Definition at line 155 of file fill.cpp.

156 {
157 u16 half = (numLeds / 2);
158 u16 last = numLeds - 1;
159 fill_gradient_RGB(leds, 0, c1, half, c2);
160 fill_gradient_RGB(leds, half, c2, last, c3);
161}

References fill_gradient_RGB(), and leds.

+ Here is the call graph for this function:

◆ fill_gradient_RGB() [3/4]

void fl::fill_gradient_RGB ( CRGB * leds,
u16 numLeds,
const CRGB & c1,
const CRGB & c2,
const CRGB & c3,
const CRGB & c4 )

Fill a range of LEDs with a smooth RGB gradient between four RGB colors.

See also
fill_gradient_RGB()
Parameters
ledsa pointer to the LED array to fill
numLedsthe number of LEDs to fill
c1the starting color in the gradient
c2the first middle color for the gradient
c3the second middle color for the gradient
c4the end color for the gradient

Definition at line 163 of file fill.cpp.

164 {
165 u16 onethird = (numLeds / 3);
166 u16 twothirds = ((numLeds * 2) / 3);
167 u16 last = numLeds - 1;
168 fill_gradient_RGB(leds, 0, c1, onethird, c2);
169 fill_gradient_RGB(leds, onethird, c2, twothirds, c3);
170 fill_gradient_RGB(leds, twothirds, c3, last, c4);
171}

References fill_gradient_RGB(), and leds.

+ Here is the call graph for this function:

◆ fill_gradient_RGB() [4/4]

void fl::fill_gradient_RGB ( CRGB * leds,
u16 startpos,
CRGB startcolor,
u16 endpos,
CRGB endcolor )

Fill a range of LEDs with a smooth RGB gradient between two RGB colors.

Unlike HSV, there is no "color wheel" in RGB space, and therefore there's only one "direction" for the gradient to go. This means there's no TGradientDirectionCode parameter for direction.

Parameters
ledsa pointer to the LED array to fill
startposthe starting position in the array
startcolorthe starting color for the gradient
endposthe ending position in the array
endcolorthe end color for the gradient

Definition at line 107 of file fill.cpp.

108 {
109 // if the points are in the wrong order, straighten them
110 if (endpos < startpos) {
111 u16 t = endpos;
112 CRGB tc = endcolor;
113 endcolor = startcolor;
114 endpos = startpos;
115 startpos = t;
116 startcolor = tc;
117 }
118
119 saccum87 rdistance87;
120 saccum87 gdistance87;
121 saccum87 bdistance87;
122
123 rdistance87 = (endcolor.r - startcolor.r) << 7;
124 gdistance87 = (endcolor.g - startcolor.g) << 7;
125 bdistance87 = (endcolor.b - startcolor.b) << 7;
126
127 u16 pixeldistance = endpos - startpos;
128 i16 divisor = pixeldistance ? pixeldistance : 1;
129
130 saccum87 rdelta87 = rdistance87 / divisor;
131 saccum87 gdelta87 = gdistance87 / divisor;
132 saccum87 bdelta87 = bdistance87 / divisor;
133
134 rdelta87 *= 2;
135 gdelta87 *= 2;
136 bdelta87 *= 2;
137
138 accum88 r88 = startcolor.r << 8;
139 accum88 g88 = startcolor.g << 8;
140 accum88 b88 = startcolor.b << 8;
141 for (u16 i = startpos; i <= endpos; ++i) {
142 leds[i] = CRGB(r88 >> 8, g88 >> 8, b88 >> 8);
143 r88 += rdelta87;
144 g88 += gdelta87;
145 b88 += bdelta87;
146 }
147}

References leds, saccum87, and t.

Referenced by fill_gradient_RGB(), fill_gradient_RGB(), and fill_gradient_RGB().

+ Here is the caller graph for this function:

◆ fill_rainbow() [1/2]

void fl::fill_rainbow ( struct CHSV * targetArray,
int numToFill,
fl::u8 initialhue,
fl::u8 deltahue = 5 )

Fill a range of LEDs with a rainbow of colors.

The colors making up the rainbow are at full saturation and full value (brightness).

Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
initialhuethe starting hue for the rainbow
deltahuehow many hue values to advance for each LED

Definition at line 41 of file fill.cpp.

42 {
43 CHSV hsv;
44 hsv.hue = initialhue;
45 hsv.val = 255;
46 hsv.sat = 240;
47 for (int i = 0; i < numToFill; ++i) {
48 targetArray[i] = hsv;
49 hsv.hue += deltahue;
50 }
51}

◆ fill_rainbow() [2/2]

void fl::fill_rainbow ( struct CRGB * targetArray,
int numToFill,
fl::u8 initialhue,
fl::u8 deltahue = 5 )

Fill a range of LEDs with a rainbow of colors.

The colors making up the rainbow are at full saturation and full value (brightness).

Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
initialhuethe starting hue for the rainbow
deltahuehow many hue values to advance for each LED

Definition at line 29 of file fill.cpp.

30 {
31 CHSV hsv;
32 hsv.hue = initialhue;
33 hsv.val = 255;
34 hsv.sat = 240;
35 for (int i = 0; i < numToFill; ++i) {
36 targetArray[i] = hsv;
37 hsv.hue += deltahue;
38 }
39}

Referenced by fl::DemoReel100::rainbow().

+ Here is the caller graph for this function:

◆ fill_rainbow_circular() [1/2]

void fl::fill_rainbow_circular ( struct CHSV * targetArray,
int numToFill,
fl::u8 initialhue,
bool reversed = false )

Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning.

The colors making up the rainbow are at full saturation and full value (brightness).

Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
initialhuethe starting hue for the rainbow
reversedwhether to progress through the rainbow hues backwards

Definition at line 80 of file fill.cpp.

81 {
82 if (numToFill == 0)
83 return; // avoiding div/0
84
85 CHSV hsv;
86 hsv.hue = initialhue;
87 hsv.val = 255;
88 hsv.sat = 240;
89
90 const u16 hueChange =
91 65535 / (u16)numToFill; // hue change for each LED, * 256 for
92 // precision (256 * 256 - 1)
93 u16 hueOffset = 0; // offset for hue value, with precision (*256)
94
95 for (int i = 0; i < numToFill; ++i) {
96 targetArray[i] = hsv;
97 if (reversed)
98 hueOffset -= hueChange;
99 else
100 hueOffset += hueChange;
101 hsv.hue = initialhue +
102 (u8)(hueOffset >>
103 8); // assign new hue with precise offset (as 8-bit)
104 }
105}

◆ fill_rainbow_circular() [2/2]

void fl::fill_rainbow_circular ( struct CRGB * targetArray,
int numToFill,
fl::u8 initialhue,
bool reversed = false )

Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning.

The colors making up the rainbow are at full saturation and full value (brightness).

Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
initialhuethe starting hue for the rainbow
reversedwhether to progress through the rainbow hues backwards

Definition at line 53 of file fill.cpp.

54 {
55 if (numToFill == 0)
56 return; // avoiding div/0
57
58 CHSV hsv;
59 hsv.hue = initialhue;
60 hsv.val = 255;
61 hsv.sat = 240;
62
63 const u16 hueChange =
64 65535 / (u16)numToFill; // hue change for each LED, * 256 for
65 // precision (256 * 256 - 1)
66 u16 hueOffset = 0; // offset for hue value, with precision (*256)
67
68 for (int i = 0; i < numToFill; ++i) {
69 targetArray[i] = hsv;
70 if (reversed)
71 hueOffset -= hueChange;
72 else
73 hueOffset += hueChange;
74 hsv.hue = initialhue +
75 (u8)(hueOffset >>
76 8); // assign new hue with precise offset (as 8-bit)
77 }
78}

◆ fill_solid() [1/2]

void fl::fill_solid ( struct CHSV * targetArray,
int numToFill,
const struct CHSV & color )

Fill a range of LEDs with a solid color.

Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
colorthe color to fill with

Definition at line 16 of file fill.cpp.

17 {
18 for (int i = 0; i < numToFill; ++i) {
19 targetArray[i] = color;
20 }
21}

◆ fill_solid() [2/2]

void fl::fill_solid ( struct CRGB * targetArray,
int numToFill,
const struct CRGB & color )

Fill a range of LEDs with a solid color.

Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
colorthe color to fill with

Definition at line 9 of file fill.cpp.

10 {
11 for (int i = 0; i < numToFill; ++i) {
12 targetArray[i] = color;
13 }
14}

Referenced by fl::Pacifica::draw(), setup(), fl::NoisePalette::SetupBlackAndWhiteStripedPalette(), test_await_approach(), test_json_await(), test_json_response(), and test_promise_approach().

+ Here is the caller graph for this function:

◆ find()

template<typename Iterator, typename T>
Iterator fl::find ( Iterator first,
Iterator last,
const T & value )

Definition at line 172 of file algorithm.h.

172 {
173 while (first != last) {
174 if (*first == value) {
175 return first;
176 }
177 ++first;
178 }
179 return last;
180}

Referenced by fl::AsyncManager::register_runner(), and fl::AsyncManager::unregister_runner().

+ Here is the caller graph for this function:

◆ find_if()

template<typename Iterator, typename UnaryPredicate>
Iterator fl::find_if ( Iterator first,
Iterator last,
UnaryPredicate pred )

Definition at line 183 of file algorithm.h.

183 {
184 while (first != last) {
185 if (pred(*first)) {
186 return first;
187 }
188 ++first;
189 }
190 return last;
191}

◆ find_if_not()

template<typename Iterator, typename UnaryPredicate>
Iterator fl::find_if_not ( Iterator first,
Iterator last,
UnaryPredicate pred )

Definition at line 194 of file algorithm.h.

194 {
195 while (first != last) {
196 if (!pred(*first)) {
197 return first;
198 }
199 ++first;
200 }
201 return last;
202}

◆ five_bit_bitshift() [1/2]

void fl::five_bit_bitshift ( u16 r16,
u16 g16,
u16 b16,
fl::u8 brightness,
CRGB * out,
fl::u8 * out_power_5bit )

References brightness().

Referenced by internal_builtin_five_bit_hd_gamma_bitshift().

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

◆ five_bit_bitshift() [2/2]

void fl::five_bit_bitshift ( uint16_t r16,
uint16_t g16,
uint16_t b16,
uint8_t brightness,
CRGB * out,
uint8_t * out_power_5bit )
inline

Definition at line 125 of file five_bit_hd_gamma.h.

127 {
128
129 // NEW in 3.10.2: A new closed form solution has been found!
130 // Thank you https://github.com/gwgill!
131 // It's okay if you don't know how this works, few do, but it tests
132 // very well and is better than the old iterative approach which had
133 // bad quantization issues (sudden jumps in brightness in certain intervals).
134
135 // ix/31 * 255/65536 * 256 scaling factors, valid for indexes 1..31
136 static uint32_t bright_scale[32] = {
137 0, 2023680, 1011840, 674560, 505920, 404736, 337280, 289097,
138 252960, 224853, 202368, 183971, 168640, 155668, 144549, 134912,
139 126480, 119040, 112427, 106509, 101184, 96366, 91985, 87986,
140 84320, 80947, 77834, 74951, 72274, 69782, 67456, 65280};
141
142 auto max3 = [](u16 a, u16 b, u16 c) { return fl_max(fl_max(a, b), c); };
143
144
145 if (brightness == 0) {
146 *out = CRGB(0, 0, 0);
147 *out_power_5bit = 0;
148 return;
149 }
150 if (r16 == 0 && g16 == 0 && b16 == 0) {
151 *out = CRGB(0, 0, 0);
152 *out_power_5bit = (brightness <= 31) ? brightness : 31;
153 return;
154 }
155
156 uint8_t r8 = 0, g8 = 0, b8 = 0;
157
158 // Apply any brightness setting (we assume brightness is 0..255)
159 if (brightness != 0xff) {
160 r16 = scale16by8(r16, brightness);
161 g16 = scale16by8(g16, brightness);
162 b16 = scale16by8(b16, brightness);
163 }
164
165 // Locate the largest value to set the brightness/scale factor
166 uint16_t scale = max3(r16, g16, b16);
167
168 if (scale == 0) {
169 *out = CRGB(0, 0, 0);
170 *out_power_5bit = 0;
171 return;
172 } else {
173 uint32_t scalef;
174
175 // Compute 5 bit quantized scale that is at or above the maximum value.
176 scale = (scale + (2047 - (scale >> 5))) >> 11;
177
178 // Adjust the 16 bit values to account for the scale, then round to 8
179 // bits
180 scalef = bright_scale[scale];
181 r8 = (r16 * scalef + 0x808000) >> 24;
182 g8 = (g16 * scalef + 0x808000) >> 24;
183 b8 = (b16 * scalef + 0x808000) >> 24;
184
185 *out = CRGB(r8, g8, b8);
186 *out_power_5bit = static_cast<uint8_t>(scale);
187 return;
188 }
189}
uint16_t scale
Definition Noise.ino:74
LIB8STATIC_ALWAYS_INLINE uint16_t scale16by8(uint16_t i, fract8 scale)
Scale a 16-bit unsigned value by an 8-bit value, which is treated as the numerator of a fraction whos...
Definition scale8.h:478
common_type_t< T, U > fl_max(T a, U b)
Definition math_macros.h:29

References brightness(), fl_max(), scale, and scale16by8().

+ Here is the call graph for this function:

◆ five_bit_hd_gamma_bitshift()

void fl::five_bit_hd_gamma_bitshift ( CRGB colors,
CRGB colors_scale,
fl::u8 global_brightness,
CRGB * out_colors,
fl::u8 * out_power_5bit )
inline

Definition at line 57 of file five_bit_hd_gamma.h.

60 {
62 colors, colors_scale, global_brightness, out_colors, out_power_5bit);
63}
void internal_builtin_five_bit_hd_gamma_bitshift(CRGB colors, CRGB colors_scale, fl::u8 global_brightness, CRGB *out_colors, fl::u8 *out_power_5bit)

References internal_builtin_five_bit_hd_gamma_bitshift().

Referenced by PixelController< RGB_ORDER, LANES, MASK >::loadAndScale_APA102_HD().

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

◆ five_bit_hd_gamma_function()

void fl::five_bit_hd_gamma_function ( CRGB color,
u16 * r16,
u16 * g16,
u16 * b16 )
inline

Definition at line 85 of file five_bit_hd_gamma.h.

86 {
87
88 gamma16(color, r16, g16, b16);
89}
void gamma16(const CRGB &rgb, u16 *r16, u16 *g16, u16 *b16)
Definition gamma.h:13

References gamma16().

Referenced by internal_builtin_five_bit_hd_gamma_bitshift().

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

◆ fl_abs()

template<typename T>
T fl::fl_abs ( T value)
inline

Definition at line 11 of file math_macros.h.

11 {
12 return value < 0 ? -value : value;
13}

Referenced by FL_DISABLE_WARNING().

+ Here is the caller graph for this function:

◆ FL_DISABLE_WARNING() [1/2]

FL_DISABLE_WARNING_PUSH fl::FL_DISABLE_WARNING ( sign- compare)

References FL_DISABLE_WARNING_FLOAT_CONVERSION, FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION, and FL_DISABLE_WARNING_SIGN_CONVERSION.

◆ FL_DISABLE_WARNING() [2/2]

FL_DISABLE_WARNING_PUSH fl::FL_DISABLE_WARNING ( unused- function)

Definition at line 42 of file json.cpp.

43 {
44
45
46 auto isnan = [](double value) -> bool {
47 return value != value;
48 };
49
50 // Check for special values
51 if (isnan(value)) {
52 return true; // These can be represented as float
53 }
54
55 // Check if the value is within reasonable float range
56 // Reject values that are clearly beyond float precision (beyond 2^24 for integers)
57 // or outside the float range
58 if (fl::fl_abs(value) > 16777216.0) { // 2^24 - beyond which floats lose integer precision
59 return false;
60 }
61
62 // For values within reasonable range, allow conversion even with minor precision loss
63 // This handles cases like 300000.14159 which should be convertible to float
64 // even though it loses some precision
65 return true;
66}
T fl_abs(T value)
Definition math_macros.h:11

References fl_abs().

+ Here is the call graph for this function:

◆ fl_max()

template<typename T, typename U>
common_type_t< T, U > fl::fl_max ( T a,
U b )
inline

Definition at line 29 of file math_macros.h.

29 {
30 return (a > b) ? a : b;
31}

Referenced by five_bit_bitshift(), hsv2rgb_fullspectrum(), and RGBtoHSV16().

+ Here is the caller graph for this function:

◆ fl_min()

FL_DISABLE_WARNING_PUSH U common_type_t< T, U > fl::fl_min ( T a,
U b )
inline

Definition at line 25 of file math_macros.h.

25 {
26 return (a < b) ? a : b;
27}

Referenced by hsv2rgb_fullspectrum(), and RGBtoHSV16().

+ Here is the caller graph for this function:

◆ floor()

template<typename T>
T fl::floor ( T value)
inline

Definition at line 32 of file math.h.

32 {
33 if (value >= 0) {
34 return static_cast<T>(static_cast<int>(value));
35 }
36 return static_cast<T>(::floor(static_cast<float>(value)));
37}
T floor(T value)
Definition math.h:32

References floor().

Referenced by floor(), fl::JsonValue::parse(), and traverseGridSegmentFloat().

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

◆ forward() [1/2]

template<typename T>
T && fl::forward ( typename remove_reference< T >::type && t)
constexprnoexcept

Definition at line 219 of file type_traits.h.

219 {
220 static_assert(!is_lvalue_reference<T>::value,
221 "Cannot forward an rvalue as an lvalue");
222 return static_cast<T &&>(t);
223}
static constexpr bool value

References t, and fl::is_lvalue_reference< T >::value.

◆ forward() [2/2]

template<typename T>
T && fl::forward ( typename remove_reference< T >::type & t)
constexprnoexcept

Definition at line 213 of file type_traits.h.

213 {
214 return static_cast<T &&>(t);
215}

References t.

Referenced by fl::RedBlackTree< T, Compare, Allocator >::Node::Node(), fl::pair< const Key, T >::pair(), fl::tuple< Head, Tail... >::tuple(), fl::shared_ptr< T >::allocate_shared, fl::allocator< U >::construct(), fl::allocator_inlined< U, N, typename BaseAllocator::template rebind< U >::other >::construct(), fl::allocator_psram< U >::construct(), fl::allocator_slab< T, SLAB_SIZE >::construct(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::construct(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >::emplace(), fl::RedBlackTree< value_type, PairCompare, Allocator >::emplace(), fl::set< T, fl::allocator_inlined_slab< T, N > >::emplace(), fl::SetRedBlackTree< Key, fl::less< Key >, Allocator >::emplace(), fl::SortedHeapMap< fl::u32, FramePtr, Less >::emplace(), fl::unordered_set< Key >::emplace(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::emplace(), fl::VectorSet< Key, Allocator >::emplace(), fl::VectorSetFixed< Key, N >::emplace(), fl::HeapVector< DrawItem >::emplace_back(), FASTLED_SMART_PTR(), fl::RedBlackTree< value_type, PairCompare, Allocator >::insertImpl(), invoke(), invoke(), invoke(), make_intrusive(), make_pair(), fl::shared_ptr< T >::make_shared, make_shared_ptr(), fl::shared_ptr< T >::make_shared_with_deleter, make_tuple(), make_unique(), fl::less< void >::operator()(), and fl::JsonValue::operator=().

+ Here is the caller graph for this function:

◆ Free()

void fl::Free ( void * ptr)

Definition at line 125 of file allocator.cpp.

125 {
126#if defined(FASTLED_TESTING)
127 if (gMallocFreeHook && ptr) {
128 MemoryGuard allows_hook;
129 if (allows_hook.enabled()) {
130 gMallocFreeHook->onFree(ptr);
131 }
132 }
133#endif
134
135 Dealloc(ptr);
136}

Referenced by fl::allocator< U >::deallocate().

+ Here is the caller graph for this function:

◆ gamma16()

void fl::gamma16 ( const CRGB & rgb,
u16 * r16,
u16 * g16,
u16 * b16 )
inline

Definition at line 13 of file gamma.h.

13 {
14 *r16 = gamma_2_8[rgb.r];
15 *g16 = gamma_2_8[rgb.g];
16 *b16 = gamma_2_8[rgb.b];
17}
const u16 gamma_2_8[256]
Definition ease.cpp:20

References gamma_2_8.

Referenced by five_bit_hd_gamma_function().

+ Here is the caller graph for this function:

◆ get() [1/12]

template<fl::size I, typename T1, typename T2>
const pair_element< I, T1, T2 >::type & fl::get ( const pair< T1, T2 > & p)
noexcept

Definition at line 123 of file pair.h.

123 {
124 static_assert(I < 2, "Index out of bounds for pair");
125 if (I == 0) {
126 return p.first;
127 } else {
128 return p.second;
129 }
130}
T1 first
Definition pair.h:14
T2 second
Definition pair.h:15

◆ get() [2/12]

template<typename T, typename T1, typename T2>
const T & fl::get ( const pair< T1, T2 > & p)
noexcept

Definition at line 157 of file pair.h.

157 {
159 "Type T must be one of the pair's element types");
161 "Type T must be unique in the pair");
163 return p.first;
164 } else {
165 return p.second;
166 }
167}
static constexpr bool value
Definition type_traits.h:84

References fl::is_same< T, U >::value.

◆ get() [3/12]

template<size_t I, typename Head, typename... Tail>
enable_if< I==0, constHead & >::type fl::get ( const tuple< Head, Tail... > & t)

Definition at line 67 of file tuple.h.

67 {
68 return t.head;
69}

References t.

◆ get() [4/12]

template<size_t I, typename Head, typename... Tail>
enable_if< I!=0, consttypenametuple_element< I, tuple< Head, Tail... > >::type & >::type fl::get ( const tuple< Head, Tail... > & t)

Definition at line 73 of file tuple.h.

73 {
74 return get<I-1>(t.tail);
75}
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) noexcept
Definition pair.h:113

References get(), and t.

+ Here is the call graph for this function:

◆ get() [5/12]

template<fl::size I, typename T1, typename T2>
pair_element< I, T1, T2 >::type && fl::get ( pair< T1, T2 > && p)
noexcept

Definition at line 133 of file pair.h.

133 {
134 static_assert(I < 2, "Index out of bounds for pair");
135 if (I == 0) {
136 return fl::move(p.first);
137 } else {
138 return fl::move(p.second);
139 }
140}
constexpr remove_reference< T >::type && move(T &&t) noexcept
Definition move.h:27

References move().

+ Here is the call graph for this function:

◆ get() [6/12]

template<typename T, typename T1, typename T2>
T && fl::get ( pair< T1, T2 > && p)
noexcept

Definition at line 170 of file pair.h.

170 {
172 "Type T must be one of the pair's element types");
174 "Type T must be unique in the pair");
176 return fl::move(p.first);
177 } else {
178 return fl::move(p.second);
179 }
180}

References move(), and fl::is_same< T, U >::value.

+ Here is the call graph for this function:

◆ get() [7/12]

template<fl::size I, typename T1, typename T2>
pair_element< I, T1, T2 >::type & fl::get ( pair< T1, T2 > & p)
noexcept

Definition at line 113 of file pair.h.

113 {
114 static_assert(I < 2, "Index out of bounds for pair");
115 if (I == 0) {
116 return p.first;
117 } else {
118 return p.second;
119 }
120}

Referenced by fl::Corkscrew::clear(), fl::Corkscrew::data(), fl::result< T >::error(), get(), get(), get(), fl::anonymous_namespace{task.cpp}::make_trace_label(), fl::Corkscrew::pixelCount(), fl::Corkscrew::rawData(), fl::result< T >::value(), fl::result< T >::value(), and fl::Ptr< T >::weakRefNoCreate().

+ Here is the caller graph for this function:

◆ get() [8/12]

template<typename T, typename T1, typename T2>
T & fl::get ( pair< T1, T2 > & p)
noexcept

Definition at line 144 of file pair.h.

144 {
146 "Type T must be one of the pair's element types");
148 "Type T must be unique in the pair");
150 return p.first;
151 } else {
152 return p.second;
153 }
154}

References fl::is_same< T, U >::value.

◆ get() [9/12]

template<size_t I, typename Head, typename... Tail>
enable_if< I==0, Head && >::type fl::get ( tuple< Head, Tail... > && t)

Definition at line 80 of file tuple.h.

80 {
81 return fl::move(t.head);
82}

References move(), and t.

+ Here is the call graph for this function:

◆ get() [10/12]

template<size_t I, typename Head, typename... Tail>
enable_if< I!=0, typenametuple_element< I, tuple< Head, Tail... > >::type && >::type fl::get ( tuple< Head, Tail... > && t)

Definition at line 86 of file tuple.h.

86 {
87 return get<I-1>(fl::move(t.tail));
88}

References get(), move(), and t.

+ Here is the call graph for this function:

◆ get() [11/12]

template<size_t I, typename Head, typename... Tail>
enable_if< I==0, Head & >::type fl::get ( tuple< Head, Tail... > & t)

Definition at line 54 of file tuple.h.

54 {
55 return t.head;
56}

References t.

◆ get() [12/12]

template<size_t I, typename Head, typename... Tail>
enable_if< I!=0, typenametuple_element< I, tuple< Head, Tail... > >::type & >::type fl::get ( tuple< Head, Tail... > & t)

Definition at line 60 of file tuple.h.

60 {
61 return get<I-1>(t.tail);
62}

References get(), and t.

+ Here is the call graph for this function:

◆ get_empty_json_object()

JsonObject & fl::get_empty_json_object ( )

Definition at line 75 of file json.cpp.

75 {
76 // thread_local JsonObject empty_object;
77 static ThreadLocal<JsonObject> empty_object;
78 return empty_object.access();
79}

References fl::ThreadLocalFake< T >::access().

+ Here is the call graph for this function:

◆ get_null_value()

JsonValue & fl::get_null_value ( )

Definition at line 70 of file json.cpp.

70 {
71 static ThreadLocal<JsonValue> null_value;
72 return null_value.access();
73}

References fl::ThreadLocalFake< T >::access().

Referenced by fl::JsonValue::const_iterator::KeyValue::KeyValue(), fl::JsonValue::iterator::KeyValue::KeyValue(), and fl::JsonValue::operator[]().

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

◆ getAnimartrixName()

fl::string fl::getAnimartrixName ( int animation)

Definition at line 249 of file animartrix.hpp.

249 {
250 if (animation < 0 || animation >= NUM_ANIMATIONS) {
251 return "UNKNOWN";
252 }
253 return ANIMATION_TABLE[animation].name;
254}
static const AnimartrixEntry ANIMATION_TABLE[]

References ANIMATION_TABLE, and NUM_ANIMATIONS.

◆ hash_pair()

static u32 fl::hash_pair ( u32 a,
u32 b,
u32 seed = 0 )
inlinestaticnoexcept

Definition at line 92 of file hash.h.

93 {
94 // mix in 'a', then mix in 'b'
95 u32 h = fast_hash32(seed ^ a);
96 return fast_hash32(h ^ b);
97}
static u32 fast_hash32(u32 x) noexcept
Definition hash.h:82

References fast_hash32().

Referenced by fast_hash64(), and fl::FastHash< vec2< T > >::operator()().

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

◆ HeatColor()

CRGB fl::HeatColor ( fl::u8 temperature)

Definition at line 200 of file colorutils.cpp.

200 {
201 CRGB heatcolor;
202
203 // Scale 'heat' down from 0-255 to 0-191,
204 // which can then be easily divided into three
205 // equal 'thirds' of 64 units each.
206 fl::u8 t192 = scale8_video(temperature, 191);
207
208 // calculate a value that ramps up from
209 // zero to 255 in each 'third' of the scale.
210 fl::u8 heatramp = t192 & 0x3F; // 0..63
211 heatramp <<= 2; // scale up to 0..252
212
213 // now figure out which third of the spectrum we're in:
214 if (t192 & 0x80) {
215 // we're in the hottest third
216 heatcolor.r = 255; // full red
217 heatcolor.g = 255; // full green
218 heatcolor.b = heatramp; // ramp up blue
219
220 } else if (t192 & 0x40) {
221 // we're in the middle third
222 heatcolor.r = 255; // full red
223 heatcolor.g = heatramp; // ramp up green
224 heatcolor.b = 0; // no blue
225
226 } else {
227 // we're in the coolest third
228 heatcolor.r = heatramp; // ramp up red
229 heatcolor.g = 0; // no green
230 heatcolor.b = 0; // no blue
231 }
232
233 return heatcolor;
234}

References scale8_video().

+ Here is the call graph for this function:

◆ HSV16toRGB()

static CRGB fl::HSV16toRGB ( const HSV16 & hsv)
static

Definition at line 121 of file hsv16.cpp.

121 {
122 // Convert 16-bit values to working range
123 u32 h = hsv.h;
124 u32 s = hsv.s;
125 u32 v = hsv.v;
126
127 if (s == 0) {
128 // Grayscale case - use precise mapping
129 u8 gray = map16_to_8(v);
130 return CRGB{gray, gray, gray};
131 }
132
133 // Determine which sector of the color wheel (0-5)
134 u32 sector = (h * 6) / 65536;
135 u32 sector_pos = (h * 6) % 65536; // Position within sector (0-65535)
136
137 // Calculate intermediate values using precise mapping
138 // c = v * s / 65536, with proper rounding
139 u32 c = map32_to_16(v * s);
140
141 // Calculate x = c * (1 - |2*(sector_pos/65536) - 1|)
142 u32 x;
143 if (sector & 1) {
144 // For odd sectors (1, 3, 5), we want decreasing values
145 // x = c * (65535 - sector_pos) / 65535
146 x = map32_to_16(c * (65535 - sector_pos));
147 } else {
148 // For even sectors (0, 2, 4), we want increasing values
149 // x = c * sector_pos / 65535
150 x = map32_to_16(c * sector_pos);
151 }
152
153 u32 m = v - c;
154
155 u32 r1, g1, b1;
156 switch (sector) {
157 case 0: r1 = c; g1 = x; b1 = 0; break;
158 case 1: r1 = x; g1 = c; b1 = 0; break;
159 case 2: r1 = 0; g1 = c; b1 = x; break;
160 case 3: r1 = 0; g1 = x; b1 = c; break;
161 case 4: r1 = x; g1 = 0; b1 = c; break;
162 default: r1 = c; g1 = 0; b1 = x; break;
163 }
164
165 // Add baseline and scale to 8-bit using accurate mapping
166 u8 R = map16_to_8(u16(r1 + m));
167 u8 G = map16_to_8(u16(g1 + m));
168 u8 B = map16_to_8(u16(b1 + m));
169
170 return CRGB{R, G, B};
171}
LIB8STATIC_ALWAYS_INLINE uint16_t map32_to_16(uint32_t x)
Definition intmap.h:47
u16 v
Definition hsv16.h:13
u16 h
Definition hsv16.h:11
u16 s
Definition hsv16.h:12

References fl::HSV16::h, map16_to_8(), map32_to_16(), fl::HSV16::s, fl::HSV16::v, and x.

Referenced by fl::HSV16::ToRGB().

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

◆ int_to_ptr()

template<typename T>
T * fl::int_to_ptr ( uptr value)
noexcept

Definition at line 70 of file bit_cast.h.

70 {
71 return bit_cast<T*>(value);
72}

References bit_cast().

Referenced by CLEDController::beginShowLeds().

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

◆ internal_builtin_five_bit_hd_gamma_bitshift()

void fl::internal_builtin_five_bit_hd_gamma_bitshift ( CRGB colors,
CRGB colors_scale,
fl::u8 global_brightness,
CRGB * out_colors,
fl::u8 * out_power_5bit )
inline

Definition at line 92 of file five_bit_hd_gamma.h.

94 {
95
96 if (global_brightness == 0) {
97 *out_colors = CRGB(0, 0, 0);
98 *out_power_5bit = 0;
99 return;
100 }
101
102 // Step 1: Gamma Correction
103 u16 r16, g16, b16;
104 five_bit_hd_gamma_function(colors, &r16, &g16, &b16);
105
106 // Step 2: Color correction step comes after gamma correction. These values
107 // are assumed to be be relatively close to 255.
108 if (colors_scale.r != 0xff) {
109 r16 = scale16by8(r16, colors_scale.r);
110 }
111 if (colors_scale.g != 0xff) {
112 g16 = scale16by8(g16, colors_scale.g);
113 }
114 if (colors_scale.b != 0xff) {
115 b16 = scale16by8(b16, colors_scale.b);
116 }
117
118 five_bit_bitshift(r16, g16, b16, global_brightness, out_colors,
119 out_power_5bit);
120}
void five_bit_hd_gamma_function(CRGB color, u16 *r16, u16 *g16, u16 *b16)
void five_bit_bitshift(u16 r16, u16 g16, u16 b16, fl::u8 brightness, CRGB *out, fl::u8 *out_power_5bit)

References five_bit_bitshift(), five_bit_hd_gamma_function(), and scale16by8().

Referenced by five_bit_hd_gamma_bitshift().

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

◆ invoke() [1/3]

template<typename F, typename... Args>
auto fl::invoke ( F && f,
Args &&... args ) -> enable_if_t<!is_member_function_pointer<typename remove_reference<F>::type>::value && !detail::is_member_data_pointer<typename remove_reference<F>::type>::value, decltype(fl::forward<F>(f)(fl::forward<Args>(args)...))>

Definition at line 89 of file functional.h.

93{
95}

References args, and forward().

+ Here is the call graph for this function:

◆ invoke() [2/3]

template<typename F, typename T1>
auto fl::invoke ( F && f,
T1 && t1 ) -> enable_if_t<detail::is_member_data_pointer<typename remove_reference<F>::type>::value && !detail::use_pointer_syntax<T1>::value, decltype(fl::forward<T1>(t1).*f)>

Definition at line 69 of file functional.h.

73{
74 return fl::forward<T1>(t1).*f;
75}

References forward(), and fl::integral_constant< bool, false >::value.

+ Here is the call graph for this function:

◆ invoke() [3/3]

template<typename F, typename T1, typename... Args>
auto fl::invoke ( F && f,
T1 && t1,
Args &&... args ) -> enable_if_t<is_member_function_pointer<typename remove_reference<F>::type>::value && !detail::use_pointer_syntax<T1>::value, decltype((fl::forward<T1>(t1).*f)(fl::forward<Args>(args)...))>

Definition at line 49 of file functional.h.

53{
54 return (fl::forward<T1>(t1).*f)(fl::forward<Args>(args)...);
55}

References args, forward(), and fl::integral_constant< bool, false >::value.

+ Here is the call graph for this function:

◆ jsonArrayToFloatVector()

fl::vector< float > fl::jsonArrayToFloatVector ( const fl::Json & jsonArray)

Definition at line 23 of file screenmap.cpp.

23 {
25
26 if (!jsonArray.has_value() || !jsonArray.is_array()) {
27 return result;
28 }
29 auto begin_float = jsonArray.begin_array<float>();
30 auto end_float = jsonArray.end_array<float>();
31
32 using T = decltype(*begin_float);
33 static_assert(fl::is_same<T, fl::ParseResult<float>>::value, "Value type must be ParseResult<float>");
34
35 // Use explicit array iterator style as demonstrated in FEATURE.md
36 // DO NOT CHANGE THIS CODE. FIX THE IMPLIMENTATION IF NECESSARY.
37 for (auto it = begin_float; it != end_float; ++it) {
38 // assert that the value type is ParseResult<float>
39
40 // get the name of the type
41 auto parseResult = *it;
42 if (!parseResult.has_error()) {
43 result.push_back(parseResult.get_value());
44 } else {
45 FL_WARN("jsonArrayToFloatVector: ParseResult<float> has error: " << parseResult.get_error().message);
46 }
47 }
48
49 return result;
50}
void push_back(const T &value)
Definition vector.h:552
bool is_array() const
Definition json.h:1736
bool has_value() const
Definition json.h:2107
JsonValue::template array_iterator< T > begin_array()
Definition json.h:1947
JsonValue::template array_iterator< T > end_array()
Definition json.h:1953
HeapVector< T, Allocator > vector
Definition vector.h:1214

References fl::Json::begin_array(), fl::Json::end_array(), FL_WARN, fl::Json::has_value(), and fl::Json::is_array().

Referenced by fl::ScreenMap::ParseJson().

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

◆ lsrX4()

fl::u8 fl::lsrX4 ( fl::u8 dividend)
inline

Helper function to divide a number by 16, aka four logical shift right (LSR)'s.

On avr-gcc, "u8 >> 4" generates a loop, which is big, and slow. merely forcing it to be four /=2's causes avr-gcc to emit a SWAP instruction followed by an AND 0x0F, which is faster, and smaller.

Definition at line 241 of file colorutils.cpp.

241 {
242#if defined(__AVR__)
243 dividend /= 2;
244 dividend /= 2;
245 dividend /= 2;
246 dividend /= 2;
247#else
248 dividend >>= 4;
249#endif
250 return dividend;
251}

Referenced by ColorFromPalette(), ColorFromPalette(), and ColorFromPalette().

+ Here is the caller graph for this function:

◆ make_error() [1/4]

template<typename T>
result< T > fl::make_error ( const char * message)

Helper function to create an error result from C-string.

Template Parameters
TThe value type
Parameters
messageThe error message
Returns
result containing the error

Definition at line 178 of file promise_result.h.

178 {
179 return result<T>(Error(message));
180}

◆ make_error() [2/4]

template<typename T>
result< T > fl::make_error ( const Error & error)

Helper function to create an error result.

Template Parameters
TThe value type
Parameters
errorThe error
Returns
result containing the error

Definition at line 151 of file promise_result.h.

151 {
152 return result<T>(error);
153}

◆ make_error() [3/4]

template<typename T>
result< T > fl::make_error ( const fl::string & message)

Helper function to create an error result from string.

Template Parameters
TThe value type
Parameters
messageThe error message
Returns
result containing the error

Definition at line 169 of file promise_result.h.

169 {
170 return result<T>(Error(message));
171}

◆ make_error() [4/4]

template<typename T>
result< T > fl::make_error ( Error && error)

Helper function to create an error result (move)

Template Parameters
TThe value type
Parameters
errorThe error (moved)
Returns
result containing the error

Definition at line 160 of file promise_result.h.

160 {
161 return result<T>(fl::move(error));
162}

References move().

+ Here is the call graph for this function:

◆ make_intrusive()

template<typename T, typename... Args>
intrusive_ptr< T > fl::make_intrusive ( Args &&... args)

Definition at line 29 of file memory.h.

29 {
31}
static Ptr< T > New()
Definition ptr_impl.h:18

References args, forward(), and fl::PtrTraits< T >::New().

+ Here is the call graph for this function:

◆ make_optional() [1/2]

template<typename T>
optional< T > fl::make_optional ( const T & value)

Definition at line 120 of file optional.h.

120 {
121 return optional<T>(value);
122}
Optional< T > optional
Definition optional.h:14

Referenced by fl::response::get_header().

+ Here is the caller graph for this function:

◆ make_optional() [2/2]

template<typename T>
optional< T > fl::make_optional ( T && value)

Definition at line 125 of file optional.h.

125 {
126 return optional<T>(fl::move(value));
127}

References move().

+ Here is the call graph for this function:

◆ make_pair()

template<typename T1, typename T2>
pair< typename fl::decay< T1 >::type, typename fl::decay< T2 >::type > fl::make_pair ( T1 && t,
T2 && u )

Definition at line 93 of file pair.h.

93 {
95}
typename conditional< is_array< U >::value, typename remove_extent< U >::type *, typename conditional< is_function< U >::value, typename add_pointer< U >::type, typename remove_cv< U >::type >::type >::type type
Definition pair.h:9

References forward(), and t.

+ Here is the call graph for this function:

◆ make_rejected_promise() [1/2]

template<typename T>
promise< T > fl::make_rejected_promise ( const char * error_message)

Convenience function to create a rejected promise (const char* overload)

Definition at line 240 of file promise.h.

240 {
241 return promise<T>::reject(Error(error_message));
242}
static promise< T > reject(const Error &error)
Create a rejected promise with error.
Definition promise.h:95

References fl::promise< T >::reject().

+ Here is the call graph for this function:

◆ make_rejected_promise() [2/2]

template<typename T>
promise< T > fl::make_rejected_promise ( const fl::string & error_message)

Convenience function to create a rejected promise.

Definition at line 234 of file promise.h.

234 {
235 return promise<T>::reject(Error(error_message));
236}

References fl::promise< T >::reject().

+ Here is the call graph for this function:

◆ make_resolved_promise()

template<typename T>
promise< T > fl::make_resolved_promise ( T value)

Convenience function to create a resolved promise.

Definition at line 228 of file promise.h.

228 {
229 return promise<T>::resolve(fl::move(value));
230}

References move(), and fl::promise< T >::resolve().

+ Here is the call graph for this function:

◆ make_sdcard_filesystem()

FsImplPtr fl::make_sdcard_filesystem ( int cs_pin)

Definition at line 196 of file file_system.cpp.

196 {
197 FASTLED_UNUSED(cs_pin);
199 FsImplPtr out = ptr;
200 return out;
201}
#define FASTLED_UNUSED(x)
Definition unused.h:4

References FASTLED_UNUSED, and make_shared().

Referenced by fl::FileSystem::beginSd().

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

◆ make_shared()

template<typename T, typename... Args>
shared_ptr< T > fl::make_shared ( Args &&... args)
Examples
FxDemoReel100.ino, FxFire2012.ino, and FxGfx2Video.ino.

Definition at line 348 of file shared_ptr.h.

348 {
349 T* obj = new T(fl::forward<Args>(args)...);
350 auto* control = new detail::ControlBlock<T>(obj);
351 //FASTLED_WARN("make_shared created object at " << obj
352 // << " with control block at " << control);
353 //new(control->get_object()) T(fl::forward<Args>(args)...);
354 //control->object_constructed = true;
355 return shared_ptr<T>(obj, control, detail::make_shared_tag{});
356}

Referenced by fl::Blend2d::Blend2d(), fl::DigitalPin::DigitalPin(), fl::FxCompositor::FxCompositor(), fl::Json::Json(), fl::Json::Json(), fl::Json::Json(), fl::Json::Json(), fl::Json::Json(), fl::Json::Json(), fl::Json::Json(), fl::Json::Json(), fl::Json::Json(), fl::LinePath::LinePath(), fl::RosePath::RosePath(), fl::ScreenMap::ScreenMap(), fl::ScreenMap::ScreenMap(), fl::StrN< SIZE >::StrN(), fl::Video::Video(), fl::XYPath::XYPath(), fl::FxEngine::addFx(), fl::UIDropdown::addNextButton(), fl::shared_ptr< T >::allocate_shared, fl::StrN< SIZE >::assign(), fl::XYMap::constructWithLookUpTable(), fl::XMap::convertToLookUpTable(), fl::XYMap::convertToLookUpTable(), fl::StrN< SIZE >::copy(), fl::StrN< SIZE >::copy(), fl::StrN< SIZE >::copy(), fl::promise< T >::create(), fl::TaskImpl::create_after_frame(), fl::TaskImpl::create_after_frame(), fl::TaskImpl::create_at_framerate(), fl::TaskImpl::create_at_framerate(), fl::TaskImpl::create_before_frame(), fl::TaskImpl::create_before_frame(), fl::TaskImpl::create_every_ms(), fl::TaskImpl::create_every_ms(), CreateArgsLower(), CreateArgsUpper(), fl::FxLayer::draw(), FL_DISABLE_WARNING(), fl::Json::from_char(), fl::JsonValue::from_char(), fl::Json::from_value(), fl::FFT::get_or_create(), fl::Corkscrew::getOrCreateInputSurface(), fl::TransformFloatImpl::Identity(), anonymous_namespace{xypaths.cpp}::make_path(), make_sdcard_filesystem(), make_shared_ptr(), fl::XYPath::NewArchimedeanSpiralPath(), fl::XYPath::NewArchimedeanSpiralPath(), fl::XYPath::NewCatmullRomPath(), fl::XYPath::NewCirclePath(), fl::XYPath::NewCirclePath(), fl::XYPath::NewCustomPath(), fl::XYPath::NewGielisCurvePath(), fl::XYPath::NewHeartPath(), fl::XYPath::NewHeartPath(), fl::XYPath::NewLinePath(), fl::XYPath::NewLinePath(), fl::XYPath::NewPhyllotaxisPath(), fl::XYPath::NewPointPath(), fl::XYPath::NewRosePath(), NewWaveSimulation2D(), fl::NullFileSystem::openRead(), fl::Json::operator=(), fl::Json::operator=(), fl::Json::operator[](), fl::JsonValue::operator[](), fl::JsonValue::parse(), fl::Json::push_back(), fl::StrN< SIZE >::reserve(), fl::Json::set(), setup(), fl::JsonValue::to_string(), and fl::StrN< SIZE >::write().

◆ make_shared_no_tracking()

template<typename T>
shared_ptr< T > fl::make_shared_no_tracking ( T & obj)

Definition at line 379 of file shared_ptr.h.

379 {
380 auto* control = new detail::ControlBlock<T, detail::NoDeleter<T>>(&obj, detail::NoDeleter<T>{}, false); // track = false (enables no-tracking mode)
381 return shared_ptr<T>(&obj, control, detail::no_tracking_tag{});
382}

Referenced by fl::Blend2d::add(), fl::FxEngine::addFx(), and fl::Blend2d::setParams().

+ Here is the caller graph for this function:

◆ make_shared_ptr()

template<typename T, typename... Args>
fl::shared_ptr< T > fl::make_shared_ptr ( Args &&... args)

Definition at line 35 of file memory.h.

35 {
37}

References args, forward(), and make_shared().

+ Here is the call graph for this function:

◆ make_shared_with_deleter()

template<typename T, typename Deleter, typename... Args>
shared_ptr< T > fl::make_shared_with_deleter ( Deleter d,
Args &&... args )

Definition at line 359 of file shared_ptr.h.

359 {
360 T* obj = new T(fl::forward<Args>(args)...);
361 auto* control = new detail::ControlBlock<T, Deleter>(obj, d);
362 //new(control->get_object()) T(fl::forward<Args>(args)...);
363 //control->object_constructed = true;
364 return shared_ptr<T>(obj, control, detail::make_shared_tag{});
365}

◆ make_success() [1/2]

template<typename T>
result< T > fl::make_success ( const T & value)

Helper function to create a successful result.

Template Parameters
TThe value type
Parameters
valueThe success value
Returns
result containing the value

Definition at line 133 of file promise_result.h.

133 {
134 return result<T>(value);
135}

◆ make_success() [2/2]

template<typename T>
result< T > fl::make_success ( T && value)

Helper function to create a successful result (move)

Template Parameters
TThe value type
Parameters
valueThe success value (moved)
Returns
result containing the value

Definition at line 142 of file promise_result.h.

142 {
143 return result<T>(fl::move(value));
144}

References move().

+ Here is the call graph for this function:

◆ make_tuple()

template<typename... Ts>
tuple< typename fl::decay< Ts >::type... > fl::make_tuple ( Ts &&... args)

Definition at line 93 of file tuple.h.

References args, and forward().

+ Here is the call graph for this function:

◆ make_unique() [1/2]

template<typename T, typename... Args>
fl::enable_if<!fl::is_array< T >::value, unique_ptr< T > >::type fl::make_unique ( Args &&... args)

Definition at line 42 of file memory.h.

42 {
43 return unique_ptr<T>(new T(fl::forward<Args>(args)...));
44}

References args, and forward().

Referenced by fl::TaskImpl::TaskImpl(), and fl::FetchManager::register_promise().

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

◆ make_unique() [2/2]

template<typename T>
fl::enable_if< fl::is_array< T >::value, unique_ptr< T > >::type fl::make_unique ( fl::size_t size)

Definition at line 49 of file memory.h.

49 {
50 typedef typename fl::remove_extent<T>::type U;
51 return unique_ptr<T>(new U[size]());
52}

◆ Malloc()

void * fl::Malloc ( fl::size size)

Definition at line 110 of file allocator.cpp.

110 {
111 void* ptr = Alloc(size);
112
113#if defined(FASTLED_TESTING)
114 if (gMallocFreeHook && ptr) {
115 MemoryGuard allows_hook;
116 if (allows_hook.enabled()) {
117 gMallocFreeHook->onMalloc(ptr, size);
118 }
119 }
120#endif
121
122 return ptr;
123}

Referenced by fl::allocator< U >::allocate().

+ Here is the caller graph for this function:

◆ max_element() [1/2]

template<typename Iterator>
Iterator fl::max_element ( Iterator first,
Iterator last )

Definition at line 17 of file algorithm.h.

17 {
18 if (first == last) {
19 return last;
20 }
21
22 Iterator max_iter = first;
23 ++first;
24
25 while (first != last) {
26 if (*max_iter < *first) {
27 max_iter = first;
28 }
29 ++first;
30 }
31
32 return max_iter;
33}

◆ max_element() [2/2]

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

Definition at line 36 of file algorithm.h.

36 {
37 if (first == last) {
38 return last;
39 }
40
41 Iterator max_iter = first;
42 ++first;
43
44 while (first != last) {
45 if (comp(*max_iter, *first)) {
46 max_iter = first;
47 }
48 ++first;
49 }
50
51 return max_iter;
52}

◆ memcopy()

void * fl::memcopy ( void * dst,
const void * src,
fl::size num )
inline

Definition at line 30 of file memfill.h.

30 {
31 return ::memcpy(dst, src, num);
32}

Referenced by fl::StrN< SIZE >::copy(), and FL_DISABLE_WARNING().

+ Here is the caller graph for this function:

◆ memfill() [1/2]

template<typename T>
void * fl::memfill ( T * ptr,
int value,
fl::size num )
inline

Definition at line 19 of file memfill.h.

19 {
20 union memfill_union { // For type aliasing safety.
21 T* ptr;
22 void* void_ptr;
23 };
24 memfill_union u;
25 u.ptr = ptr;
26 return fl::memfill(u.void_ptr, value, num);
27}
void * memfill(void *ptr, int value, fl::size num)
Definition memfill.h:11

References memfill().

+ Here is the call graph for this function:

◆ memfill() [2/2]

void * fl::memfill ( void * ptr,
int value,
fl::size num )
inline

Definition at line 11 of file memfill.h.

11 {
12 return ::memset(ptr, value, num);
13}

Referenced by fl::FFT_Args::FFT_Args(), fl::FFTContext::FFTContext(), fl::Frame::Frame(), fl::InlinedMemoryBlock< T, N >::InlinedMemoryBlock(), fl::allocator_inlined< T, N, BaseAllocator >::InlinedStorage::InlinedStorage(), Message< Settings::SysExMaxSize >::Message(), fl::allocator< U >::allocate(), fl::SlabAllocator< T, SLAB_SIZE >::allocate(), fl::Frame::clear(), CLEDController::clearLedDataInternal(), clearLeds(), fl::FxLayer::draw(), fill_2dnoise16(), fill_2dnoise8(), fill_noise16(), fill_noise8(), FL_DISABLE_WARNING(), fl::FixedVector< PairKV, N >::insert(), fl::FixedVector< PairKV, N >::insert(), memfill(), fl::bitset_dynamic::reset(), fl::bitset_dynamic::resize(), and shiftUp().

+ Here is the caller graph for this function:

◆ min_element() [1/2]

template<typename Iterator>
Iterator fl::min_element ( Iterator first,
Iterator last )

Definition at line 55 of file algorithm.h.

55 {
56 if (first == last) {
57 return last;
58 }
59
60 Iterator min_iter = first;
61 ++first;
62
63 while (first != last) {
64 if (*first < *min_iter) {
65 min_iter = first;
66 }
67 ++first;
68 }
69
70 return min_iter;
71}

◆ min_element() [2/2]

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

Definition at line 74 of file algorithm.h.

74 {
75 if (first == last) {
76 return last;
77 }
78
79 Iterator min_iter = first;
80 ++first;
81
82 while (first != last) {
83 if (comp(*first, *min_iter)) {
84 min_iter = first;
85 }
86 ++first;
87 }
88
89 return min_iter;
90}

◆ move()

template<typename T>
remove_reference< T >::type && fl::move ( T && t)
constexprnoexcept

Definition at line 27 of file move.h.

27 {
28 return static_cast<typename remove_reference<T>::type &&>(t);
29}

References t.

Referenced by fl::deque< int >::deque(), fl::Error::Error(), fl::FFTBins::FFTBins(), fl::Json::Json(), fl::Optional< T >::Optional(), fl::Optional< T >::Optional(), fl::pair< const Key, T >::pair(), fl::pair< const Key, T >::pair(), fl::queue< T, Container >::queue(), fl::result< T >::result(), fl::result< T >::result(), fl::task::task(), fl::tuple< Head, Tail... >::tuple(), fl::unique_ptr< T, Deleter >::unique_ptr(), fl::unique_ptr< T, Deleter >::unique_ptr(), fl::unique_ptr< T, Deleter >::unique_ptr(), fl::unique_ptr< T[], Deleter >::unique_ptr(), fl::unique_ptr< T[], Deleter >::unique_ptr(), fl::unique_ptr< T[], Deleter >::unique_ptr(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::Variant(), fl::XYDrawComposited::XYDrawComposited(), fl::XYDrawGradient::XYDrawGradient(), fl::Scheduler::add_task(), fl::swap_impl< T, false >::apply(), fl::promise< T >::catch_(), fl::task::catch_(), fl::FetchManager::cleanup_completed_promises(), fl::promise< T >::complete_with_value(), fl::RedBlackTree< value_type, PairCompare, Allocator >::emplace(), fl::unordered_set< Key >::emplace(), fl::VectorSet< Key, Allocator >::emplace(), fl::VectorSetFixed< Key, N >::emplace(), fl::deque< int >::ensure_capacity(), fl::HeapVector< DrawItem >::ensure_size(), fl::FixedVector< PairKV, N >::erase(), fl::HeapVector< DrawItem >::erase(), FL_DISABLE_WARNING(), FL_DISABLE_WARNING(), get(), get(), fl::FixedMap< int, FxPtr, FASTLED_FX_ENGINE_MAX_FX >::insert(), fl::FixedVector< PairKV, N >::insert(), fl::FixedVector< PairKV, N >::insert(), fl::HashMap< Key, T, Hash, KeyEqual >::insert(), fl::HeapVector< DrawItem >::insert(), fl::InlinedVector< T, INLINED_SIZE >::insert(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >::insert(), fl::RedBlackTree< value_type, PairCompare, Allocator >::insert(), fl::set< T, fl::allocator_inlined_slab< T, N > >::insert(), fl::SetRedBlackTree< Key, fl::less< Key >, Allocator >::insert(), fl::SortedHeapMap< fl::u32, FramePtr, Less >::insert(), fl::SortedHeapMap< fl::u32, FramePtr, Less >::insert(), fl::unordered_set< Key >::insert(), fl::VectorSet< Key, Allocator >::insert(), fl::VectorSetFixed< Key, N >::insert(), fl::detail::insertion_sort(), make_error(), make_optional(), make_resolved_promise(), make_success(), fl::detail::merge_inplace(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::move_fn(), fl::FFTBins::operator=(), fl::Optional< T >::operator=(), fl::ScreenMap::operator=(), fl::unique_ptr< T, Deleter >::operator=(), fl::unique_ptr< T, Deleter >::operator=(), fl::unique_ptr< T[], Deleter >::operator=(), fl::unique_ptr< T[], Deleter >::operator=(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::operator=(), fl::Json::operator[](), fl::JsonValue::operator[](), fl::JsonValue::parse(), fl::ScreenMap::ParseJson(), fl::queue< T, Container >::push(), fl::deque< int >::push_back(), fl::FixedVector< PairKV, N >::push_back(), fl::HeapVector< DrawItem >::push_back(), fl::InlinedVector< T, INLINED_SIZE >::push_back(), fl::InlinedVector< T, INLINED_SIZE >::push_back(), fl::Json::push_back(), fl::deque< int >::push_front(), fl::HashMap< Key, T, Hash, KeyEqual >::rehash(), remove(), remove_if(), fl::HeapVector< DrawItem >::resize(), fl::detail::PromiseImpl< T >::resolve(), fl::promise< T >::resolve(), fl::TaskImpl::set_catch(), fl::detail::PromiseImpl< T >::set_catch_callback(), fl::TaskImpl::set_then(), fl::detail::PromiseImpl< T >::set_then_callback(), fl::promise< T >::then(), fl::task::then(), fl::FixedMap< int, FxPtr, FASTLED_FX_ENGINE_MAX_FX >::update(), and fl::SortedHeapMap< fl::u32, FramePtr, Less >::update().

◆ MurmurHash3_x86_32()

static u32 fl::MurmurHash3_x86_32 ( const void * key,
fl::size len,
u32 seed = 0 )
inlinestatic

Definition at line 23 of file hash.h.

24 {
25
27 FL_DISABLE_WARNING_IMPLICIT_FALLTHROUGH;
28
29 const fl::u8 *data = static_cast<const fl::u8 *>(key);
30 const int nblocks = int(len / 4);
31
32 u32 h1 = seed;
33 const u32 c1 = 0xcc9e2d51;
34 const u32 c2 = 0x1b873593;
35
36 // body
37 const u32 *blocks = reinterpret_cast<const u32 *>(data);
38 for (int i = 0; i < nblocks; ++i) {
39 u32 k1 = blocks[i];
40 k1 *= c1;
41 k1 = (k1 << 15) | (k1 >> 17);
42 k1 *= c2;
43
44 h1 ^= k1;
45 h1 = (h1 << 13) | (h1 >> 19);
46 h1 = h1 * 5 + 0xe6546b64;
47 }
48
49 // tail
50 const fl::u8 *tail = data + (nblocks * 4);
51 u32 k1 = 0;
52 switch (len & 3) {
53 case 3:
54 k1 ^= u32(tail[2]) << 16;
55 case 2:
56 k1 ^= u32(tail[1]) << 8;
57 case 1:
58 k1 ^= u32(tail[0]);
59 k1 *= c1;
60 k1 = (k1 << 15) | (k1 >> 17);
61 k1 *= c2;
62 h1 ^= k1;
63 }
64
65 // finalization
66 h1 ^= u32(len);
67 // fmix32
68 h1 ^= h1 >> 16;
69 h1 *= 0x85ebca6b;
70 h1 ^= h1 >> 13;
71 h1 *= 0xc2b2ae35;
72 h1 ^= h1 >> 16;
73
74 return h1;
75
77}
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP

References FL_DISABLE_WARNING_POP, and FL_DISABLE_WARNING_PUSH.

Referenced by fl::FastHash< vec2< T > >::operator()(), fl::Hash< double >::operator()(), fl::Hash< FFT_Args >::operator()(), fl::Hash< fl::string >::operator()(), fl::Hash< fl::WeakPtr< T > >::operator()(), fl::Hash< Key >::operator()(), fl::Hash< T * >::operator()(), and fl::Hash< vec2< T > >::operator()().

+ Here is the caller graph for this function:

◆ napplyGamma_video() [1/4]

CRGB & fl::napplyGamma_video ( CRGB & rgb,
float gamma )

Definition at line 1086 of file colorutils.cpp.

1086 {
1087 rgb = applyGamma_video(rgb, gamma);
1088 return rgb;
1089}

References applyGamma_video().

+ Here is the call graph for this function:

◆ napplyGamma_video() [2/4]

CRGB & fl::napplyGamma_video ( CRGB & rgb,
float gammaR,
float gammaG,
float gammaB )

Definition at line 1091 of file colorutils.cpp.

1091 {
1092 rgb = applyGamma_video(rgb, gammaR, gammaG, gammaB);
1093 return rgb;
1094}

References applyGamma_video().

+ Here is the call graph for this function:

◆ napplyGamma_video() [3/4]

void fl::napplyGamma_video ( CRGB * rgbarray,
fl::u16 count,
float gamma )

Definition at line 1096 of file colorutils.cpp.

1096 {
1097 for (fl::u16 i = 0; i < count; ++i) {
1098 rgbarray[i] = applyGamma_video(rgbarray[i], gamma);
1099 }
1100}

References applyGamma_video().

+ Here is the call graph for this function:

◆ napplyGamma_video() [4/4]

void fl::napplyGamma_video ( CRGB * rgbarray,
fl::u16 count,
float gammaR,
float gammaG,
float gammaB )

Definition at line 1102 of file colorutils.cpp.

1103 {
1104 for (fl::u16 i = 0; i < count; ++i) {
1105 rgbarray[i] = applyGamma_video(rgbarray[i], gammaR, gammaG, gammaB);
1106 }
1107}

References applyGamma_video().

+ Here is the call graph for this function:

◆ nblend() [1/4]

CHSV & fl::nblend ( CHSV & existing,
const CHSV & overlay,
fract8 amountOfOverlay,
TGradientDirectionCode directionCode )

Definition at line 75 of file colorutils.cpp.

76 {
77 if (amountOfOverlay == 0) {
78 return existing;
79 }
80
81 if (amountOfOverlay == 255) {
82 existing = overlay;
83 return existing;
84 }
85
86 fract8 amountOfKeep = 255 - amountOfOverlay;
87
88 fl::u8 huedelta8 = overlay.hue - existing.hue;
89
90 if (directionCode == SHORTEST_HUES) {
91 directionCode = FORWARD_HUES;
92 if (huedelta8 > 127) {
93 directionCode = BACKWARD_HUES;
94 }
95 }
96
97 if (directionCode == LONGEST_HUES) {
98 directionCode = FORWARD_HUES;
99 if (huedelta8 < 128) {
100 directionCode = BACKWARD_HUES;
101 }
102 }
103
104 if (directionCode == FORWARD_HUES) {
105 existing.hue = existing.hue + scale8(huedelta8, amountOfOverlay);
106 } else /* directionCode == BACKWARD_HUES */
107 {
108 huedelta8 = -huedelta8;
109 existing.hue = existing.hue - scale8(huedelta8, amountOfOverlay);
110 }
111
112 existing.sat = scale8_LEAVING_R1_DIRTY(existing.sat, amountOfKeep) +
113 scale8_LEAVING_R1_DIRTY(overlay.sat, amountOfOverlay);
114 existing.val = scale8_LEAVING_R1_DIRTY(existing.val, amountOfKeep) +
115 scale8_LEAVING_R1_DIRTY(overlay.val, amountOfOverlay);
116
117 cleanup_R1();
118
119 return existing;
120}
u8 fract8
Fixed-Point Fractional Types.
Definition int.h:49

References BACKWARD_HUES, cleanup_R1(), FORWARD_HUES, LONGEST_HUES, scale8(), scale8_LEAVING_R1_DIRTY(), and SHORTEST_HUES.

+ Here is the call graph for this function:

◆ nblend() [2/4]

void fl::nblend ( CHSV * existing,
const CHSV * overlay,
fl::u16 count,
fract8 amountOfOverlay,
TGradientDirectionCode directionCode )

Definition at line 122 of file colorutils.cpp.

123 {
124 if (existing == overlay)
125 return;
126 for (fl::u16 i = count; i; --i) {
127 nblend(*existing, *overlay, amountOfOverlay, directionCode);
128 ++existing;
129 ++overlay;
130 }
131}

References nblend().

+ Here is the call graph for this function:

◆ nblend() [3/4]

CRGB & fl::nblend ( CRGB & existing,
const CRGB & overlay,
fract8 amountOfOverlay )

Definition at line 20 of file colorutils.cpp.

20 {
21 if (amountOfOverlay == 0) {
22 return existing;
23 }
24
25 if (amountOfOverlay == 255) {
26 existing = overlay;
27 return existing;
28 }
29
30#if 0
31 // Old blend method which unfortunately had some rounding errors
32 fract8 amountOfKeep = 255 - amountOfOverlay;
33
34 existing.red = scale8_LEAVING_R1_DIRTY( existing.red, amountOfKeep)
35 + scale8_LEAVING_R1_DIRTY( overlay.red, amountOfOverlay);
36 existing.green = scale8_LEAVING_R1_DIRTY( existing.green, amountOfKeep)
37 + scale8_LEAVING_R1_DIRTY( overlay.green, amountOfOverlay);
38 existing.blue = scale8_LEAVING_R1_DIRTY( existing.blue, amountOfKeep)
39 + scale8_LEAVING_R1_DIRTY( overlay.blue, amountOfOverlay);
40
41 cleanup_R1();
42#else
43 // Corrected blend method, with no loss-of-precision rounding errors
44 existing.red = blend8(existing.red, overlay.red, amountOfOverlay);
45 existing.green = blend8(existing.green, overlay.green, amountOfOverlay);
46 existing.blue = blend8(existing.blue, overlay.blue, amountOfOverlay);
47#endif
48
49 return existing;
50}
LIB8STATIC uint8_t blend8(uint8_t a, uint8_t b, uint8_t amountOfB)
Blend a variable proportion (0-255) of one byte to another.
Definition math8.h:683

References blend8(), cleanup_R1(), and scale8_LEAVING_R1_DIRTY().

Referenced by blend(), blend(), fl::Pride2015::draw(), nblend(), and nblend().

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

◆ nblend() [4/4]

void fl::nblend ( CRGB * existing,
const CRGB * overlay,
fl::u16 count,
fract8 amountOfOverlay )

Definition at line 52 of file colorutils.cpp.

53 {
54 for (fl::u16 i = count; i; --i) {
55 nblend(*existing, *overlay, amountOfOverlay);
56 ++existing;
57 ++overlay;
58 }
59}

References nblend().

+ Here is the call graph for this function:

◆ nblendPaletteTowardPalette()

void fl::nblendPaletteTowardPalette ( CRGBPalette16 & current,
CRGBPalette16 & target,
fl::u8 maxChanges )

Definition at line 1018 of file colorutils.cpp.

1019 {
1020 fl::u8 *p1;
1021 fl::u8 *p2;
1022 fl::u8 changes = 0;
1023
1024 p1 = (fl::u8 *)current.entries;
1025 p2 = (fl::u8 *)target.entries;
1026
1027 const fl::u8 totalChannels = sizeof(CRGBPalette16);
1028 for (fl::u8 i = 0; i < totalChannels; ++i) {
1029 // if the values are equal, no changes are needed
1030 if (p1[i] == p2[i]) {
1031 continue;
1032 }
1033
1034 // if the current value is less than the target, increase it by one
1035 if (p1[i] < p2[i]) {
1036 ++p1[i];
1037 ++changes;
1038 }
1039
1040 // if the current value is greater than the target,
1041 // increase it by one (or two if it's still greater).
1042 if (p1[i] > p2[i]) {
1043 --p1[i];
1044 ++changes;
1045 if (p1[i] > p2[i]) {
1046 --p1[i];
1047 }
1048 }
1049
1050 // if we've hit the maximum number of changes, exit
1051 if (changes >= maxChanges) {
1052 break;
1053 }
1054 }
1055}

Referenced by fl::TwinkleFox::draw(), and loop().

+ Here is the caller graph for this function:

◆ NewPtr()

template<typename T, typename... Args>
Ptr< T > fl::NewPtr ( Args... args)
inline

Definition at line 313 of file ptr_impl.h.

313 {
314 return Ptr<T>::New(args...);
315}

References args, and fl::PtrTraits< T >::New().

+ Here is the call graph for this function:

◆ NewPtrNoTracking() [1/2]

template<typename T, typename... Args>
Ptr< T > fl::NewPtrNoTracking ( Args... args)

References args.

◆ NewPtrNoTracking() [2/2]

template<typename T>
Ptr< T > fl::NewPtrNoTracking ( T & obj)
inline

Definition at line 318 of file ptr_impl.h.

318 {
319 return Ptr<T>::NoTracking(obj);
320}
static Ptr NoTracking(T &referent)
Definition ptr.h:130

References fl::Ptr< T >::NoTracking().

+ Here is the call graph for this function:

◆ nscale8()

void fl::nscale8 ( CRGB * leds,
fl::u16 num_leds,
fl::u8 scale )

Definition at line 170 of file colorutils.cpp.

170 {
171 for (fl::u16 i = 0; i < num_leds; ++i) {
172 leds[i].nscale8(scale);
173 }
174}

References leds, and scale.

Referenced by fade_raw(), and fadeToBlackBy().

+ Here is the caller graph for this function:

◆ nscale8_video()

void fl::nscale8_video ( CRGB * leds,
fl::u16 num_leds,
fl::u8 scale )

Definition at line 148 of file colorutils.cpp.

148 {
149 for (fl::u16 i = 0; i < num_leds; ++i) {
150 leds[i].nscale8_video(scale);
151 }
152}

References leds, and scale.

Referenced by fade_video(), and fadeLightBy().

+ Here is the caller graph for this function:

◆ operator!=() [1/8]

template<typename T, fl::size N>
bool fl::operator!= ( const array< T, N > & lhs,
const array< T, N > & rhs )

Definition at line 151 of file array.h.

151 {
152 return !(lhs == rhs);
153}

◆ operator!=() [2/8]

template<typename T1, typename T2, typename U1, typename U2>
bool fl::operator!= ( const pair< T1, T2 > & lhs,
const pair< U1, U2 > & rhs )

Definition at line 61 of file pair.h.

61 {
62 return !(lhs == rhs);
63}

◆ operator!=() [3/8]

template<typename T, typename Y>
bool fl::operator!= ( const shared_ptr< T > & lhs,
const shared_ptr< Y > & rhs )
noexcept

Definition at line 399 of file shared_ptr.h.

399 {
400 return lhs.get() != rhs.get();
401}

◆ operator!=() [4/8]

template<typename T>
bool fl::operator!= ( const shared_ptr< T > & lhs,
fl::nullptr_t  )
noexcept

Definition at line 434 of file shared_ptr.h.

434 {
435 return lhs.get() != nullptr;
436}

◆ operator!=() [5/8]

template<typename T, typename Deleter>
bool fl::operator!= ( const unique_ptr< T, Deleter > & ptr,
fl::nullptr_t  )
noexcept

Definition at line 246 of file unique_ptr.h.

246 {
247 return static_cast<bool>(ptr);
248}

◆ operator!=() [6/8]

template<typename T1, typename Deleter1, typename T2, typename Deleter2>
bool fl::operator!= ( const unique_ptr< T1, Deleter1 > & lhs,
const unique_ptr< T2, Deleter2 > & rhs )

Definition at line 231 of file unique_ptr.h.

231 {
232 return !(lhs == rhs);
233}

◆ operator!=() [7/8]

template<typename T>
bool fl::operator!= ( fl::nullptr_t ,
const shared_ptr< T > & rhs )
noexcept

Definition at line 439 of file shared_ptr.h.

439 {
440 return nullptr != rhs.get();
441}

◆ operator!=() [8/8]

template<typename T, typename Deleter>
bool fl::operator!= ( fl::nullptr_t ,
const unique_ptr< T, Deleter > & ptr )
noexcept

Definition at line 251 of file unique_ptr.h.

251 {
252 return static_cast<bool>(ptr);
253}

◆ operator+() [1/7]

string fl::operator+ ( const char * lhs,
const string & rhs )
inline

Definition at line 974 of file str.h.

974 {
975 string result(lhs);
976 result += rhs;
977 return result;
978}

◆ operator+() [2/7]

template<typename T>
string fl::operator+ ( const char * lhs,
const T & rhs )
inline

Definition at line 996 of file str.h.

996 {
997 string result(lhs);
998 result += rhs;
999 return result;
1000}

◆ operator+() [3/7]

string fl::operator+ ( const string & lhs,
const char * rhs )
inline

Definition at line 981 of file str.h.

981 {
982 string result(lhs);
983 result += rhs;
984 return result;
985}

◆ operator+() [4/7]

string fl::operator+ ( const string & lhs,
const string & rhs )
inline

Definition at line 988 of file str.h.

988 {
989 string result(lhs);
990 result += rhs;
991 return result;
992}

◆ operator+() [5/7]

template<typename T>
string fl::operator+ ( const string & lhs,
const T & rhs )
inline

Definition at line 1013 of file str.h.

1013 {
1014 string result(lhs);
1015 result += rhs;
1016 return result;
1017}

◆ operator+() [6/7]

template<typename T>
string fl::operator+ ( const T & lhs,
const char * rhs )
inline

Definition at line 1004 of file str.h.

1004 {
1005 string result;
1006 result.append(lhs);
1007 result += rhs;
1008 return result;
1009}

◆ operator+() [7/7]

template<typename T>
string fl::operator+ ( const T & lhs,
const string & rhs )
inline

Definition at line 1021 of file str.h.

1021 {
1022 string result;
1023 result.append(lhs);
1024 result += rhs;
1025 return result;
1026}

◆ operator<() [1/2]

template<typename T1, typename T2, typename U1, typename U2>
bool fl::operator< ( const pair< T1, T2 > & lhs,
const pair< U1, U2 > & rhs )

Definition at line 66 of file pair.h.

66 {
67 return lhs.first < rhs.first || (!(rhs.first < lhs.first) && lhs.second < rhs.second);
68}

References fl::pair< T1, T2 >::first, and fl::pair< T1, T2 >::second.

◆ operator<() [2/2]

template<typename T, typename Y>
bool fl::operator< ( const shared_ptr< T > & lhs,
const shared_ptr< Y > & rhs )
noexcept

Definition at line 404 of file shared_ptr.h.

404 {
405 return lhs.get() < rhs.get();
406}

◆ operator<<()

ostream & fl::operator<< ( ostream & os,
const endl_t &  )
inline

Definition at line 135 of file ostream.h.

135 {
136 os << "\n";
137 return os;
138}

◆ operator<=() [1/2]

template<typename T1, typename T2, typename U1, typename U2>
bool fl::operator<= ( const pair< T1, T2 > & lhs,
const pair< U1, U2 > & rhs )

Definition at line 71 of file pair.h.

71 {
72 return !(rhs < lhs);
73}

◆ operator<=() [2/2]

template<typename T, typename Y>
bool fl::operator<= ( const shared_ptr< T > & lhs,
const shared_ptr< Y > & rhs )
noexcept

Definition at line 409 of file shared_ptr.h.

409 {
410 return lhs.get() <= rhs.get();
411}

◆ operator==() [1/8]

template<typename T, fl::size N>
bool fl::operator== ( const array< T, N > & lhs,
const array< T, N > & rhs )

Definition at line 141 of file array.h.

141 {
142 // return std::equal(lhs.begin(), lhs.end(), rhs.begin());
143 for (fl::size i = 0; i < N; ++i) {
144 if (lhs[i] != rhs[i]) {
145 return false;
146 }
147 }
148}

◆ operator==() [2/8]

template<typename T1, typename T2, typename U1, typename U2>
bool fl::operator== ( const pair< T1, T2 > & lhs,
const pair< U1, U2 > & rhs )

Definition at line 56 of file pair.h.

56 {
57 return lhs.first == rhs.first && lhs.second == rhs.second;
58}

References fl::pair< T1, T2 >::first, and fl::pair< T1, T2 >::second.

◆ operator==() [3/8]

template<typename T, typename Y>
bool fl::operator== ( const shared_ptr< T > & lhs,
const shared_ptr< Y > & rhs )
noexcept

Definition at line 394 of file shared_ptr.h.

394 {
395 return lhs.get() == rhs.get();
396}

◆ operator==() [4/8]

template<typename T>
bool fl::operator== ( const shared_ptr< T > & lhs,
fl::nullptr_t  )
noexcept

Definition at line 424 of file shared_ptr.h.

424 {
425 return lhs.get() == nullptr;
426}

◆ operator==() [5/8]

template<typename T, typename Deleter>
bool fl::operator== ( const unique_ptr< T, Deleter > & ptr,
fl::nullptr_t  )
noexcept

Definition at line 236 of file unique_ptr.h.

236 {
237 return !ptr;
238}

◆ operator==() [6/8]

template<typename T1, typename Deleter1, typename T2, typename Deleter2>
bool fl::operator== ( const unique_ptr< T1, Deleter1 > & lhs,
const unique_ptr< T2, Deleter2 > & rhs )

Definition at line 226 of file unique_ptr.h.

226 {
227 return lhs.get() == rhs.get();
228}
pointer get() const noexcept
Definition unique_ptr.h:94

References fl::unique_ptr< T, Deleter >::get().

+ Here is the call graph for this function:

◆ operator==() [7/8]

template<typename T>
bool fl::operator== ( fl::nullptr_t ,
const shared_ptr< T > & rhs )
noexcept

Definition at line 429 of file shared_ptr.h.

429 {
430 return nullptr == rhs.get();
431}

◆ operator==() [8/8]

template<typename T, typename Deleter>
bool fl::operator== ( fl::nullptr_t ,
const unique_ptr< T, Deleter > & ptr )
noexcept

Definition at line 241 of file unique_ptr.h.

241 {
242 return !ptr;
243}

◆ operator>() [1/2]

template<typename T1, typename T2, typename U1, typename U2>
bool fl::operator> ( const pair< T1, T2 > & lhs,
const pair< U1, U2 > & rhs )

Definition at line 76 of file pair.h.

76 {
77 return rhs < lhs;
78}

◆ operator>() [2/2]

template<typename T, typename Y>
bool fl::operator> ( const shared_ptr< T > & lhs,
const shared_ptr< Y > & rhs )
noexcept

Definition at line 414 of file shared_ptr.h.

414 {
415 return lhs.get() > rhs.get();
416}

◆ operator>=() [1/2]

template<typename T1, typename T2, typename U1, typename U2>
bool fl::operator>= ( const pair< T1, T2 > & lhs,
const pair< U1, U2 > & rhs )

Definition at line 81 of file pair.h.

81 {
82 return !(lhs < rhs);
83}

◆ operator>=() [2/2]

template<typename T, typename Y>
bool fl::operator>= ( const shared_ptr< T > & lhs,
const shared_ptr< Y > & rhs )
noexcept

Definition at line 419 of file shared_ptr.h.

419 {
420 return lhs.get() >= rhs.get();
421}

◆ pop_heap() [1/2]

template<typename Iterator>
void fl::pop_heap ( Iterator first,
Iterator last )

Definition at line 61 of file priority_queue.h.

61 {
62 pop_heap(first, last, [](const auto &a, const auto &b) { return a < b; });
63}
void pop_heap(Iterator first, Iterator last, Compare comp)

References pop_heap().

+ Here is the call graph for this function:

◆ pop_heap() [2/2]

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

Definition at line 52 of file priority_queue.h.

52 {
53 --last;
54 auto tmp = *first;
55 *first = *last;
56 *last = tmp;
57
58 sift_down(first, last, first, comp);
59}
void sift_down(Iterator first, Iterator last, Iterator start, Compare comp)

References sift_down().

Referenced by fl::PriorityQueue< T, Compare, VectorT >::pop(), and pop_heap().

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

◆ print()

void fl::print ( const char * str)

Definition at line 49 of file io.cpp.

49 {
50 if (!str) return;
51
52#ifdef FASTLED_TESTING
53 // Check for injected handler first
54 if (get_print_handler()) {
55 get_print_handler()(str);
56 return;
57 }
58#endif
59
60#ifdef __EMSCRIPTEN__
61 print_wasm(str);
62#elif defined(FASTLED_TESTING) || defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
63 print_native(str);
64#elif defined(ESP32) || defined(ESP8266)
65 print_esp(str);
66#elif defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)
67 print_avr(str);
68#elif defined(__MKL26Z64__)
69 // Teensy LC uses special no-op functions to avoid _write linker issues
70 print_teensy_lc(str);
71#elif defined(__IMXRT1062__) || defined(__MK66FX1M0__) || defined(__MK64FX512__) || defined(__MK20DX256__) || defined(__MK20DX128__)
72 // All other Teensy platforms use lightweight implementation
73 print_teensy(str);
74#else
75 // Use generic Arduino print for all other platforms including:
76 // - STM32 (STM32F1, STM32F4, STM32H7, ARDUINO_GIGA)
77 // - NRF (NRF52, NRF52832, NRF52840, ARDUINO_NRF52_DK)
78 // - All other Arduino-compatible platforms
79 print_arduino(str);
80#endif
81}

Referenced by fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), fl::ostream::operator<<(), and printf().

+ Here is the caller graph for this function:

◆ printf()

template<typename... Args>
void fl::printf ( const char * format,
const Args &... args )

Printf-like formatting function that prints directly to the platform output.

Parameters
formatFormat string with placeholders like "%d", "%s", "%f" etc.
argsArguments to format

Supported format specifiers:

Example usage:

fl::printf("Value: %d, Name: %s", 42, "test");
fl::printf("Float: %.2f", 3.14159);
void printf(const char *format, const Args &... args)
Printf-like formatting function that prints directly to the platform output.
Definition printf.h:393

Definition at line 393 of file printf.h.

393 {
394 StrStream stream;
395 printf_detail::format_impl(stream, format, args...);
396 fl::print(stream.str().c_str());
397}
const char * c_str() const
Definition str.h:326
const string & str() const
Definition strstream.h:51
void format_impl(StrStream &stream, const char *format)
Definition printf.h:326
void print(const char *str)
Definition io.cpp:49

References args, fl::StrN< SIZE >::c_str(), fl::printf_detail::format_impl(), print(), and fl::StrStream::str().

+ Here is the call graph for this function:

◆ println()

void fl::println ( const char * str)

Definition at line 83 of file io.cpp.

83 {
84 if (!str) return;
85
86#ifdef FASTLED_TESTING
87 // Check for injected handler first
88 if (get_println_handler()) {
89 get_println_handler()(str);
90 return;
91 }
92#endif
93
94#ifdef __EMSCRIPTEN__
95 println_wasm(str);
96#elif defined(FASTLED_TESTING) || defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
97 println_native(str);
98#elif defined(ESP32) || defined(ESP8266)
99 println_esp(str);
100#elif defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)
101 println_avr(str);
102#elif defined(__MKL26Z64__)
103 // Teensy LC uses special no-op functions to avoid _write linker issues
104 println_teensy_lc(str);
105#elif defined(__IMXRT1062__) || defined(__MK66FX1M0__) || defined(__MK64FX512__) || defined(__MK20DX256__) || defined(__MK20DX128__)
106 // All other Teensy platforms use lightweight implementation
107 println_teensy(str);
108#else
109 // Use generic Arduino print for all other platforms including:
110 // - STM32 (STM32F1, STM32F4, STM32H7, ARDUINO_GIGA)
111 // - NRF (NRF52, NRF52832, NRF52840, ARDUINO_NRF52_DK)
112 // - All other Arduino-compatible platforms
113 println_arduino(str);
114#endif
115}

◆ PSRamAllocate()

void * fl::PSRamAllocate ( fl::size size,
bool zero )

Definition at line 77 of file allocator.cpp.

77 {
78
79 void *ptr = Alloc(size);
80 if (ptr && zero) {
81 memset(ptr, 0, size);
82 }
83
84#if defined(FASTLED_TESTING)
85 if (gMallocFreeHook && ptr) {
86 MemoryGuard allows_hook;
87 if (allows_hook.enabled()) {
88 gMallocFreeHook->onMalloc(ptr, size);
89 }
90 }
91#endif
92
93 return ptr;
94}

Referenced by fl::PSRamAllocator< T >::Alloc().

+ Here is the caller graph for this function:

◆ PSRamDeallocate()

void fl::PSRamDeallocate ( void * ptr)

Definition at line 96 of file allocator.cpp.

96 {
97#if defined(FASTLED_TESTING)
98 if (gMallocFreeHook && ptr) {
99 // gMallocFreeHook->onFree(ptr);
100 MemoryGuard allows_hook;
101 if (allows_hook.enabled()) {
102 gMallocFreeHook->onFree(ptr);
103 }
104 }
105#endif
106
107 Dealloc(ptr);
108}

Referenced by fl::PSRamAllocator< T >::Free().

+ Here is the caller graph for this function:

◆ ptr_to_int()

template<typename T>
uptr fl::ptr_to_int ( T * ptr)
noexcept

Definition at line 65 of file bit_cast.h.

65 {
66 return bit_cast<uptr>(ptr);
67}

References bit_cast().

Referenced by CLEDController::endShowLeds().

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

◆ push_heap() [1/2]

template<typename Iterator>
void fl::push_heap ( Iterator first,
Iterator last )

Definition at line 47 of file priority_queue.h.

47 {
48 push_heap(first, last, [](const auto &a, const auto &b) { return a < b; });
49}
void push_heap(Iterator first, Iterator last, Compare comp)

References push_heap().

+ Here is the call graph for this function:

◆ push_heap() [2/2]

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

Definition at line 33 of file priority_queue.h.

33 {
34 auto pos = last - 1;
35 auto parent = first + ((pos - first) - 1) / 2;
36
37 while (pos > first && comp(*parent, *pos)) {
38 auto tmp = *parent;
39 *parent = *pos;
40 *pos = tmp;
41
42 pos = parent;
43 parent = first + ((pos - first) - 1) / 2;
44 }
45}
uint8_t pos
Definition Blur.ino:11

References pos.

Referenced by fl::PriorityQueue< T, Compare, VectorT >::push(), and push_heap().

+ Here is the caller graph for this function:

◆ read()

int fl::read ( )

Definition at line 148 of file io.cpp.

148 {
149#ifdef FASTLED_TESTING
150 // Check for injected handler first
151 if (get_read_handler()) {
152 return get_read_handler()();
153 }
154#endif
155
156#ifdef __EMSCRIPTEN__
157 return read_wasm();
158#elif defined(FASTLED_TESTING) || defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
159 return read_native();
160#elif defined(ESP32) || defined(ESP8266)
161 return read_esp();
162#elif defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)
163 return read_avr();
164#elif defined(__MKL26Z64__)
165 // Teensy LC uses special no-op functions to avoid _write linker issues
166 return read_teensy_lc();
167#elif defined(__IMXRT1062__) || defined(__MK66FX1M0__) || defined(__MK64FX512__) || defined(__MK20DX256__) || defined(__MK20DX128__)
168 // All other Teensy platforms use lightweight implementation
169 return read_teensy();
170#else
171 // Use generic Arduino input for all other platforms including:
172 // - STM32 (STM32F1, STM32F4, STM32H7, ARDUINO_GIGA)
173 // - NRF (NRF52, NRF52832, NRF52840, ARDUINO_NRF52_DK)
174 // - All other Arduino-compatible platforms
175 return read_arduino();
176#endif
177}

Referenced by fl::istream_real::get(), fl::istream_real::getline(), fl::ByteStream::readCRGB(), fl::FileHandle::readCRGB(), fl::PixelStream::readFrameAt(), and fl::istream_real::readLine().

+ Here is the caller graph for this function:

◆ reinterpret_pointer_cast()

template<typename T, typename Y>
shared_ptr< T > fl::reinterpret_pointer_cast ( const shared_ptr< Y > & other)
noexcept

Definition at line 464 of file shared_ptr.h.

464 {
465 auto ptr = fl::bit_cast<T*>(other.get());
467}

References bit_cast().

+ Here is the call graph for this function:

◆ remove()

template<typename Iterator, typename T>
Iterator fl::remove ( Iterator first,
Iterator last,
const T & value )

Definition at line 205 of file algorithm.h.

205 {
206 Iterator result = first;
207 while (first != last) {
208 if (!(*first == value)) {
209 if (result != first) {
210 *result = fl::move(*first);
211 }
212 ++result;
213 }
214 ++first;
215 }
216 return result;
217}

References move().

+ Here is the call graph for this function:

◆ remove_if()

template<typename Iterator, typename UnaryPredicate>
Iterator fl::remove_if ( Iterator first,
Iterator last,
UnaryPredicate pred )

Definition at line 220 of file algorithm.h.

220 {
221 Iterator result = first;
222 while (first != last) {
223 if (!pred(*first)) {
224 if (result != first) {
225 *result = fl::move(*first);
226 }
227 ++result;
228 }
229 ++first;
230 }
231 return result;
232}

References move().

+ Here is the call graph for this function:

◆ reverse()

template<typename Iterator>
void fl::reverse ( Iterator first,
Iterator last )

Definition at line 10 of file algorithm.h.

10 {
11 while ((first != last) && (first != --last)) {
12 swap(*first++, *last);
13 }
14}
void swap(array< T, N > &lhs, array< T, N > &rhs) noexcept(noexcept(lhs.swap(rhs)))
Definition array.h:156

References swap().

+ Here is the call graph for this function:

◆ rgb_2_rgbw() [1/2]

FASTLED_FORCE_INLINE void fl::rgb_2_rgbw ( RGBW_MODE mode,
uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Converts RGB to RGBW using one of the functions.

Dynamic version of the rgb_w_rgbw function with less chance for the compiler to optimize.

Definition at line 149 of file rgbw.h.

151 {
152 switch (mode) {
153 case kRGBWInvalid:
155 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale,
156 g_scale, b_scale, out_r, out_g, out_b,
157 out_w);
158 return;
159 case kRGBWExactColors:
160 rgb_2_rgbw_exact(w_color_temperature, r, g, b, r_scale, g_scale,
161 b_scale, out_r, out_g, out_b, out_w);
162 return;
164 rgb_2_rgbw_white_boosted(w_color_temperature, r, g, b, r_scale, g_scale,
165 b_scale, out_r, out_g, out_b, out_w);
166 return;
168 rgb_2_rgbw_max_brightness(w_color_temperature, r, g, b, r_scale,
169 g_scale, b_scale, out_r, out_g, out_b, out_w);
170 return;
172 rgb_2_rgbw_user_function(w_color_temperature, r, g, b, r_scale, g_scale,
173 b_scale, out_r, out_g, out_b, out_w);
174 return;
175 }
176 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale, g_scale,
177 b_scale, out_r, out_g, out_b, out_w);
178}
void rgb_2_rgbw_user_function(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Definition rgbw.cpp:126
void rgb_2_rgbw_exact(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW using a color transfer method from saturated color channels to white.
Definition rgbw.cpp:41
void rgb_2_rgbw_null_white_pixel(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW with the W channel set to black, always.
Definition rgbw.cpp:67
void rgb_2_rgbw_max_brightness(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
The minimum brigthness of the RGB channels is used to set the W channel.
Definition rgbw.cpp:56
void rgb_2_rgbw_white_boosted(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW with a boosted white channel.
Definition rgbw.cpp:79

References kRGBWBoostedWhite, kRGBWExactColors, kRGBWInvalid, kRGBWMaxBrightness, kRGBWNullWhitePixel, kRGBWUserFunction, rgb_2_rgbw_exact(), rgb_2_rgbw_max_brightness(), rgb_2_rgbw_null_white_pixel(), rgb_2_rgbw_user_function(), and rgb_2_rgbw_white_boosted().

Referenced by PixelController< RGB_ORDER, LANES, MASK >::loadAndScaleRGBW(), and rgb_2_rgbw().

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

◆ rgb_2_rgbw() [2/2]

template<RGBW_MODE MODE>
FASTLED_FORCE_INLINE void fl::rgb_2_rgbw ( uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Definition at line 183 of file rgbw.h.

185 {
186 // We trust that the compiler will inline all of this.
187 rgb_2_rgbw(MODE, w_color_temperature, r, g, b, r_scale, g_scale, b_scale,
188 out_r, out_g, out_b, out_w);
189}
FASTLED_FORCE_INLINE void rgb_2_rgbw(RGBW_MODE mode, uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW using one of the functions.
Definition rgbw.h:149

References rgb_2_rgbw().

+ Here is the call graph for this function:

◆ rgb_2_rgbw_exact()

void fl::rgb_2_rgbw_exact ( uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Converts RGB to RGBW using a color transfer method from saturated color channels to white.

This is designed to produce the most accurate white point for a given color temperature and reduces power usage of the chip since a white led is much more efficient than three color channels of the same power mixing together. However the pixel will never achieve full brightness since the white channel is 3x more efficient than the color channels mixed together, so in this mode the max brightness of a given pixel is reduced.

RGB(255, 255, 255) -> RGBW(0, 0, 0, 85)
RGB(255, 0, 0) -> RGBW(255, 0, 0, 0)

Definition at line 41 of file rgbw.cpp.

44 {
45 (void)w_color_temperature;
46 r = scale8(r, r_scale);
47 g = scale8(g, g_scale);
48 b = scale8(b, b_scale);
49 uint8_t min_component = min3(r, g, b);
50 *out_r = r - min_component;
51 *out_g = g - min_component;
52 *out_b = b - min_component;
53 *out_w = min_component;
54}

References scale8().

Referenced by rgb_2_rgbw(), and set_rgb_2_rgbw_function().

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

◆ rgb_2_rgbw_max_brightness()

void fl::rgb_2_rgbw_max_brightness ( uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

The minimum brigthness of the RGB channels is used to set the W channel.

This will allow the max brightness of the led chipset to be used. However the leds will appear over-desaturated in this mode.

RGB(255, 255, 255) -> RGBW(255, 255, 255, 255)
RGB(1, 0, 0) -> RGBW(1, 0, 0, 1)

Definition at line 56 of file rgbw.cpp.

59 {
60 (void)w_color_temperature;
61 *out_r = scale8(r, r_scale);
62 *out_g = scale8(g, g_scale);
63 *out_b = scale8(b, b_scale);
64 *out_w = min3(r, g, b);
65}

References scale8().

Referenced by rgb_2_rgbw().

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

◆ rgb_2_rgbw_null_white_pixel()

void fl::rgb_2_rgbw_null_white_pixel ( uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Converts RGB to RGBW with the W channel set to black, always.

RGB(255, 255, 255) -> RGBW(255, 255, 255, 0)

Definition at line 67 of file rgbw.cpp.

71 {
72 (void)w_color_temperature;
73 *out_r = scale8(r, r_scale);
74 *out_g = scale8(g, g_scale);
75 *out_b = scale8(b, b_scale);
76 *out_w = 0;
77}

References scale8().

Referenced by rgb_2_rgbw().

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

◆ rgb_2_rgbw_user_function()

void fl::rgb_2_rgbw_user_function ( uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Definition at line 126 of file rgbw.cpp.

129 {
130 g_user_function(w_color_temperature, r, g, b, r_scale, g_scale, b_scale,
131 out_r, out_g, out_b, out_w);
132}
rgb_2_rgbw_function g_user_function
Definition rgbw.cpp:116

References g_user_function.

Referenced by rgb_2_rgbw().

+ Here is the caller graph for this function:

◆ rgb_2_rgbw_white_boosted()

void fl::rgb_2_rgbw_white_boosted ( uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Converts RGB to RGBW with a boosted white channel.

Definition at line 79 of file rgbw.cpp.

82 {
83 (void)w_color_temperature;
84 r = scale8(r, r_scale);
85 g = scale8(g, g_scale);
86 b = scale8(b, b_scale);
87 uint8_t min_component = min3(r, g, b);
88 uint8_t w;
89 bool is_min = true;
90 if (min_component <= 84) {
91 w = 3 * min_component;
92 } else {
93 w = 255;
94 is_min = false;
95 }
96 uint8_t r_prime;
97 uint8_t g_prime;
98 uint8_t b_prime;
99 if (is_min) {
100 r_prime = r - min_component;
101 g_prime = g - min_component;
102 b_prime = b - min_component;
103 } else {
104 uint8_t w3 = divide_by_3(w);
105 r_prime = r - w3;
106 g_prime = g - w3;
107 b_prime = b - w3;
108 }
109
110 *out_r = r_prime;
111 *out_g = g_prime;
112 *out_b = b_prime;
113 *out_w = w;
114}
uint8_t divide_by_3(uint8_t x)
Definition rgbw.cpp:32

References scale8().

Referenced by rgb_2_rgbw().

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

◆ RGBtoHSV16()

static HSV16 fl::RGBtoHSV16 ( const CRGB & rgb)
static

Definition at line 19 of file hsv16.cpp.

19 {
20 // Work with 8-bit values directly
21 u8 r = rgb.r;
22 u8 g = rgb.g;
23 u8 b = rgb.b;
24
25 // Find min and max
26 u8 mx = fl_max(r, fl_max(g, b));
27 u8 mn = fl_min(r, fl_min(g, b));
28 u8 delta = mx - mn;
29
30 u16 h = 0;
31 u16 s = 0;
32 u16 v = scale8_to_16_accurate(mx);
33
34 // Calculate saturation using improved scaling
35 if (mx > 0) {
36 // s = (delta * 65535) / mx, but with better accuracy
37 // Use the same technique as scale8_to_16_accurate but for arbitrary denominator
38 if (delta == mx) {
39 s = 65535; // Saturation is 100%
40 } else {
41 s = (u16)(((u32)delta * 65535 + (mx >> 1)) / mx);
42 }
43 }
44
45 // Calculate hue using improved algorithms
46 if (delta > 0) {
47 u32 hue_calc = 0;
48
49 if (mx == r) {
50 // Hue in red sector (0-60 degrees)
51 if (g >= b) {
52 // Use improved division: hue_calc = (g - b) * 65535 / (6 * delta)
53 u32 numerator = (u32)(g - b) * 65535;
54 if (delta <= 42) { // 6 * 42 = 252, safe for small delta
55 hue_calc = numerator / (6 * delta);
56 } else {
57 hue_calc = numerator / delta / 6; // Avoid overflow
58 }
59 } else {
60 u32 numerator = (u32)(b - g) * 65535;
61 if (delta <= 42) {
62 hue_calc = 65535 - numerator / (6 * delta);
63 } else {
64 hue_calc = 65535 - numerator / delta / 6;
65 }
66 }
67 } else if (mx == g) {
68 // Hue in green sector (60-180 degrees)
69 // Handle signed arithmetic properly to avoid integer underflow
70 i32 signed_diff = (i32)b - (i32)r;
71 u32 sector_offset = 65535 / 3; // 60 degrees (120 degrees in 16-bit space)
72
73 if (signed_diff >= 0) {
74 // Positive case: b >= r
75 u32 numerator = (u32)signed_diff * 65535;
76 if (delta <= 42) {
77 hue_calc = sector_offset + numerator / (6 * delta);
78 } else {
79 hue_calc = sector_offset + numerator / delta / 6;
80 }
81 } else {
82 // Negative case: b < r
83 u32 numerator = (u32)(-signed_diff) * 65535;
84 if (delta <= 42) {
85 hue_calc = sector_offset - numerator / (6 * delta);
86 } else {
87 hue_calc = sector_offset - numerator / delta / 6;
88 }
89 }
90 } else { // mx == b
91 // Hue in blue sector (180-300 degrees)
92 // Handle signed arithmetic properly to avoid integer underflow
93 i32 signed_diff = (i32)r - (i32)g;
94 u32 sector_offset = (2 * 65535) / 3; // 240 degrees (240 degrees in 16-bit space)
95
96 if (signed_diff >= 0) {
97 // Positive case: r >= g
98 u32 numerator = (u32)signed_diff * 65535;
99 if (delta <= 42) {
100 hue_calc = sector_offset + numerator / (6 * delta);
101 } else {
102 hue_calc = sector_offset + numerator / delta / 6;
103 }
104 } else {
105 // Negative case: r < g
106 u32 numerator = (u32)(-signed_diff) * 65535;
107 if (delta <= 42) {
108 hue_calc = sector_offset - numerator / (6 * delta);
109 } else {
110 hue_calc = sector_offset - numerator / delta / 6;
111 }
112 }
113 }
114
115 h = (u16)(hue_calc & 0xFFFF);
116 }
117
118 return HSV16{h, s, v};
119}
FL_DISABLE_WARNING_PUSH U common_type_t< T, U > fl_min(T a, U b)
Definition math_macros.h:25
static u16 scale8_to_16_accurate(u8 x)
Definition hsv16.cpp:11

References fl_max(), fl_min(), and scale8_to_16_accurate().

Referenced by fl::HSV16::HSV16().

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

◆ rgbw_partial_reorder()

void fl::rgbw_partial_reorder ( EOrderW w_placement,
uint8_t b0,
uint8_t b1,
uint8_t b2,
uint8_t w,
uint8_t * out_b0,
uint8_t * out_b1,
uint8_t * out_b2,
uint8_t * out_b3 )

Definition at line 134 of file rgbw.cpp.

136 {
137
138 uint8_t out[4] = {b0, b1, b2, 0};
139 switch (w_placement) {
140 // unrolled loop for speed.
141 case W3:
142 out[3] = w;
143 break;
144 case W2:
145 out[3] = out[2]; // memmove and copy.
146 out[2] = w;
147 break;
148 case W1:
149 out[3] = out[2];
150 out[2] = out[1];
151 out[1] = w;
152 break;
153 case W0:
154 out[3] = out[2];
155 out[2] = out[1];
156 out[1] = out[0];
157 out[0] = w;
158 break;
159 }
160 *out_b0 = out[0];
161 *out_b1 = out[1];
162 *out_b2 = out[2];
163 *out_b3 = out[3];
164}
@ W2
White is third.
Definition eorder.h:25
@ W3
White is fourth.
Definition eorder.h:24
@ W0
White is first.
Definition eorder.h:27
@ W1
White is second.
Definition eorder.h:26

References W0, W1, W2, and W3.

Referenced by PixelController< RGB_ORDER, LANES, MASK >::loadAndScaleRGBW().

+ Here is the caller graph for this function:

◆ scale8_to_16_accurate()

static u16 fl::scale8_to_16_accurate ( u8 x)
inlinestatic

Definition at line 11 of file hsv16.cpp.

11 {
12 if (x == 0) return 0;
13 if (x == 255) return 65535;
14 // Use 32-bit arithmetic with rounding: (x * 65535 + 127) / 255
15 // This is equivalent to: (x * 65535 + 255/2) / 255
16 return (u16)(((u32)x * 65535 + 127) / 255);
17}

References x.

Referenced by RGBtoHSV16().

+ Here is the caller graph for this function:

◆ serializeValue()

fl::string fl::serializeValue ( const JsonValue & value)

◆ set_rgb_2_rgbw_function()

void fl::set_rgb_2_rgbw_function ( rgb_2_rgbw_function func)

Definition at line 118 of file rgbw.cpp.

118 {
119 if (func == nullptr) {
121 return;
122 }
123 g_user_function = func;
124}

References g_user_function, and rgb_2_rgbw_exact().

+ Here is the call graph for this function:

◆ SetPSRamAllocator()

void fl::SetPSRamAllocator ( void *(* alloc )(fl::size),
void(* free )(void *) )

Definition at line 72 of file allocator.cpp.

72 {
73 Alloc = alloc;
74 Dealloc = free;
75}

◆ shuffle() [1/3]

template<typename Iterator>
void fl::shuffle ( Iterator first,
Iterator last )

Definition at line 561 of file algorithm.h.

561 {
562 shuffle(first, last, default_random());
563}

References default_random(), and shuffle().

+ Here is the call graph for this function:

◆ shuffle() [2/3]

template<typename Iterator>
void fl::shuffle ( Iterator first,
Iterator last,
fl_random & rng )

Definition at line 544 of file algorithm.h.

544 {
545 if (first == last) {
546 return; // Empty range, nothing to shuffle
547 }
548
549 auto n = last - first;
550 for (auto i = n - 1; i > 0; --i) {
551 // Generate random index from 0 to i (inclusive)
552 auto j = rng(static_cast<u32>(i + 1));
553
554 // Swap elements at positions i and j
555 swap(*(first + i), *(first + j));
556 }
557}

References swap().

+ Here is the call graph for this function:

◆ shuffle() [3/3]

template<typename Iterator, typename RandomGenerator>
void fl::shuffle ( Iterator first,
Iterator last,
RandomGenerator & g )

Definition at line 527 of file algorithm.h.

527 {
528 if (first == last) {
529 return; // Empty range, nothing to shuffle
530 }
531
532 auto n = last - first;
533 for (auto i = n - 1; i > 0; --i) {
534 // Generate random index from 0 to i (inclusive)
535 auto j = g() % (i + 1);
536
537 // Swap elements at positions i and j
538 swap(*(first + i), *(first + j));
539 }
540}

References swap().

Referenced by shuffle().

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

◆ sift_down()

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

Definition at line 10 of file priority_queue.h.

10 {
11 auto root = start;
12 auto child = first + 2 * (root - first) + 1;
13
14 while (child < last) {
15 if (child + 1 < last && comp(*child, *(child + 1))) {
16 ++child;
17 }
18
19 if (comp(*root, *child)) {
20 auto tmp = *root;
21 *root = *child;
22 *child = tmp;
23
24 root = child;
25 child = first + 2 * (root - first) + 1;
26 } else {
27 break;
28 }
29 }
30}

Referenced by pop_heap().

+ Here is the caller graph for this function:

◆ sin16lut()

static FASTLED_FORCE_INLINE i16 fl::sin16lut ( u16 angle)
static

Definition at line 54 of file sin32.h.

54 {
55 u8 angle256 = angle / 256;
56 i32 subAngle = angle % 256;
57 return (sinArray[angle256] * (256 - subAngle) +
58 sinArray[angle256 + 1] * subAngle) /
59 256;
60}
const i16 * sinArray
Definition sin32.cpp:46

References FASTLED_FORCE_INLINE, and sinArray.

◆ sin32()

static FASTLED_FORCE_INLINE i32 fl::sin32 ( u32 angle)
static

Definition at line 36 of file sin32.h.

36 {
37 u8 angle256 = angle / 65536;
38 i32 subAngle = angle % 65536;
39 return sinArray[angle256] * (65536 - subAngle) +
40 sinArray[angle256 + 1] * subAngle;
41}

References FASTLED_FORCE_INLINE, and sinArray.

Referenced by easeOutSine16().

+ Here is the caller graph for this function:

◆ snprintf()

template<typename... Args>
int fl::snprintf ( char * buffer,
fl::size size,
const char * format,
const Args &... args )

Snprintf-like formatting function that writes to a buffer.

Parameters
bufferOutput buffer to write formatted string to
sizeMaximum number of characters to write (including null terminator)
formatFormat string with placeholders like "%d", "%s", "%f" etc.
argsArguments to format
Returns
Number of characters that would have been written if buffer was large enough

Supported format specifiers:

Example usage:

char buffer[100];
int len = fl::snprintf(buffer, sizeof(buffer), "Value: %d, Name: %s", 42, "test");
int snprintf(char *buffer, fl::size size, const char *format, const Args &... args)
Snprintf-like formatting function that writes to a buffer.
Definition printf.h:422

Definition at line 422 of file printf.h.

422 {
423 // Handle null buffer or zero size
424 if (!buffer || size == 0) {
425 return 0;
426 }
427
428 // Format to internal string stream
429 StrStream stream;
430 printf_detail::format_impl(stream, format, args...);
431 fl::string result = stream.str();
432
433 // Get the formatted string length
434 fl::size formatted_len = result.size();
435
436 // Copy to buffer, ensuring null termination
437 fl::size copy_len = (formatted_len < size - 1) ? formatted_len : size - 1;
438
439 // Copy characters
440 for (fl::size i = 0; i < copy_len; ++i) {
441 buffer[i] = result[i];
442 }
443
444 // Null terminate
445 buffer[copy_len] = '\0';
446
447 // Return the number of characters actually written (excluding null terminator)
448 // This respects the buffer size limit instead of returning the full formatted length
449 return static_cast<int>(copy_len);
450}
fl::size size() const
Definition str.h:324

References args, fl::printf_detail::format_impl(), and fl::StrStream::str().

Referenced by fl::string_functions::ftoa(), and sprintf().

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

◆ sort() [1/2]

template<typename Iterator>
void fl::sort ( Iterator first,
Iterator last )

Definition at line 501 of file algorithm.h.

501 {
502 // Use explicit template parameter to avoid C++14 auto in lambda
503 typedef typename fl::remove_reference<decltype(*first)>::type value_type;
504 sort(first, last, [](const value_type& a, const value_type& b) { return a < b; });
505}
void sort(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:491

References sort().

+ Here is the call graph for this function:

◆ sort() [2/2]

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

Definition at line 491 of file algorithm.h.

491 {
492 if (first == last || first + 1 == last) {
493 return; // Already sorted or empty
494 }
495
496 detail::quicksort_impl(first, last, comp);
497}
void quicksort_impl(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:351

References fl::detail::quicksort_impl().

Referenced by sort().

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

◆ splat()

Tile2x2_u8 fl::splat ( vec2f xy)

"Splat" as in "splat pixel rendering" takes a pixel value in float x,y coordinates and "splats" it into a 2x2 tile of pixel values.

Each of the four pixels in the tile is a fl::u8 value in the range [0..255] that represents the intensity of the pixel at that point. Tile2x2_u8 splat(vec2f xy);

Definition at line 14 of file splat.cpp.

14 {
15 // 1) collect values.
16 float x = xy.x;
17 float y = xy.y;
18
19 // 2) integer cell indices
20 i16 cx = static_cast<i16>(floorf(x));
21 i16 cy = static_cast<i16>(floorf(y));
22
23 // 3) fractional offsets in [0..1)
24 float fx = x - cx;
25 float fy = y - cy;
26
27 // 4) bilinear weights
28 float w_ll = (1 - fx) * (1 - fy); // lower‑left
29 float w_lr = fx * (1 - fy); // lower‑right
30 float w_ul = (1 - fx) * fy; // upper‑left
31 float w_ur = fx * fy; // upper‑right
32
33 // 5) build Tile2x2_u8 anchored at (cx,cy)
34 Tile2x2_u8 out(vec2<u16>(cx, cy));
35 out.lower_left() = to_uint8(w_ll);
36 out.lower_right() = to_uint8(w_lr);
37 out.upper_left() = to_uint8(w_ul);
38 out.upper_right() = to_uint8(w_ur);
39
40 return out;
41}
static u8 to_uint8(float f)
Definition splat.cpp:8

References fl::Tile2x2_u8::lower_left(), fl::Tile2x2_u8::lower_right(), to_uint8(), fl::Tile2x2_u8::upper_left(), fl::Tile2x2_u8::upper_right(), x, xy(), and y.

Referenced by fl::Corkscrew::at_splat_extrapolate(), and fl::XYPathRenderer::at_subpixel().

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

◆ sprintf()

template<fl::size N, typename... Args>
int fl::sprintf ( char(&) buffer[N],
const char * format,
const Args &... args )

Sprintf-like formatting function that writes to a buffer.

Parameters
bufferOutput buffer to write formatted string to
formatFormat string with placeholders like "%d", "%s", "%f" etc.
argsArguments to format
Returns
Number of characters written (excluding null terminator)

This function writes a formatted string to the provided buffer. The buffer size is deduced at compile time from the array reference, providing automatic safety against buffer overflows.

Example usage:

char buffer[100];
int len = fl::sprintf(buffer, "Value: %d, Name: %s", 42, "test");
int sprintf(char(&buffer)[N], const char *format, const Args &... args)
Sprintf-like formatting function that writes to a buffer.
Definition printf.h:468

Definition at line 468 of file printf.h.

468 {
469 // Use the compile-time known buffer size for safety
470 return snprintf(buffer, N, format, args...);
471}

References args, and snprintf().

+ Here is the call graph for this function:

◆ stable_sort() [1/2]

template<typename Iterator>
void fl::stable_sort ( Iterator first,
Iterator last )

Definition at line 519 of file algorithm.h.

519 {
520 // Use explicit template parameter to avoid C++14 auto in lambda
521 typedef typename fl::remove_reference<decltype(*first)>::type value_type;
522 stable_sort(first, last, [](const value_type& a, const value_type& b) { return a < b; });
523}
void stable_sort(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:509

References stable_sort().

+ Here is the call graph for this function:

◆ stable_sort() [2/2]

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

Definition at line 509 of file algorithm.h.

509 {
510 if (first == last || first + 1 == last) {
511 return; // Already sorted or empty
512 }
513
514 detail::mergesort_impl(first, last, comp);
515}
void mergesort_impl(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:474

References fl::detail::mergesort_impl().

Referenced by stable_sort().

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

◆ static_pointer_cast()

template<typename T, typename Y>
shared_ptr< T > fl::static_pointer_cast ( const shared_ptr< Y > & other)
noexcept

Definition at line 451 of file shared_ptr.h.

451 {
452 auto ptr = static_cast<T*>(other.get());
454}

◆ swap() [1/7]

template<typename T, fl::size N>
void fl::swap ( array< T, N > & lhs,
array< T, N > & rhs )
noexcept

Definition at line 156 of file array.h.

157 {
158 lhs.swap(rhs);
159}
void swap(array &other)
Definition array.h:125

Referenced by fl::FixedVector< PairKV, N >::FixedVector(), fl::InlinedVector< T, INLINED_SIZE >::InlinedVector(), fl::ScreenMap::ScreenMap(), fl::detail::heap_sort(), fl::detail::partition(), reverse(), fl::detail::rotate_impl(), shuffle(), shuffle(), fl::detail::sift_down(), fl::array< T, N >::swap(), fl::FixedVector< PairKV, N >::swap(), fl::HashMap< Key, T, Hash, KeyEqual, INLINED_COUNT >::Entry::swap(), fl::HashMapLru< Key, T, Hash, KeyEqual, INLINED_COUNT >::swap(), fl::HeapVector< DrawItem >::swap(), fl::HeapVector< DrawItem >::swap(), fl::HeapVector< DrawItem >::swap(), fl::InlinedVector< T, INLINED_SIZE >::swap(), fl::pair< const Key, T >::swap(), fl::RedBlackTree< value_type, PairCompare, Allocator >::swap(), fl::shared_ptr< T >::swap(), fl::shared_ptr< T >::swap(), fl::string::swap(), fl::unique_ptr< T, Deleter >::swap(), fl::unique_ptr< T[], Deleter >::swap(), and fl::weak_ptr< T >::swap().

+ Here is the caller graph for this function:

◆ swap() [2/7]

template<typename T1, typename T2>
void fl::swap ( pair< T1, T2 > & lhs,
pair< T1, T2 > & rhs )
noexcept

Definition at line 87 of file pair.h.

87 {
88 lhs.swap(rhs);
89}
void swap(pair &other) noexcept
Definition pair.h:48

◆ swap() [3/7]

template<typename T, typename Container>
void fl::swap ( queue< T, Container > & lhs,
queue< T, Container > & rhs )

Swap two queues.

Template Parameters
TElement type
ContainerContainer type
Parameters
lhsFirst queue
rhsSecond queue

Definition at line 145 of file queue.h.

145 {
146 lhs.swap(rhs);
147}
void swap(queue &other)
Swap the contents with another queue.
Definition queue.h:122

References fl::queue< T, Container >::swap().

+ Here is the call graph for this function:

◆ swap() [4/7]

template<typename T>
void fl::swap ( shared_ptr< T > & lhs,
shared_ptr< T > & rhs )
noexcept

Definition at line 445 of file shared_ptr.h.

445 {
446 lhs.swap(rhs);
447}
void swap(shared_ptr &other) noexcept
Definition shared_ptr.h:246

◆ swap() [5/7]

template<typename T>
void fl::swap ( T & a,
T & b )

Definition at line 706 of file type_traits.h.

706 {
707 // if T is a POD, use use a simple data copy swap.
708 // if T is not a POD, use the T::Swap method.
710}

◆ swap() [6/7]

template<typename T, typename Deleter>
void fl::swap ( unique_ptr< T, Deleter > & lhs,
unique_ptr< T, Deleter > & rhs )
noexcept

Definition at line 220 of file unique_ptr.h.

220 {
221 lhs.swap(rhs);
222}
void swap(unique_ptr &u) noexcept
Definition unique_ptr.h:118

◆ swap() [7/7]

template<typename T>
void fl::swap ( weak_ptr< T > & lhs,
weak_ptr< T > & rhs )
noexcept

Definition at line 197 of file weak_ptr.h.

197 {
198 lhs.swap(rhs);
199}
void swap(weak_ptr &other) noexcept
Definition weak_ptr.h:125

◆ swap_by_copy()

template<typename T>
void fl::swap_by_copy ( T & a,
T & b )

Definition at line 712 of file type_traits.h.

712 {
713 // Force copy semantics (for cases where move might not be safe)
714 T tmp = a;
715 a = b;
716 b = tmp;
717}

◆ time()

fl::u32 fl::time ( )

Universal millisecond timer - returns milliseconds since system startup.

This function provides consistent timing across all FastLED platforms:

Returns
Number of milliseconds since the system started
Note
Wraps around approximately every 49.7 days (2^32 milliseconds)
This function is designed to be zero-overhead - it compiles to a direct platform call in optimized builds

Behavior

Usage

// Basic timing
fl::u32 start = fl::time();
do_work();
fl::u32 elapsed = fl::time() - start;
// Animation timing
static fl::u32 last_frame = 0;
fl::u32 now = fl::time();
if (now - last_frame >= 16) { // 60 FPS
render_frame();
last_frame = now;
}
// Timeout handling
fl::u32 timeout = fl::time() + 5000; // 5 second timeout
while (fl::time() < timeout && !is_complete()) {
process_step();
}
fl::u32 time()
Universal millisecond timer - returns milliseconds since system startup.
Definition time.cpp:136

Definition at line 136 of file time.cpp.

136 {
137#ifdef FASTLED_TESTING
138 // Check for injected time provider first
139 {
140 fl::lock_guard<fl::mutex> lock(get_time_mutex());
141 const auto& provider = get_time_provider();
142 if (provider) {
143 return provider();
144 }
145 }
146#endif
147
148 // Use platform-specific implementation
149 return get_platform_time();
150}
fl::u32 get_platform_time()
Get platform-specific time in milliseconds This function contains all platform-specific timing code.
Definition time.cpp:98

References time().

Referenced by fl::HashMapLru< Key, T, Hash, KeyEqual, INLINED_COUNT >::ValueWithTimestamp::ValueWithTimestamp(), drawPlasmaWave(), fl::task::operator=(), rainbowWave(), fl::task::set_last_run_time(), fl::TaskImpl::set_last_run_time(), time(), fl::Scheduler::update(), and fl::Scheduler::update_tasks_of_type().

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

◆ time_alpha16()

u16 fl::time_alpha16 ( u32 now,
u32 start,
u32 end )

Definition at line 24 of file time_alpha.cpp.

24 {
25 if (now < start) {
26 return 0;
27 }
28 if (now > end) {
29 return 65535;
30 }
31 u32 elapsed = now - start;
32 u32 total = end - start;
33 u32 out = (elapsed * 65535) / total;
34 if (out > 65535) {
35 out = 65535;
36 }
37 return static_cast<u16>(out);
38}

References end().

+ Here is the call graph for this function:

◆ time_alpha8()

u8 fl::time_alpha8 ( u32 now,
u32 start,
u32 end )

Definition at line 8 of file time_alpha.cpp.

8 {
9 if (now < start) {
10 return 0;
11 }
12 if (now > end) {
13 return 255;
14 }
15 u32 elapsed = now - start;
16 u32 total = end - start;
17 u32 out = (elapsed * 255) / total;
18 if (out > 255) {
19 out = 255;
20 }
21 return static_cast<u8>(out);
22}

References end().

Referenced by fl::TimeClampedTransition::update8(), and fl::TimeRamp::update8().

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

◆ time_alphaf()

float fl::time_alphaf ( u32 now,
u32 start,
u32 end )
inline

Definition at line 17 of file time_alpha.h.

17 {
18 if (now < start) {
19 return 0.0f;
20 }
21 u32 elapsed = now - start;
22 u32 total = end - start;
23 float out = static_cast<float>(elapsed) / static_cast<float>(total);
24 return out;
25}

References end().

Referenced by fl::TimeClampedTransition::updatef().

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

◆ to_string() [1/2]

string fl::to_string ( float value,
int precision )
inline

Definition at line 964 of file str.h.

964 {
965 string result;
966 result.append(value, precision);
967 return result;
968}

◆ to_string() [2/2]

template<typename T>
string fl::to_string ( T value)
inline

Definition at line 957 of file str.h.

957 {
958 string result;
959 result.append(value);
960 return result;
961}

Referenced by FL_DISABLE_WARNING().

+ Here is the caller graph for this function:

◆ to_uint8()

static u8 fl::to_uint8 ( float f)
static

Definition at line 8 of file splat.cpp.

8 {
9 // convert to [0..255] range
10 u8 i = static_cast<u8>(f * 255.0f + .5f);
11 return MIN(i, 255);
12}

References MIN.

Referenced by splat().

+ Here is the caller graph for this function:

◆ traverseGridSegment()

template<typename GridVisitor>
void fl::traverseGridSegment ( const vec2f & start,
const vec2f & end,
GridVisitor & visitor )
inline

Traverse a grid segment by selecting the cells that are crossed.

This version will select the fastest integer implementation based on the length of the segment. Most of the time it will call traverseGridSegment16() since segment spans are typically < 256 pixels.

Template Parameters
GridVisitor
Parameters
startstart point
endend point
visitorcalled for each cell visited.

Fully tested.

Definition at line 276 of file traverse_grid.h.

277 {
278 float dx = ABS(end.x - start.x);
279 float dy = ABS(end.y - start.y);
280 float maxRange = MAX(dx, dy);
281
282 // if (maxRange < 256.0f) {
283 // // Use Q8.8 (16-bit signed) if within ±127
284 // traverseGridSegment16(start, end, visitor);
285 // }
286 // else if (maxRange < 16777216.0f) {
287 // // Use Q24.8 (32-bit signed) if within ±8 million
288 // traverseGridSegment32(start, end, visitor);
289 // }
290 // else {
291 // // Fall back to floating-point
292 // traverseGridSegment(start, end, visitor);
293 // }
294
295 if (maxRange < 256.0f) {
296 // Use Q8.8 (16-bit signed) if within ±127
297 traverseGridSegment16(start, end, visitor);
298 } else {
299 // Use Q24.8 (32-bit signed) if within ±8 million
300 traverseGridSegment32(start, end, visitor);
301 }
302}
#define ABS(x)
Definition math_macros.h:45
void traverseGridSegment16(const vec2f &start, const vec2f &end, GridVisitor &visitor)
Traverse a grid segment using fixed-point 8.8 arithmetic.
void traverseGridSegment32(const vec2f &start, const vec2f &end, GridVisitor &visitor)
value_type y
Definition geometry.h:191
value_type x
Definition geometry.h:190

References ABS, end(), MAX, traverseGridSegment16(), traverseGridSegment32(), fl::vec2< T >::x, and fl::vec2< T >::y.

+ Here is the call graph for this function:

◆ traverseGridSegment16()

template<typename GridVisitor>
void fl::traverseGridSegment16 ( const vec2f & start,
const vec2f & end,
GridVisitor & visitor )
inline

Traverse a grid segment using fixed-point 8.8 arithmetic.

Template Parameters
GridVisitor
Parameters
startstart point
endend point
visitorcalled for each cell visited.

UNTESTED!!!!

Definition at line 123 of file traverse_grid.h.

124 {
125 const i16 FP_SHIFT = 8;
126 const i16 FP_ONE = 1 << FP_SHIFT;
127 // const i16 FP_MASK = FP_ONE - 1;
128
129 // Convert to fixed-point (Q8.8), signed
130 i16 startX_fp = static_cast<i16>(start.x * FP_ONE);
131 i16 startY_fp = static_cast<i16>(start.y * FP_ONE);
132 i16 endX_fp = static_cast<i16>(end.x * FP_ONE);
133 i16 endY_fp = static_cast<i16>(end.y * FP_ONE);
134
135 i16 x0 = startX_fp >> FP_SHIFT;
136 i16 y0 = startY_fp >> FP_SHIFT;
137 i16 x1 = endX_fp >> FP_SHIFT;
138 i16 y1 = endY_fp >> FP_SHIFT;
139
140 i16 stepX = (x1 > x0) ? 1 : (x1 < x0) ? -1 : 0;
141 i16 stepY = (y1 > y0) ? 1 : (y1 < y0) ? -1 : 0;
142
143 i16 deltaX_fp = endX_fp - startX_fp;
144 i16 deltaY_fp = endY_fp - startY_fp;
145
146 u16 absDeltaX_fp =
147 (deltaX_fp != 0) ? static_cast<u16>(
148 ABS((i32(FP_ONE) << FP_SHIFT) / deltaX_fp))
149 : UINT16_MAX;
150 u16 absDeltaY_fp =
151 (deltaY_fp != 0) ? static_cast<u16>(
152 ABS((i32(FP_ONE) << FP_SHIFT) / deltaY_fp))
153 : UINT16_MAX;
154
155 i16 nextX_fp = (stepX > 0) ? ((x0 + 1) << FP_SHIFT) : (x0 << FP_SHIFT);
156 i16 nextY_fp = (stepY > 0) ? ((y0 + 1) << FP_SHIFT) : (y0 << FP_SHIFT);
157
158 u16 tMaxX_fp =
159 (deltaX_fp != 0)
160 ? static_cast<u16>(
161 ABS(i32(nextX_fp - startX_fp)) * absDeltaX_fp >> FP_SHIFT)
162 : UINT16_MAX;
163 u16 tMaxY_fp =
164 (deltaY_fp != 0)
165 ? static_cast<u16>(
166 ABS(i32(nextY_fp - startY_fp)) * absDeltaY_fp >> FP_SHIFT)
167 : UINT16_MAX;
168
169 const u16 maxT_fp = FP_ONE;
170
171 i16 currentX = x0;
172 i16 currentY = y0;
173
174 while (true) {
175 visitor.visit(currentX, currentY);
176
177 u16 t_fp = (tMaxX_fp < tMaxY_fp) ? tMaxX_fp : tMaxY_fp;
178 if (t_fp > maxT_fp)
179 break;
180
181 if (tMaxX_fp < tMaxY_fp) {
182 tMaxX_fp += absDeltaX_fp;
183 currentX += stepX;
184 } else {
185 tMaxY_fp += absDeltaY_fp;
186 currentY += stepY;
187 }
188 }
189
190 // Ensure the end cell (x1, y1) is visited at least once
191 if (currentX != x1 || currentY != y1) {
192 visitor.visit(x1, y1);
193 }
194}

References ABS, end(), fl::vec2< T >::x, and fl::vec2< T >::y.

Referenced by traverseGridSegment().

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

◆ traverseGridSegment32()

template<typename GridVisitor>
void fl::traverseGridSegment32 ( const vec2f & start,
const vec2f & end,
GridVisitor & visitor )
inline
Template Parameters
GridVisitor
Parameters
startstart point
endend point
visitorcalled for each cell visited.

UNTESTED!!!!

Definition at line 203 of file traverse_grid.h.

204 {
205 const i32 FP_SHIFT = 8;
206 const i32 FP_ONE = 1 << FP_SHIFT;
207 // const i32 FP_MASK = FP_ONE - 1;
208
209 // Convert to fixed-point (Q24.8) signed
210 i32 startX_fp = static_cast<i32>(start.x * FP_ONE);
211 i32 startY_fp = static_cast<i32>(start.y * FP_ONE);
212 i32 endX_fp = static_cast<i32>(end.x * FP_ONE);
213 i32 endY_fp = static_cast<i32>(end.y * FP_ONE);
214
215 i32 x0 = startX_fp >> FP_SHIFT;
216 i32 y0 = startY_fp >> FP_SHIFT;
217 i32 x1 = endX_fp >> FP_SHIFT;
218 i32 y1 = endY_fp >> FP_SHIFT;
219
220 i32 stepX = (x1 > x0) ? 1 : (x1 < x0) ? -1 : 0;
221 i32 stepY = (y1 > y0) ? 1 : (y1 < y0) ? -1 : 0;
222
223 i32 deltaX_fp = endX_fp - startX_fp;
224 i32 deltaY_fp = endY_fp - startY_fp;
225
226 u32 absDeltaX_fp =
227 (deltaX_fp != 0) ? static_cast<u32>(
228 ABS((fl::i64(FP_ONE) << FP_SHIFT) / deltaX_fp))
229 : UINT32_MAX;
230 u32 absDeltaY_fp =
231 (deltaY_fp != 0) ? static_cast<u32>(
232 ABS((fl::i64(FP_ONE) << FP_SHIFT) / deltaY_fp))
233 : UINT32_MAX;
234
235 i32 nextX_fp = (stepX > 0) ? ((x0 + 1) << FP_SHIFT) : (x0 << FP_SHIFT);
236 i32 nextY_fp = (stepY > 0) ? ((y0 + 1) << FP_SHIFT) : (y0 << FP_SHIFT);
237
238 u32 tMaxX_fp =
239 (deltaX_fp != 0)
240 ? static_cast<u32>(
241 ABS(fl::i64(nextX_fp - startX_fp)) * absDeltaX_fp >> FP_SHIFT)
242 : UINT32_MAX;
243 u32 tMaxY_fp =
244 (deltaY_fp != 0)
245 ? static_cast<u32>(
246 ABS(fl::i64(nextY_fp - startY_fp)) * absDeltaY_fp >> FP_SHIFT)
247 : UINT32_MAX;
248
249 const u32 maxT_fp = FP_ONE;
250
251 i32 currentX = x0;
252 i32 currentY = y0;
253
254 while (true) {
255 visitor.visit(currentX, currentY);
256
257 u32 t_fp = (tMaxX_fp < tMaxY_fp) ? tMaxX_fp : tMaxY_fp;
258 if (t_fp > maxT_fp)
259 break;
260
261 if (tMaxX_fp < tMaxY_fp) {
262 tMaxX_fp += absDeltaX_fp;
263 currentX += stepX;
264 } else {
265 tMaxY_fp += absDeltaY_fp;
266 currentY += stepY;
267 }
268 }
269
270 if (currentX != x1 || currentY != y1) {
271 visitor.visit(x1, y1);
272 }
273}

References ABS, end(), fl::vec2< T >::x, and fl::vec2< T >::y.

Referenced by traverseGridSegment().

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

◆ traverseGridSegmentFloat()

template<typename GridVisitor>
void fl::traverseGridSegmentFloat ( const vec2f & start,
const vec2f & end,
GridVisitor & visitor )
inline

Traverse a grid segment using floating point arithmetic.

Traverse a grid segment using fixed-point 8.8 arithmetic.

Useful for testing.

Template Parameters
GridVisitor
Parameters
startstart point
endend point
visitorcalled for each cell visited.

Fully tested.

Template Parameters
GridVisitor
Parameters
startstart point
endend point
visitorcalled for each cell visited.

Fully tested.

Definition at line 68 of file traverse_grid.h.

69 {
70 int x0 = static_cast<int>(fl::floor(start.x));
71 int y0 = static_cast<int>(fl::floor(start.y));
72 int x1 = static_cast<int>(fl::floor(end.x));
73 int y1 = static_cast<int>(fl::floor(end.y));
74
75 int stepX = (x1 > x0) ? 1 : (x1 < x0) ? -1 : 0;
76 int stepY = (y1 > y0) ? 1 : (y1 < y0) ? -1 : 0;
77
78 float dx = end.x - start.x;
79 float dy = end.y - start.y;
80
81 float tDeltaX = (dx != 0.0f) ? ABS(1.0f / dx) : FLT_MAX;
82 float tDeltaY = (dy != 0.0f) ? ABS(1.0f / dy) : FLT_MAX;
83
84 float nextX = (stepX > 0) ? (fl::floor(start.x) + 1) : fl::floor(start.x);
85 float nextY = (stepY > 0) ? (fl::floor(start.y) + 1) : fl::floor(start.y);
86
87 float tMaxX = (dx != 0.0f) ? ABS((nextX - start.x) / dx) : FLT_MAX;
88 float tMaxY = (dy != 0.0f) ? ABS((nextY - start.y) / dy) : FLT_MAX;
89
90 float maxT = 1.0f;
91
92 int currentX = x0;
93 int currentY = y0;
94
95 while (true) {
96 visitor.visit(currentX, currentY);
97 float t = MIN(tMaxX, tMaxY);
98 if (t > maxT)
99 break;
100
101 if (tMaxX < tMaxY) {
102 tMaxX += tDeltaX;
103 currentX += stepX;
104 } else {
105 tMaxY += tDeltaY;
106 currentY += stepY;
107 }
108 }
109
110 // Ensure the end cell (x1, y1) is visited at least once
111 if (currentX != x1 || currentY != y1) {
112 visitor.visit(x1, y1);
113 }
114}
#define FLT_MAX
Definition math_macros.h:85

References ABS, end(), floor(), FLT_MAX, MIN, t, fl::vec2< T >::x, and fl::vec2< T >::y.

+ Here is the call graph for this function:

◆ upscale()

void fl::upscale ( const CRGB * input,
CRGB * output,
u16 inputWidth,
u16 inputHeight,
const fl::XYMap & xyMap )
inline

Definition at line 58 of file upscale.h.

59 {
60 u16 outputWidth = xyMap.getWidth();
61 u16 outputHeight = xyMap.getHeight();
62 const bool wontFit =
63 (outputWidth != xyMap.getWidth() || outputHeight != xyMap.getHeight());
64
65 // Check if we can use the optimized rectangular version
66 const bool isRectangular = (xyMap.getType() == XYMap::kLineByLine);
67
68 if (isRectangular) {
69 // Use optimized rectangular version that bypasses XY mapping
70 if (wontFit || (inputWidth & (inputWidth - 1)) ||
71 (inputHeight & (inputHeight - 1))) {
72 upscaleRectangular(input, output, inputWidth, inputHeight,
73 outputWidth, outputHeight);
74 } else {
75 upscaleRectangularPowerOf2(input, output, inputWidth, inputHeight,
76 outputWidth, outputHeight);
77 }
78 } else {
79 // Use the original XY-mapped versions
80 if (wontFit || (inputWidth & (inputWidth - 1)) ||
81 (inputHeight & (inputHeight - 1))) {
82 upscaleArbitrary(input, output, inputWidth, inputHeight, xyMap);
83 } else {
84 upscalePowerOf2(input, output, inputWidth, inputHeight, xyMap);
85 }
86 }
87}
void upscaleRectangular(const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, u16 outputWidth, u16 outputHeight)
Optimized upscale for rectangular/line-by-line XY maps.
Definition upscale.cpp:20
void upscaleRectangularPowerOf2(const CRGB *input, CRGB *output, u8 inputWidth, u8 inputHeight, u8 outputWidth, u8 outputHeight)
Optimized upscale for rectangular/line-by-line XY maps (power-of-2 version).
Definition upscale.cpp:63
void upscaleArbitrary(const CRGB *input, CRGB *output, u16 inputWidth, u16 inputHeight, const XYMap &xyMap)
Performs bilinear interpolation for upscaling an image.
Definition upscale.cpp:106
void upscalePowerOf2(const CRGB *input, CRGB *output, u8 inputWidth, u8 inputHeight, const XYMap &xyMap)
Performs bilinear interpolation for upscaling an image.
Definition upscale.cpp:170

References fl::XYMap::kLineByLine, upscaleArbitrary(), upscalePowerOf2(), upscaleRectangular(), upscaleRectangularPowerOf2(), and xyMap.

Referenced by fl::ScaleUp::expand(), and CRGB::upscale().

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

◆ upscaleArbitrary()

void fl::upscaleArbitrary ( const CRGB * input,
CRGB * output,
u16 inputWidth,
u16 inputHeight,
const fl::XYMap & xyMap )

Performs bilinear interpolation for upscaling an image.

Parameters
outputThe output grid to write into the interpolated values.
inputThe input grid to read from.
inputWidthThe width of the input grid.
inputHeightThe height of the input grid.
xyMapThe XYMap to use to determine where to write the pixel. If the pixel is mapped outside of the range then it is clipped.

Definition at line 106 of file upscale.cpp.

107 {
108 u16 n = xyMap.getTotal();
109 u16 outputWidth = xyMap.getWidth();
110 u16 outputHeight = xyMap.getHeight();
111 const u16 scale_factor = 256; // Using 8 bits for the fractional part
112
113 for (u16 y = 0; y < outputHeight; y++) {
114 for (u16 x = 0; x < outputWidth; x++) {
115 // Calculate the corresponding position in the input grid
116 u32 fx = ((u32)x * (inputWidth - 1) * scale_factor) /
117 (outputWidth - 1);
118 u32 fy = ((u32)y * (inputHeight - 1) * scale_factor) /
119 (outputHeight - 1);
120
121 u16 ix = fx / scale_factor; // Integer part of x
122 u16 iy = fy / scale_factor; // Integer part of y
123 u16 dx = fx % scale_factor; // Fractional part of x
124 u16 dy = fy % scale_factor; // Fractional part of y
125
126 u16 ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
127 u16 iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
128
129 u16 i00 = iy * inputWidth + ix;
130 u16 i10 = iy * inputWidth + ix1;
131 u16 i01 = iy1 * inputWidth + ix;
132 u16 i11 = iy1 * inputWidth + ix1;
133
134 CRGB c00 = input[i00];
135 CRGB c10 = input[i10];
136 CRGB c01 = input[i01];
137 CRGB c11 = input[i11];
138
139 CRGB result;
140 result.r = bilinearInterpolate(c00.r, c10.r, c01.r, c11.r, dx, dy);
141 result.g = bilinearInterpolate(c00.g, c10.g, c01.g, c11.g, dx, dy);
142 result.b = bilinearInterpolate(c00.b, c10.b, c01.b, c11.b, dx, dy);
143
144 u16 idx = xyMap.mapToIndex(x, y);
145 if (idx < n) {
146 output[idx] = result;
147 }
148 }
149 }
150}
u8 bilinearInterpolate(u8 v00, u8 v10, u8 v01, u8 v11, u16 dx, u16 dy)
Definition upscale.cpp:151

References bilinearInterpolate(), x, xyMap, and y.

Referenced by fl::ScaleUp::expand(), and upscale().

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

◆ upscaleArbitraryFloat()

void fl::upscaleArbitraryFloat ( const CRGB * input,
CRGB * output,
u16 inputWidth,
u16 inputHeight,
const XYMap & xyMap )

Definition at line 267 of file upscale.cpp.

268 {
269 u16 n = xyMap.getTotal();
270 u16 outputWidth = xyMap.getWidth();
271 u16 outputHeight = xyMap.getHeight();
272
273 for (u16 y = 0; y < outputHeight; y++) {
274 for (u16 x = 0; x < outputWidth; x++) {
275 // Map output pixel to input grid position
276 float fx =
277 static_cast<float>(x) * (inputWidth - 1) / (outputWidth - 1);
278 float fy =
279 static_cast<float>(y) * (inputHeight - 1) / (outputHeight - 1);
280
281 u16 ix = static_cast<u16>(fx);
282 u16 iy = static_cast<u16>(fy);
283 float dx = fx - ix;
284 float dy = fy - iy;
285
286 u16 ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
287 u16 iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
288
289 u16 i00 = iy * inputWidth + ix;
290 u16 i10 = iy * inputWidth + ix1;
291 u16 i01 = iy1 * inputWidth + ix;
292 u16 i11 = iy1 * inputWidth + ix1;
293
294 CRGB c00 = input[i00];
295 CRGB c10 = input[i10];
296 CRGB c01 = input[i01];
297 CRGB c11 = input[i11];
298
299 CRGB result;
300 result.r =
301 upscaleFloat(c00.r, c10.r, c01.r, c11.r, dx, dy);
302 result.g =
303 upscaleFloat(c00.g, c10.g, c01.g, c11.g, dx, dy);
304 result.b =
305 upscaleFloat(c00.b, c10.b, c01.b, c11.b, dx, dy);
306
307 u16 idx = xyMap.mapToIndex(x, y);
308 if (idx < n) {
309 output[idx] = result;
310 }
311 }
312 }
313}
u8 upscaleFloat(u8 v00, u8 v10, u8 v01, u8 v11, float dx, float dy)
Definition upscale.cpp:246

References upscaleFloat(), x, xyMap, and y.

+ Here is the call graph for this function:

◆ upscaleFloat() [1/2]

void fl::upscaleFloat ( const CRGB * input,
CRGB * output,
u8 inputWidth,
u8 inputHeight,
const XYMap & xyMap )

Definition at line 316 of file upscale.cpp.

317 {
318 u8 outputWidth = xyMap.getWidth();
319 u8 outputHeight = xyMap.getHeight();
320 if (outputWidth != xyMap.getWidth() || outputHeight != xyMap.getHeight()) {
321 // xyMap has width and height that do not fit in a u8.
322 return;
323 }
324 u16 n = xyMap.getTotal();
325
326 for (u8 y = 0; y < outputHeight; y++) {
327 for (u8 x = 0; x < outputWidth; x++) {
328 // Map output pixel to input grid position
329 float fx =
330 static_cast<float>(x) * (inputWidth - 1) / (outputWidth - 1);
331 float fy =
332 static_cast<float>(y) * (inputHeight - 1) / (outputHeight - 1);
333
334 u8 ix = static_cast<u8>(fx);
335 u8 iy = static_cast<u8>(fy);
336 float dx = fx - ix;
337 float dy = fy - iy;
338
339 u8 ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
340 u8 iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
341
342 u16 i00 = iy * inputWidth + ix;
343 u16 i10 = iy * inputWidth + ix1;
344 u16 i01 = iy1 * inputWidth + ix;
345 u16 i11 = iy1 * inputWidth + ix1;
346
347 CRGB c00 = input[i00];
348 CRGB c10 = input[i10];
349 CRGB c01 = input[i01];
350 CRGB c11 = input[i11];
351
352 CRGB result;
353 result.r =
354 upscaleFloat(c00.r, c10.r, c01.r, c11.r, dx, dy);
355 result.g =
356 upscaleFloat(c00.g, c10.g, c01.g, c11.g, dx, dy);
357 result.b =
358 upscaleFloat(c00.b, c10.b, c01.b, c11.b, dx, dy);
359
360 u16 idx = xyMap.mapToIndex(x, y);
361 if (idx < n) {
362 output[idx] = result;
363 }
364 }
365 }
366}

References upscaleFloat(), x, xyMap, and y.

+ Here is the call graph for this function:

◆ upscaleFloat() [2/2]

u8 fl::upscaleFloat ( u8 v00,
u8 v10,
u8 v01,
u8 v11,
float dx,
float dy )

Definition at line 246 of file upscale.cpp.

247 {
248 float dx_inv = 1.0f - dx;
249 float dy_inv = 1.0f - dy;
250
251 // Calculate the weights for each corner
252 float w00 = dx_inv * dy_inv;
253 float w10 = dx * dy_inv;
254 float w01 = dx_inv * dy;
255 float w11 = dx * dy;
256
257 // Compute the weighted sum
258 float sum = v00 * w00 + v10 * w10 + v01 * w01 + v11 * w11;
259
260 // Clamp the result to [0, 255] and round
261 u8 result = static_cast<u8>(sum + 0.5f);
262
263 return result;
264}

Referenced by fl::ScaleUp::expand(), upscaleArbitraryFloat(), and upscaleFloat().

+ Here is the caller graph for this function:

◆ UpscalePalette() [1/6]

void fl::UpscalePalette ( const class CHSVPalette16 & srcpal16,
class CHSVPalette256 & destpal256 )

Definition at line 970 of file colorutils.cpp.

971 {
972 for (int i = 0; i < 256; ++i) {
973 destpal256[(fl::u8)(i)] = ColorFromPalette(srcpal16, i);
974 }
975}
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)

References ColorFromPalette().

+ Here is the call graph for this function:

◆ UpscalePalette() [2/6]

void fl::UpscalePalette ( const class CHSVPalette16 & srcpal16,
class CHSVPalette32 & destpal32 )

Definition at line 986 of file colorutils.cpp.

987 {
988 for (fl::u8 i = 0; i < 16; ++i) {
989 fl::u8 j = i * 2;
990 destpal32[j + 0] = srcpal16[i];
991 destpal32[j + 1] = srcpal16[i];
992 }
993}

◆ UpscalePalette() [3/6]

void fl::UpscalePalette ( const class CHSVPalette32 & srcpal32,
class CHSVPalette256 & destpal256 )

Definition at line 1002 of file colorutils.cpp.

1003 {
1004 for (int i = 0; i < 256; ++i) {
1005 destpal256[(fl::u8)(i)] = ColorFromPalette(srcpal32, i);
1006 }
1007}

References ColorFromPalette().

+ Here is the call graph for this function:

◆ UpscalePalette() [4/6]

void fl::UpscalePalette ( const class CRGBPalette16 & srcpal16,
class CRGBPalette256 & destpal256 )

Definition at line 963 of file colorutils.cpp.

964 {
965 for (int i = 0; i < 256; ++i) {
966 destpal256[(fl::u8)(i)] = ColorFromPalette(srcpal16, i);
967 }
968}

References ColorFromPalette().

+ Here is the call graph for this function:

◆ UpscalePalette() [5/6]

void fl::UpscalePalette ( const class CRGBPalette16 & srcpal16,
class CRGBPalette32 & destpal32 )

Definition at line 977 of file colorutils.cpp.

978 {
979 for (fl::u8 i = 0; i < 16; ++i) {
980 fl::u8 j = i * 2;
981 destpal32[j + 0] = srcpal16[i];
982 destpal32[j + 1] = srcpal16[i];
983 }
984}

◆ UpscalePalette() [6/6]

void fl::UpscalePalette ( const class CRGBPalette32 & srcpal32,
class CRGBPalette256 & destpal256 )

Definition at line 995 of file colorutils.cpp.

996 {
997 for (int i = 0; i < 256; ++i) {
998 destpal256[(fl::u8)(i)] = ColorFromPalette(srcpal32, i);
999 }
1000}

References ColorFromPalette().

+ Here is the call graph for this function:

◆ upscalePowerOf2()

void fl::upscalePowerOf2 ( const CRGB * input,
CRGB * output,
u8 inputWidth,
u8 inputHeight,
const fl::XYMap & xyMap )

Performs bilinear interpolation for upscaling an image.

Parameters
outputThe output grid to write into the interpolated values.
inputThe input grid to read from.
inputWidthThe width of the input grid.
inputHeightThe height of the input grid.
xyMapThe XYMap to use to determine where to write the pixel. If the pixel is mapped outside of the range then it is clipped.

Definition at line 170 of file upscale.cpp.

171 {
172 u8 width = xyMap.getWidth();
173 u8 height = xyMap.getHeight();
174 if (width != xyMap.getWidth() || height != xyMap.getHeight()) {
175 // xyMap has width and height that do not fit in an u16.
176 return;
177 }
178 u16 n = xyMap.getTotal();
179
180 for (u8 y = 0; y < height; y++) {
181 for (u8 x = 0; x < width; x++) {
182 // Use 8-bit fixed-point arithmetic with 8 fractional bits
183 // (scale factor of 256)
184 u16 fx = ((u16)x * (inputWidth - 1) * 256) / (width - 1);
185 u16 fy =
186 ((u16)y * (inputHeight - 1) * 256) / (height - 1);
187
188 u8 ix = fx >> 8; // Integer part
189 u8 iy = fy >> 8;
190 u8 dx = fx & 0xFF; // Fractional part
191 u8 dy = fy & 0xFF;
192
193 u8 ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
194 u8 iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
195
196 u16 i00 = iy * inputWidth + ix;
197 u16 i10 = iy * inputWidth + ix1;
198 u16 i01 = iy1 * inputWidth + ix;
199 u16 i11 = iy1 * inputWidth + ix1;
200
201 CRGB c00 = input[i00];
202 CRGB c10 = input[i10];
203 CRGB c01 = input[i01];
204 CRGB c11 = input[i11];
205
206 CRGB result;
207 result.r =
208 bilinearInterpolatePowerOf2(c00.r, c10.r, c01.r, c11.r, dx, dy);
209 result.g =
210 bilinearInterpolatePowerOf2(c00.g, c10.g, c01.g, c11.g, dx, dy);
211 result.b =
212 bilinearInterpolatePowerOf2(c00.b, c10.b, c01.b, c11.b, dx, dy);
213
214 u16 idx = xyMap.mapToIndex(x, y);
215 if (idx < n) {
216 output[idx] = result;
217 }
218 }
219 }
220}
u8 bilinearInterpolatePowerOf2(u8 v00, u8 v10, u8 v01, u8 v11, u8 dx, u8 dy)
Definition upscale.cpp:222

References bilinearInterpolatePowerOf2(), x, xyMap, and y.

Referenced by fl::ScaleUp::expand(), and upscale().

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

◆ upscaleRectangular()

void fl::upscaleRectangular ( const CRGB * input,
CRGB * output,
u16 inputWidth,
u16 inputHeight,
u16 outputWidth,
u16 outputHeight )

Optimized upscale for rectangular/line-by-line XY maps.

Parameters
inputThe input grid to read from.
outputThe output grid to write into the interpolated values.
inputWidthThe width of the input grid.
inputHeightThe height of the input grid.
outputWidthThe width of the output grid.
outputHeightThe height of the output grid. This version bypasses XY mapping overhead for rectangular layouts.

Definition at line 20 of file upscale.cpp.

21 {
22 const u16 scale_factor = 256; // Using 8 bits for the fractional part
23
24 for (u16 y = 0; y < outputHeight; y++) {
25 for (u16 x = 0; x < outputWidth; x++) {
26 // Calculate the corresponding position in the input grid
27 u32 fx = ((u32)x * (inputWidth - 1) * scale_factor) /
28 (outputWidth - 1);
29 u32 fy = ((u32)y * (inputHeight - 1) * scale_factor) /
30 (outputHeight - 1);
31
32 u16 ix = fx / scale_factor; // Integer part of x
33 u16 iy = fy / scale_factor; // Integer part of y
34 u16 dx = fx % scale_factor; // Fractional part of x
35 u16 dy = fy % scale_factor; // Fractional part of y
36
37 u16 ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
38 u16 iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
39
40 // Direct array access - no XY mapping overhead
41 u16 i00 = iy * inputWidth + ix;
42 u16 i10 = iy * inputWidth + ix1;
43 u16 i01 = iy1 * inputWidth + ix;
44 u16 i11 = iy1 * inputWidth + ix1;
45
46 CRGB c00 = input[i00];
47 CRGB c10 = input[i10];
48 CRGB c01 = input[i01];
49 CRGB c11 = input[i11];
50
52 result.r = bilinearInterpolate(c00.r, c10.r, c01.r, c11.r, dx, dy);
53 result.g = bilinearInterpolate(c00.g, c10.g, c01.g, c11.g, dx, dy);
54 result.b = bilinearInterpolate(c00.b, c10.b, c01.b, c11.b, dx, dy);
55
56 // Direct array access - no XY mapping overhead
57 u16 idx = y * outputWidth + x;
58 output[idx] = result;
59 }
60 }
61}

References bilinearInterpolate(), x, and y.

Referenced by upscale().

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

◆ upscaleRectangularPowerOf2()

void fl::upscaleRectangularPowerOf2 ( const CRGB * input,
CRGB * output,
u8 inputWidth,
u8 inputHeight,
u8 outputWidth,
u8 outputHeight )

Optimized upscale for rectangular/line-by-line XY maps (power-of-2 version).

Parameters
inputThe input grid to read from.
outputThe output grid to write into the interpolated values.
inputWidthThe width of the input grid (must be power of 2).
inputHeightThe height of the input grid (must be power of 2).
outputWidthThe width of the output grid (must be power of 2).
outputHeightThe height of the output grid (must be power of 2). This version bypasses XY mapping overhead for rectangular layouts.

Definition at line 63 of file upscale.cpp.

64 {
65 for (u8 y = 0; y < outputHeight; y++) {
66 for (u8 x = 0; x < outputWidth; x++) {
67 // Use 8-bit fixed-point arithmetic with 8 fractional bits
68 // (scale factor of 256)
69 u16 fx = ((u16)x * (inputWidth - 1) * 256) / (outputWidth - 1);
70 u16 fy = ((u16)y * (inputHeight - 1) * 256) / (outputHeight - 1);
71
72 u8 ix = fx >> 8; // Integer part
73 u8 iy = fy >> 8;
74 u8 dx = fx & 0xFF; // Fractional part
75 u8 dy = fy & 0xFF;
76
77 u8 ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
78 u8 iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
79
80 // Direct array access - no XY mapping overhead
81 u16 i00 = iy * inputWidth + ix;
82 u16 i10 = iy * inputWidth + ix1;
83 u16 i01 = iy1 * inputWidth + ix;
84 u16 i11 = iy1 * inputWidth + ix1;
85
86 CRGB c00 = input[i00];
87 CRGB c10 = input[i10];
88 CRGB c01 = input[i01];
89 CRGB c11 = input[i11];
90
92 result.r =
93 bilinearInterpolatePowerOf2(c00.r, c10.r, c01.r, c11.r, dx, dy);
94 result.g =
95 bilinearInterpolatePowerOf2(c00.g, c10.g, c01.g, c11.g, dx, dy);
96 result.b =
97 bilinearInterpolatePowerOf2(c00.b, c10.b, c01.b, c11.b, dx, dy);
98
99 // Direct array access - no XY mapping overhead
100 u16 idx = y * outputWidth + x;
101 output[idx] = result;
102 }
103 }
104}

References bilinearInterpolatePowerOf2(), x, and y.

Referenced by upscale().

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

◆ worley_noise_2d_q15()

i32 fl::worley_noise_2d_q15 ( i32 x,
i32 y )

Definition at line 33 of file noise_woryley.cpp.

33 {
34 i32 cell_x = x >> 15;
35 i32 cell_y = y >> 15;
36
37 i32 min_dist = INT32_MAX;
38
39 // Check surrounding 9 cells
40 for (int dy = -1; dy <= 1; ++dy) {
41 for (int dx = -1; dx <= 1; ++dx) {
42 i32 gx = cell_x + dx;
43 i32 gy = cell_y + dy;
44
45 i32 fx, fy;
46 feature_point(gx, gy, fx, fy);
47
48 i32 feature_x = (gx << 15) + fx;
49 i32 feature_y = (gy << 15) + fy;
50
51 i32 dx_q15 = x - feature_x;
52 i32 dy_q15 = y - feature_y;
53
54 // Approximate distance using Manhattan (faster) or Euclidean
55 // (costlier)
56 i32 dist =
57 q15_abs(dx_q15) + q15_abs(dy_q15); // Manhattan distance
58
59 if (dist < min_dist)
60 min_dist = dist;
61 }
62 }
63
64 // Normalize: maximum possible distance is roughly 2*Q15_ONE
65 return (min_dist << 15) / (2 * Q15_ONE);
66}
#define INT32_MAX

References INT32_MAX, x, and y.

◆ x_linear()

FASTLED_FORCE_INLINE u16 fl::x_linear ( u16 x,
u16 length )

Definition at line 14 of file xmap.h.

14 {
15 (void)length;
16 return x;
17}
UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)

References FASTLED_FORCE_INLINE, length(), and x.

Referenced by fl::XMap::mapToIndex().

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

◆ x_reverse()

FASTLED_FORCE_INLINE u16 fl::x_reverse ( u16 x,
u16 length )

Definition at line 19 of file xmap.h.

19 {
20 return length - 1 - x;
21}

References FASTLED_FORCE_INLINE, length(), and x.

Referenced by fl::XMap::mapToIndex().

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

◆ XY() [1/2]

fl::u16 fl::XY ( fl::u16 x,
fl::u16 y )

Definition at line 27 of file Luminova.h.

27 {
28 if (x >= WIDTH || y >= HEIGHT)
29 return 0;
31 if (y & 1) {
32 // odd rows run right-to-left
33 return y * WIDTH + (WIDTH - 1 - x);
34 } else {
35 // even rows run left-to-right
36 return y * WIDTH + x;
37 }
38 } else {
39 return y * WIDTH + x;
40 }
41}
#define kMatrixSerpentineLayout
#define WIDTH
Definition advanced.h:36
#define HEIGHT
Definition advanced.h:37

References HEIGHT, kMatrixSerpentineLayout, WIDTH, x, and y.

◆ XY() [2/2]

fl::u16 fl::XY ( fl::u8 x,
fl::u8 y )

Definition at line 22 of file blur.cpp.

22 {
25 FASTLED_ASSERT(false, "the user didn't provide an XY function");
26 return 0;
27}

References FASTLED_UNUSED, x, and y.

Referenced by Fire2023(), loop(), plotDot(), fl::anonymous_namespace{blur.cpp}::xy_legacy_wrapper(), and xy_map_function().

+ Here is the caller graph for this function:

◆ xy_line_by_line()

FASTLED_FORCE_INLINE u16 fl::xy_line_by_line ( u16 x,
u16 y,
u16 width,
u16 height )

Definition at line 29 of file xymap.h.

30 {
31 (void)height;
32 return y * width + x;
33}

References FASTLED_FORCE_INLINE, x, and y.

Referenced by fl::XYMap::mapToIndex().

+ Here is the caller graph for this function:

◆ xy_serpentine()

FASTLED_FORCE_INLINE u16 fl::xy_serpentine ( u16 x,
u16 y,
u16 width,
u16 height )

Definition at line 19 of file xymap.h.

20 {
21 (void)height;
22 if (y & 1) // Even or odd row?
23 // reverse every second line for a serpentine lled layout
24 return (y + 1) * width - 1 - x;
25 else
26 return y * width + x;
27}

References FASTLED_FORCE_INLINE, x, and y.

Referenced by fl::XYMap::mapToIndex().

+ Here is the caller graph for this function:

Variable Documentation

◆ ActivePaletteList

const TProgmemRGBPalette16* fl::ActivePaletteList[]
Initial value:
= {
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.
const TProgmemRGBPalette16 Snow_p
Definition twinklefox.h:276
const TProgmemRGBPalette16 RetroC9_p
Definition twinklefox.h:281
const TProgmemRGBPalette16 BlueWhite_p
Definition twinklefox.h:253
const TProgmemRGBPalette16 RedGreenWhite_p
Definition twinklefox.h:238
const TProgmemRGBPalette16 RedWhite_p
Definition twinklefox.h:248
const TProgmemRGBPalette16 Ice_p
Definition twinklefox.h:286
const TProgmemRGBPalette16 FairyLight_p
Definition twinklefox.h:258
const TProgmemRGBPalette16 Holly_p
Definition twinklefox.h:243

Definition at line 293 of file twinklefox.h.

Referenced by chooseNextColorPalette(), and fl::TwinkleFox::chooseNextColorPalette().

◆ ANIMATION_TABLE

const AnimartrixEntry fl::ANIMATION_TABLE[]
static

Definition at line 177 of file animartrix.hpp.

177 {
185 {ZOOM2, "ZOOM2", &FastLEDANIMartRIX::Zoom2},
186 {ZOOM, "ZOOM", &FastLEDANIMartRIX::Zoom},
190 {YVES, "YVES", &FastLEDANIMartRIX::Yves},
192 {LAVA1, "LAVA1", &FastLEDANIMartRIX::Lava1},
196 {DISTANCE_EXPERIMENT, "DISTANCE_EXPERIMENT",
199 {WAVES, "WAVES", &FastLEDANIMartRIX::Waves},
202 {RINGS, "RINGS", &FastLEDANIMartRIX::Rings},
204 {COMPLEX_KALEIDO_2, "COMPLEX_KALEIDO_2",
206 {COMPLEX_KALEIDO_3, "COMPLEX_KALEIDO_3",
208 {COMPLEX_KALEIDO_4, "COMPLEX_KALEIDO_4",
210 {COMPLEX_KALEIDO_5, "COMPLEX_KALEIDO_5",
212 {COMPLEX_KALEIDO_6, "COMPLEX_KALEIDO_6",
214 {WATER, "WATER", &FastLEDANIMartRIX::Water},
215 {PARAMETRIC_WATER, "PARAMETRIC_WATER",
217 {MODULE_EXPERIMENT1, "MODULE_EXPERIMENT1",
219 {MODULE_EXPERIMENT2, "MODULE_EXPERIMENT2",
221 {MODULE_EXPERIMENT3, "MODULE_EXPERIMENT3",
223 {MODULE_EXPERIMENT4, "MODULE_EXPERIMENT4",
225 {MODULE_EXPERIMENT5, "MODULE_EXPERIMENT5",
227 {MODULE_EXPERIMENT6, "MODULE_EXPERIMENT6",
229 {MODULE_EXPERIMENT7, "MODULE_EXPERIMENT7",
231 {MODULE_EXPERIMENT8, "MODULE_EXPERIMENT8",
233 {MODULE_EXPERIMENT9, "MODULE_EXPERIMENT9",
235 {MODULE_EXPERIMENT10, "MODULE_EXPERIMENT10",
237 {MODULE_EXPERIMENT_SM1, "MODULE_EXPERIMENT_SM1", &FastLEDANIMartRIX::SM1},
238 {MODULE_EXPERIMENT_SM2, "MODULE_EXPERIMENT_SM2", &FastLEDANIMartRIX::SM2},
239 {MODULE_EXPERIMENT_SM3, "MODULE_EXPERIMENT_SM3", &FastLEDANIMartRIX::SM3},
240 {MODULE_EXPERIMENT_SM4, "MODULE_EXPERIMENT_SM4", &FastLEDANIMartRIX::SM4},
241 {MODULE_EXPERIMENT_SM5, "MODULE_EXPERIMENT_SM5", &FastLEDANIMartRIX::SM5},
242 {MODULE_EXPERIMENT_SM6, "MODULE_EXPERIMENT_SM6", &FastLEDANIMartRIX::SM6},
243 {MODULE_EXPERIMENT_SM8, "MODULE_EXPERIMENT_SM8", &FastLEDANIMartRIX::SM8},
244 {MODULE_EXPERIMENT_SM9, "MODULE_EXPERIMENT_SM9", &FastLEDANIMartRIX::SM9},
245 {MODULE_EXPERIMENT_SM10, "MODULE_EXPERIMENT_SM10",
247};

Referenced by fl::Animartrix::getAnimartrixName(), getAnimartrixName(), and fl::FastLEDANIMartRIX::loop().

◆ BlueWhite_p

const TProgmemRGBPalette16 fl::BlueWhite_p
Initial value:
= {
@ Gray
<div style='background:#808080;width:4em;height:4em;'></div>
Definition crgb.h:613
@ Blue
<div style='background:#0000FF;width:4em;height:4em;'></div>
Definition crgb.h:569

Definition at line 253 of file twinklefox.h.

◆ cin

istream fl::cin

Definition at line 126 of file istream.cpp.

◆ cosArray

const i16 * fl::cosArray = &sinLut[64]

Definition at line 48 of file sin32.cpp.

Referenced by cos16lut(), and cos32().

◆ cout

ostream fl::cout

Definition at line 6 of file ostream.cpp.

◆ endl

const endl_t fl::endl

Definition at line 9 of file ostream.cpp.

◆ FairyLight_p

const TProgmemRGBPalette16 fl::FairyLight_p
Initial value:

Definition at line 258 of file twinklefox.h.

◆ g_user_function

rgb_2_rgbw_function fl::g_user_function = rgb_2_rgbw_exact

Definition at line 116 of file rgbw.cpp.

Referenced by rgb_2_rgbw_user_function(), and set_rgb_2_rgbw_function().

◆ gamma_2_8

const u16 fl::gamma_2_8
Initial value:
= {
0, 0, 0, 1, 1, 2, 4, 6, 8, 11,
14, 18, 23, 29, 35, 41, 49, 57, 67, 77,
88, 99, 112, 126, 141, 156, 173, 191, 210, 230,
251, 274, 297, 322, 348, 375, 404, 433, 464, 497,
531, 566, 602, 640, 680, 721, 763, 807, 853, 899,
948, 998, 1050, 1103, 1158, 1215, 1273, 1333, 1394, 1458,
1523, 1590, 1658, 1729, 1801, 1875, 1951, 2029, 2109, 2190,
2274, 2359, 2446, 2536, 2627, 2720, 2816, 2913, 3012, 3114,
3217, 3323, 3431, 3541, 3653, 3767, 3883, 4001, 4122, 4245,
4370, 4498, 4627, 4759, 4893, 5030, 5169, 5310, 5453, 5599,
5747, 5898, 6051, 6206, 6364, 6525, 6688, 6853, 7021, 7191,
7364, 7539, 7717, 7897, 8080, 8266, 8454, 8645, 8838, 9034,
9233, 9434, 9638, 9845, 10055, 10267, 10482, 10699, 10920, 11143,
11369, 11598, 11829, 12064, 12301, 12541, 12784, 13030, 13279, 13530,
13785, 14042, 14303, 14566, 14832, 15102, 15374, 15649, 15928, 16209,
16493, 16781, 17071, 17365, 17661, 17961, 18264, 18570, 18879, 19191,
19507, 19825, 20147, 20472, 20800, 21131, 21466, 21804, 22145, 22489,
22837, 23188, 23542, 23899, 24260, 24625, 24992, 25363, 25737, 26115,
26496, 26880, 27268, 27659, 28054, 28452, 28854, 29259, 29667, 30079,
30495, 30914, 31337, 31763, 32192, 32626, 33062, 33503, 33947, 34394,
34846, 35300, 35759, 36221, 36687, 37156, 37629, 38106, 38586, 39071,
39558, 40050, 40545, 41045, 41547, 42054, 42565, 43079, 43597, 44119,
44644, 45174, 45707, 46245, 46786, 47331, 47880, 48432, 48989, 49550,
50114, 50683, 51255, 51832, 52412, 52996, 53585, 54177, 54773, 55374,
55978, 56587, 57199, 57816, 58436, 59061, 59690, 60323, 60960, 61601,
62246, 62896, 63549, 64207, 64869, 65535}

Definition at line 20 of file ease.cpp.

20 {
21 0, 0, 0, 1, 1, 2, 4, 6, 8, 11,
22 14, 18, 23, 29, 35, 41, 49, 57, 67, 77,
23 88, 99, 112, 126, 141, 156, 173, 191, 210, 230,
24 251, 274, 297, 322, 348, 375, 404, 433, 464, 497,
25 531, 566, 602, 640, 680, 721, 763, 807, 853, 899,
26 948, 998, 1050, 1103, 1158, 1215, 1273, 1333, 1394, 1458,
27 1523, 1590, 1658, 1729, 1801, 1875, 1951, 2029, 2109, 2190,
28 2274, 2359, 2446, 2536, 2627, 2720, 2816, 2913, 3012, 3114,
29 3217, 3323, 3431, 3541, 3653, 3767, 3883, 4001, 4122, 4245,
30 4370, 4498, 4627, 4759, 4893, 5030, 5169, 5310, 5453, 5599,
31 5747, 5898, 6051, 6206, 6364, 6525, 6688, 6853, 7021, 7191,
32 7364, 7539, 7717, 7897, 8080, 8266, 8454, 8645, 8838, 9034,
33 9233, 9434, 9638, 9845, 10055, 10267, 10482, 10699, 10920, 11143,
34 11369, 11598, 11829, 12064, 12301, 12541, 12784, 13030, 13279, 13530,
35 13785, 14042, 14303, 14566, 14832, 15102, 15374, 15649, 15928, 16209,
36 16493, 16781, 17071, 17365, 17661, 17961, 18264, 18570, 18879, 19191,
37 19507, 19825, 20147, 20472, 20800, 21131, 21466, 21804, 22145, 22489,
38 22837, 23188, 23542, 23899, 24260, 24625, 24992, 25363, 25737, 26115,
39 26496, 26880, 27268, 27659, 28054, 28452, 28854, 29259, 29667, 30079,
40 30495, 30914, 31337, 31763, 32192, 32626, 33062, 33503, 33947, 34394,
41 34846, 35300, 35759, 36221, 36687, 37156, 37629, 38106, 38586, 39071,
42 39558, 40050, 40545, 41045, 41547, 42054, 42565, 43079, 43597, 44119,
43 44644, 45174, 45707, 46245, 46786, 47331, 47880, 48432, 48989, 49550,
44 50114, 50683, 51255, 51832, 52412, 52996, 53585, 54177, 54773, 55374,
45 55978, 56587, 57199, 57816, 58436, 59061, 59690, 60323, 60960, 61601,
46 62246, 62896, 63549, 64207, 64869, 65535};

Referenced by gamma16().

◆ Holly_p

const TProgmemRGBPalette16 fl::Holly_p
Initial value:
= {
0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c,
0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c,
0x00580c, 0x00580c, 0x00580c, 0xB00402}

Definition at line 243 of file twinklefox.h.

243 {
244 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c,
245 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c,
246 0x00580c, 0x00580c, 0x00580c, 0xB00402};

◆ Ice_p

const TProgmemRGBPalette16 fl::Ice_p
Initial value:
= {
0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040,
0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040,
0x182080, 0x182080, 0x182080, 0x5080C0}

Definition at line 286 of file twinklefox.h.

286 {
287 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040,
288 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040,
289 0x182080, 0x182080, 0x182080, 0x5080C0};

◆ instead

void const fl::XYMap& xymap fl::instead

Definition at line 53 of file blur.h.

◆ nullopt

nullopt_t fl::nullopt {}
constexpr

Definition at line 11 of file optional.h.

11{};

Referenced by fl::Json::as_audio(), fl::JsonValue::as_bool(), fl::JsonValue::as_bool(), fl::Json::as_bytes(), fl::Json::as_float(), fl::JsonValue::as_float(), fl::JsonValue::as_float(), fl::Json::as_floats(), fl::Json::as_int(), fl::JsonValue::as_int(), fl::JsonValue::as_int(), fl::JsonValue::get(), fl::JsonValue::get(), fl::response::get_header(), and fl::Json::try_as().

◆ RedGreenWhite_p

const TProgmemRGBPalette16 fl::RedGreenWhite_p
Initial value:
= {
@ Green
<div style='background:#008000;width:4em;height:4em;'></div>
Definition crgb.h:615
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:679

Definition at line 238 of file twinklefox.h.

◆ RedWhite_p

const TProgmemRGBPalette16 fl::RedWhite_p
Initial value:

Definition at line 248 of file twinklefox.h.

◆ RetroC9_p

const TProgmemRGBPalette16 fl::RetroC9_p
Initial value:
= {
0xB80400, 0x902C02, 0xB80400, 0x902C02, 0x902C02, 0xB80400,
0x902C02, 0xB80400, 0x046002, 0x046002, 0x046002, 0x046002,
0x070758, 0x070758, 0x070758, 0x606820}

Definition at line 281 of file twinklefox.h.

281 {
282 0xB80400, 0x902C02, 0xB80400, 0x902C02, 0x902C02, 0xB80400,
283 0x902C02, 0xB80400, 0x046002, 0x046002, 0x046002, 0x046002,
284 0x070758, 0x070758, 0x070758, 0x606820};

◆ sinArray

const i16 * fl::sinArray = &sinLut[0]

Definition at line 46 of file sin32.cpp.

Referenced by sin16lut(), and sin32().

◆ sinLut

const i16 fl::sinLut[]

Definition at line 8 of file sin32.cpp.

8 {
9 0, 804, 1608, 2410, 3212, 4011, 4808, 5602, 6393,
10 7179, 7962, 8739, 9512, 10278, 11039, 11793, 12539, 13279,
11 14010, 14732, 15446, 16151, 16846, 17530, 18204, 18868, 19519,
12 20159, 20787, 21403, 22005, 22594, 23170, 23731, 24279, 24811,
13 25329, 25832, 26319, 26790, 27245, 27683, 28105, 28510, 28898,
14 29268, 29621, 29956, 30273, 30571, 30852, 31113, 31356, 31580,
15 31785, 31971, 32137, 32285, 32412, 32521, 32609, 32678, 32728,
16 32757, 32767, 32757, 32728, 32678, 32609, 32521, 32412, 32285,
17 32137, 31971, 31785, 31580, 31356, 31113, 30852, 30571, 30273,
18 29956, 29621, 29268, 28898, 28510, 28105, 27683, 27245, 26790,
19 26319, 25832, 25329, 24811, 24279, 23731, 23170, 22594, 22005,
20 21403, 20787, 20159, 19519, 18868, 18204, 17530, 16846, 16151,
21 15446, 14732, 14010, 13279, 12539, 11793, 11039, 10278, 9512,
22 8739, 7962, 7179, 6393, 5602, 4808, 4011, 3212, 2410,
23 1608, 804, 0, -804, -1608, -2410, -3212, -4011, -4808,
24 -5602, -6393, -7179, -7962, -8739, -9512, -10278, -11039, -11793,
25 -12539, -13279, -14010, -14732, -15446, -16151, -16846, -17530, -18204,
26 -18868, -19519, -20159, -20787, -21403, -22005, -22594, -23170, -23731,
27 -24279, -24811, -25329, -25832, -26319, -26790, -27245, -27683, -28105,
28 -28510, -28898, -29268, -29621, -29956, -30273, -30571, -30852, -31113,
29 -31356, -31580, -31785, -31971, -32137, -32285, -32412, -32521, -32609,
30 -32678, -32728, -32757, -32767, -32757, -32728, -32678, -32609, -32521,
31 -32412, -32285, -32137, -31971, -31785, -31580, -31356, -31113, -30852,
32 -30571, -30273, -29956, -29621, -29268, -28898, -28510, -28105, -27683,
33 -27245, -26790, -26319, -25832, -25329, -24811, -24279, -23731, -23170,
34 -22594, -22005, -21403, -20787, -20159, -19519, -18868, -18204, -17530,
35 -16846, -16151, -15446, -14732, -14010, -13279, -12539, -11793, -11039,
36 -10278, -9512, -8739, -7962, -7179, -6393, -5602, -4808, -4011,
37 -3212, -2410, -1608, -804, 0, 804, 1608, 2410, 3212,
38 4011, 4808, 5602, 6393, 7179, 7962, 8739, 9512, 10278,
39 11039, 11793, 12539, 13279, 14010, 14732, 15446, 16151, 16846,
40 17530, 18204, 18868, 19519, 20159, 20787, 21403, 22005, 22594,
41 23170, 23731, 24279, 24811, 25329, 25832, 26319, 26790, 27245,
42 27683, 28105, 28510, 28898, 29268, 29621, 29956, 30273, 30571,
43 30852, 31113, 31356, 31580, 31785, 31971, 32137, 32285, 32412,
44 32521, 32609, 32678, 32728, 32757, 32767};

◆ Snow_p

const TProgmemRGBPalette16 fl::Snow_p
Initial value:
= {
0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048,
0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048,
0x304048, 0x304048, 0x304048, 0xE0F0FF}

Definition at line 276 of file twinklefox.h.

276 {
277 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048,
278 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048,
279 0x304048, 0x304048, 0x304048, 0xE0F0FF};