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

Detailed Description

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

Namespaces

namespace  anonymous_namespace{allocator.cpp}
 
namespace  anonymous_namespace{five_bit_hd_gamma.cpp}
 
namespace  anonymous_namespace{frame_tracker.cpp}
 
namespace  anonymous_namespace{pir.cpp}
 
namespace  string_functions
 

Classes

struct  _DrawContext
 
class  Animartrix
 
struct  AnimartrixEntry
 ################################################## Details with the implementation of Animartrix More...
 
struct  ArrayDeleter
 
class  ByteStream
 
class  ByteStreamMemory
 
class  Callback
 
class  CircularBuffer
 
class  Cylon
 An animation that moves a single LED back and forth (Larson Scanner effect) More...
 
struct  DefaultLess
 
class  DemoReel100
 
class  DigitalPin
 
class  DigitalPinImpl
 
struct  DrawItem
 
struct  enable_if
 
struct  enable_if< true, T >
 
class  EngineEvents
 
class  FakeStrStream
 
class  FastLEDANIMartRIX
 
class  FileHandle
 
class  FileSystem
 
class  Fire2012
 
class  FixedMap
 
class  FixedSet
 
class  FixedVector
 
class  Frame
 
class  FrameInterpolator
 
class  FrameTracker
 
class  FsImpl
 
class  Fx
 
class  Fx1d
 
class  Fx2d
 
class  FxCompositor
 
class  FxEngine
 Manages and renders multiple visual effects (Fx) for LED strips. More...
 
class  FxLayer
 
class  HeapVector
 
struct  is_base_of
 
struct  is_base_of_v_helper
 
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
 
class  JsonDocument
 
class  LargeBlockAllocator
 
class  LUT
 
class  NoisePalette
 
class  NoiseWave
 
class  NullFileHandle
 
class  NullFileSystem
 
class  ObjectFLED
 
class  Pacifica
 
struct  Pair
 
struct  pair_xy
 
class  Pir
 
class  PirAdvanced
 
struct  Pixel
 
union  Pixel.__unnamed0__
 
struct  Pixel.__unnamed0__.__unnamed0__
 
class  Pixels
 
class  PixelStream
 
struct  PointerDeleter
 
class  Pride2015
 
class  Ptr
 
class  PtrTraits
 
class  RectangularDrawBuffer
 
class  RedSquare
 
class  Referent
 
class  ScaleUp
 
class  scoped_array
 
class  scoped_ptr
 
class  ScreenMap
 
class  Singleton
 
class  Slice
 
class  SortedHeapMap
 
class  SortedHeapVector
 
class  Str
 
class  StringFormatter
 
class  StringHolder
 
class  StrN
 
class  StrStream
 
struct  StrStreamHelper
 
struct  StrStreamHelper< char >
 
struct  StrStreamHelper< int >
 
struct  StrStreamHelper< uint8_t >
 
struct  StrStreamHelper< unsigned int >
 
class  TimeFunction
 
class  TimeScale
 
class  Transition
 
class  TwinkleFox
 
class  UIButton
 
class  UICheckbox
 
class  UIDescription
 
class  UINumberField
 
class  UISlider
 
class  UITitle
 
class  Video
 
class  VideoFxWrapper
 
class  WeakPtr
 
class  WeakReferent
 
class  XMap
 
class  XYMap
 

Typedefs

typedef int64_t cycle_t
 8.8 fixed point (signed) value
 
template<bool Condition, typename T = void>
using enable_if_t = typename enable_if<Condition, T>::type
 
template<typename Base, typename Derived>
using is_derived = enable_if_t<is_base_of<Base, Derived>::value>
 
typedef LUT< uint16_t > LUT16
 
typedef LUT< pair_xy_floatLUTXYFLOAT
 
using pair_xy_float = pair_xy<float>
 
typedef uint16_t(* XFunction) (uint16_t x, uint16_t length)
 
typedef uint16_t(* XYFunction) (uint16_t x, uint16_t y, uint16_t width, uint16_t height)
 

Enumerations

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  FiveBitGammaCorrectionMode { kFiveBitGammaCorrectionMode_Null = 0 , kFiveBitGammaCorrectionMode_BitShift = 1 }
 
enum  InsertResult { kInserted = 0 , kExists = 1 , kMaxSize = 2 }
 
enum class  leddirection { FORWARD , BACKWARD , MAP }
 

Functions

void __builtin_five_bit_hd_gamma_bitshift (CRGB colors, CRGB colors_scale, uint8_t global_brightness, CRGB *out_colors, uint8_t *out_power_5bit)
 
void AnimartrixLoop (Animartrix &self, uint32_t now)
 
void bilinearExpand (const CRGB *input, CRGB *output, uint16_t inputWidth, uint16_t inputHeight, fl::XYMap xyMap)
 
void bilinearExpandArbitrary (const CRGB *input, CRGB *output, uint16_t inputWidth, uint16_t inputHeight, fl::XYMap xyMap)
 Performs bilinear interpolation for upscaling an image.
 
void bilinearExpandArbitraryFloat (const CRGB *input, CRGB *output, uint16_t inputWidth, uint16_t inputHeight, XYMap xyMap)
 
void bilinearExpandFloat (const CRGB *input, CRGB *output, uint8_t inputWidth, uint8_t inputHeight, XYMap xyMap)
 
void bilinearExpandPowerOf2 (const CRGB *input, CRGB *output, uint8_t inputWidth, uint8_t inputHeight, fl::XYMap xyMap)
 Performs bilinear interpolation for upscaling an image.
 
uint8_t bilinearInterpolate (uint8_t v00, uint8_t v10, uint8_t v01, uint8_t v11, uint16_t dx, uint16_t dy)
 
uint8_t bilinearInterpolateFloat (uint8_t v00, uint8_t v10, uint8_t v01, uint8_t v11, float dx, float dy)
 
uint8_t bilinearInterpolatePowerOf2 (uint8_t v00, uint8_t v10, uint8_t v01, uint8_t v11, uint8_t dx, uint8_t dy)
 
static FASTLED_FORCE_INLINE int16_t cos16lut (uint16_t angle)
 
static FASTLED_FORCE_INLINE int32_t cos32 (uint32_t angle)
 
void drawSquare (void *, uint16_t, uint16_t, int, int, uint32_t, uint32_t)
 
void fadeToColorBy (void *, uint16_t, uint32_t, uint8_t)
 
const char * fastled_file_offset (const char *file)
 
 FASTLED_SMART_PTR (Animartrix)
 
 FASTLED_SMART_PTR (ByteStream)
 
 FASTLED_SMART_PTR (ByteStreamMemory)
 
 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 (NoisePalette)
 
 FASTLED_SMART_PTR (NoiseWave)
 
 FASTLED_SMART_PTR (Pacifica)
 
 FASTLED_SMART_PTR (PixelStream)
 
 FASTLED_SMART_PTR (Pride2015)
 
 FASTLED_SMART_PTR (RedSquare)
 
 FASTLED_SMART_PTR (ScaleUp)
 
 FASTLED_SMART_PTR (StringHolder)
 
 FASTLED_SMART_PTR (TimeFunction)
 
 FASTLED_SMART_PTR (TimeScale)
 
 FASTLED_SMART_PTR (TwinkleFox)
 
 FASTLED_SMART_PTR (VideoFxWrapper)
 
 FASTLED_SMART_PTR (VideoImpl)
 
 FASTLED_SMART_PTR_NO_FWD (LUT16)
 
 FASTLED_SMART_PTR_NO_FWD (LUTXYFLOAT)
 
 FASTLED_UI_DEFINE_OPERATORS (UIButton)
 
 FASTLED_UI_DEFINE_OPERATORS (UICheckbox)
 
 FASTLED_UI_DEFINE_OPERATORS (UINumberField)
 
 FASTLED_UI_DEFINE_OPERATORS (UISlider)
 
uint8_t five_bit_bitshift (uint16_t r16, uint16_t g16, uint16_t b16, uint8_t brightness, CRGB *out, uint8_t *out_power_5bit)
 
FASTLED_FORCE_INLINE void five_bit_hd_gamma_bitshift (CRGB colors, CRGB colors_scale, uint8_t global_brightness, CRGB *out_colors, uint8_t *out_power_5bit)
 
void five_bit_hd_gamma_function (CRGB color, uint16_t *r16, uint16_t *g16, uint16_t *b16)
 
void * LargeBlockAllocate (size_t size, bool zero)
 
void LargeBlockDeallocate (void *ptr)
 
FsImplPtr make_sdcard_filesystem (int cs_pin)
 
bool parseJson (const char *json, fl::JsonDocument *doc, Str *_error)
 
void SetLargeBlockAllocator (void *(*alloc)(size_t), void(*free)(void *))
 
static FASTLED_FORCE_INLINE int16_t sin16lut (uint16_t angle)
 
static FASTLED_FORCE_INLINE int32_t sin32 (uint32_t angle)
 
void toJson (const fl::JsonDocument &doc, Str *jsonBuffer)
 
FASTLED_FORCE_INLINE uint16_t x_linear (uint16_t x, uint16_t length)
 
FASTLED_FORCE_INLINE uint16_t x_reverse (uint16_t x, uint16_t length)
 
FASTLED_FORCE_INLINE uint16_t xy_line_by_line (uint16_t x, uint16_t y, uint16_t width, uint16_t height)
 
FASTLED_FORCE_INLINE uint16_t xy_serpentine (uint16_t x, uint16_t y, uint16_t width, uint16_t height)
 

Variables

const TProgmemRGBPalette16ActivePaletteList []
 
static const AnimartrixEntry ANIMATION_TABLE []
 
const TProgmemRGBPalette16 BlueWhite_p
 
const int16_t * cosArray = &sinLut[64]
 
const TProgmemRGBPalette16 FairyLight_p
 
const TProgmemRGBPalette16 Holly_p
 
const TProgmemRGBPalette16 Ice_p
 
const TProgmemRGBPalette16 RedGreenWhite_p
 
const TProgmemRGBPalette16 RedWhite_p
 
const TProgmemRGBPalette16 RetroC9_p
 
const int16_t * sinArray = &sinLut[0]
 
const int16_t sinLut []
 
const TProgmemRGBPalette16 Snow_p
 

◆ 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::JsonDocument

class fl::JsonDocument

◆ 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

Typedef Documentation

◆ cycle_t

typedef int64_t fl::cycle_t

8.8 fixed point (signed) value

Definition at line 11 of file types.h.

◆ enable_if_t

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

Definition at line 29 of file template_magic.h.

◆ is_derived

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

Definition at line 112 of file template_magic.h.

◆ LUT16

typedef LUT<uint16_t> fl::LUT16

Definition at line 33 of file lut.h.

◆ LUTXYFLOAT

typedef LUT<pair_xy_float> fl::LUTXYFLOAT

Definition at line 34 of file lut.h.

◆ pair_xy_float

using fl::pair_xy_float = pair_xy<float>

Definition at line 24 of file lut.h.

◆ XFunction

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

Definition at line 24 of file xmap.h.

◆ XYFunction

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

Definition at line 33 of file xymap.h.

Enumeration Type Documentation

◆ 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 26 of file animartrix.hpp.

26 {
27 RGB_BLOBS5 = 0,
34 ZOOM2,
35 ZOOM,
39 YVES,
41 LAVA1,
47 WAVES,
50 RINGS,
57 WATER,
79};
@ 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

◆ FiveBitGammaCorrectionMode

enum fl::FiveBitGammaCorrectionMode
Enumerator
kFiveBitGammaCorrectionMode_Null 
kFiveBitGammaCorrectionMode_BitShift 

Definition at line 14 of file five_bit_hd_gamma.h.

◆ 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.

Function Documentation

◆ __builtin_five_bit_hd_gamma_bitshift()

void fl::__builtin_five_bit_hd_gamma_bitshift ( CRGB colors,
CRGB colors_scale,
uint8_t global_brightness,
CRGB * out_colors,
uint8_t * out_power_5bit )

Definition at line 130 of file five_bit_hd_gamma.cpp.

133 {
134
135 if (global_brightness == 0) {
136 *out_colors = CRGB(0, 0, 0);
137 *out_power_5bit = 0;
138 return;
139 }
140
141 // Step 1: Gamma Correction
142 uint16_t r16, g16, b16;
143 five_bit_hd_gamma_function(colors, &r16, &g16, &b16);
144
145 // Step 2: Color correction step comes after gamma correction. These values
146 // are assumed to be be relatively close to 255.
147 if (colors_scale.r != 0xff) {
148 r16 = scale16by8(r16, colors_scale.r);
149 }
150 if (colors_scale.g != 0xff) {
151 g16 = scale16by8(g16, colors_scale.g);
152 }
153 if (colors_scale.b != 0xff) {
154 b16 = scale16by8(b16, colors_scale.b);
155 }
156
157 five_bit_bitshift(r16, g16, b16, global_brightness, out_colors,
158 out_power_5bit);
159}
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:468
uint8_t 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_function(CRGB color, uint16_t *r16, uint16_t *g16, uint16_t *b16)
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

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:

◆ AnimartrixLoop()

void fl::AnimartrixLoop ( Animartrix & self,
uint32_t 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::scoped_ptr< FastLEDANIMartRIX > impl
uint16_t getHeight() const
Definition fx2d.h:23
uint16_t getWidth() const
Definition fx2d.h:24

◆ bilinearExpand()

void fl::bilinearExpand ( const CRGB * input,
CRGB * output,
uint16_t inputWidth,
uint16_t inputHeight,
fl::XYMap xyMap )
inline

Definition at line 37 of file bilinear_expansion.h.

38 {
39 uint16_t outputWidth = xyMap.getWidth();
40 uint16_t outputHeight = xyMap.getHeight();
41 const bool wontFit = (outputWidth != xyMap.getWidth() || outputHeight != xyMap.getHeight());
42 // if the input dimensions are not a power of 2 then we can't use the
43 // optimized version.
44 if (wontFit || (inputWidth & (inputWidth - 1)) || (inputHeight & (inputHeight - 1))) {
45 bilinearExpandArbitrary(input, output, inputWidth, inputHeight, xyMap);
46 } else {
47 bilinearExpandPowerOf2(input, output, inputWidth, inputHeight, xyMap);
48 }
49}
XYMap xyMap
void bilinearExpandArbitrary(const CRGB *input, CRGB *output, uint16_t inputWidth, uint16_t inputHeight, XYMap xyMap)
Performs bilinear interpolation for upscaling an image.
void bilinearExpandPowerOf2(const CRGB *input, CRGB *output, uint8_t inputWidth, uint8_t inputHeight, XYMap xyMap)
Performs bilinear interpolation for upscaling an image.

References bilinearExpandArbitrary(), bilinearExpandPowerOf2(), and xyMap.

Referenced by fl::ScaleUp::expand().

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

◆ bilinearExpandArbitrary()

void fl::bilinearExpandArbitrary ( const CRGB * input,
CRGB * output,
uint16_t inputWidth,
uint16_t inputHeight,
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 22 of file bilinear_expansion.cpp.

23 {
24 uint16_t n = xyMap.getTotal();
25 uint16_t outputWidth = xyMap.getWidth();
26 uint16_t outputHeight = xyMap.getHeight();
27 const uint16_t scale_factor = 256; // Using 8 bits for the fractional part
28
29 for (uint16_t y = 0; y < outputHeight; y++) {
30 for (uint16_t x = 0; x < outputWidth; x++) {
31 // Calculate the corresponding position in the input grid
32 uint32_t fx = ((uint32_t)x * (inputWidth - 1) * scale_factor) /
33 (outputWidth - 1);
34 uint32_t fy = ((uint32_t)y * (inputHeight - 1) * scale_factor) /
35 (outputHeight - 1);
36
37 uint16_t ix = fx / scale_factor; // Integer part of x
38 uint16_t iy = fy / scale_factor; // Integer part of y
39 uint16_t dx = fx % scale_factor; // Fractional part of x
40 uint16_t dy = fy % scale_factor; // Fractional part of y
41
42 uint16_t ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
43 uint16_t iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
44
45 uint16_t i00 = iy * inputWidth + ix;
46 uint16_t i10 = iy * inputWidth + ix1;
47 uint16_t i01 = iy1 * inputWidth + ix;
48 uint16_t i11 = iy1 * inputWidth + ix1;
49
50 CRGB c00 = input[i00];
51 CRGB c10 = input[i10];
52 CRGB c01 = input[i01];
53 CRGB c11 = input[i11];
54
55 CRGB result;
56 result.r = bilinearInterpolate(c00.r, c10.r, c01.r, c11.r, dx, dy);
57 result.g = bilinearInterpolate(c00.g, c10.g, c01.g, c11.g, dx, dy);
58 result.b = bilinearInterpolate(c00.b, c10.b, c01.b, c11.b, dx, dy);
59
60 uint16_t idx = xyMap.mapToIndex(x, y);
61 if (idx < n) {
62 output[idx] = result;
63 }
64 }
65 }
66}
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81
uint8_t bilinearInterpolate(uint8_t v00, uint8_t v10, uint8_t v01, uint8_t v11, uint16_t dx, uint16_t dy)

References bilinearInterpolate(), x, xyMap, and y.

Referenced by bilinearExpand(), and fl::ScaleUp::expand().

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

◆ bilinearExpandArbitraryFloat()

void fl::bilinearExpandArbitraryFloat ( const CRGB * input,
CRGB * output,
uint16_t inputWidth,
uint16_t inputHeight,
XYMap xyMap )

Definition at line 180 of file bilinear_expansion.cpp.

182 {
183 uint16_t n = xyMap.getTotal();
184 uint16_t outputWidth = xyMap.getWidth();
185 uint16_t outputHeight = xyMap.getHeight();
186
187 for (uint16_t y = 0; y < outputHeight; y++) {
188 for (uint16_t x = 0; x < outputWidth; x++) {
189 // Map output pixel to input grid position
190 float fx = static_cast<float>(x) * (inputWidth - 1) / (outputWidth - 1);
191 float fy = static_cast<float>(y) * (inputHeight - 1) / (outputHeight - 1);
192
193 uint16_t ix = static_cast<uint16_t>(fx);
194 uint16_t iy = static_cast<uint16_t>(fy);
195 float dx = fx - ix;
196 float dy = fy - iy;
197
198 uint16_t ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
199 uint16_t iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
200
201 uint16_t i00 = iy * inputWidth + ix;
202 uint16_t i10 = iy * inputWidth + ix1;
203 uint16_t i01 = iy1 * inputWidth + ix;
204 uint16_t i11 = iy1 * inputWidth + ix1;
205
206 CRGB c00 = input[i00];
207 CRGB c10 = input[i10];
208 CRGB c01 = input[i01];
209 CRGB c11 = input[i11];
210
211 CRGB result;
212 result.r = bilinearInterpolateFloat(c00.r, c10.r, c01.r, c11.r, dx, dy);
213 result.g = bilinearInterpolateFloat(c00.g, c10.g, c01.g, c11.g, dx, dy);
214 result.b = bilinearInterpolateFloat(c00.b, c10.b, c01.b, c11.b, dx, dy);
215
216 uint16_t idx = xyMap.mapToIndex(x, y);
217 if (idx < n) {
218 output[idx] = result;
219 }
220 }
221 }
222}
uint8_t bilinearInterpolateFloat(uint8_t v00, uint8_t v10, uint8_t v01, uint8_t v11, float dx, float dy)

References bilinearInterpolateFloat(), x, xyMap, and y.

+ Here is the call graph for this function:

◆ bilinearExpandFloat()

void fl::bilinearExpandFloat ( const CRGB * input,
CRGB * output,
uint8_t inputWidth,
uint8_t inputHeight,
XYMap xyMap )

Definition at line 225 of file bilinear_expansion.cpp.

227 {
228 uint8_t outputWidth = xyMap.getWidth();
229 uint8_t outputHeight = xyMap.getHeight();
230 if (outputWidth != xyMap.getWidth() || outputHeight != xyMap.getHeight()) {
231 // xyMap has width and height that do not fit in a uint8_t.
232 return;
233 }
234 uint16_t n = xyMap.getTotal();
235
236 for (uint8_t y = 0; y < outputHeight; y++) {
237 for (uint8_t x = 0; x < outputWidth; x++) {
238 // Map output pixel to input grid position
239 float fx = static_cast<float>(x) * (inputWidth - 1) / (outputWidth - 1);
240 float fy = static_cast<float>(y) * (inputHeight - 1) / (outputHeight - 1);
241
242 uint8_t ix = static_cast<uint8_t>(fx);
243 uint8_t iy = static_cast<uint8_t>(fy);
244 float dx = fx - ix;
245 float dy = fy - iy;
246
247 uint8_t ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
248 uint8_t iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
249
250 uint16_t i00 = iy * inputWidth + ix;
251 uint16_t i10 = iy * inputWidth + ix1;
252 uint16_t i01 = iy1 * inputWidth + ix;
253 uint16_t i11 = iy1 * inputWidth + ix1;
254
255 CRGB c00 = input[i00];
256 CRGB c10 = input[i10];
257 CRGB c01 = input[i01];
258 CRGB c11 = input[i11];
259
260 CRGB result;
261 result.r = bilinearInterpolateFloat(c00.r, c10.r, c01.r, c11.r, dx, dy);
262 result.g = bilinearInterpolateFloat(c00.g, c10.g, c01.g, c11.g, dx, dy);
263 result.b = bilinearInterpolateFloat(c00.b, c10.b, c01.b, c11.b, dx, dy);
264
265 uint16_t idx = xyMap.mapToIndex(x, y);
266 if (idx < n) {
267 output[idx] = result;
268 }
269 }
270 }
271}

References bilinearInterpolateFloat(), x, xyMap, and y.

Referenced by fl::ScaleUp::expand().

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

◆ bilinearExpandPowerOf2()

void fl::bilinearExpandPowerOf2 ( const CRGB * input,
CRGB * output,
uint8_t inputWidth,
uint8_t inputHeight,
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 86 of file bilinear_expansion.cpp.

86 {
87 uint8_t width = xyMap.getWidth();
88 uint8_t height = xyMap.getHeight();
89 if (width != xyMap.getWidth() || height != xyMap.getHeight()) {
90 // xyMap has width and height that do not fit in an uint16_t.
91 return;
92 }
93 uint16_t n = xyMap.getTotal();
94
95 for (uint8_t y = 0; y < height; y++) {
96 for (uint8_t x = 0; x < width; x++) {
97 // Use 8-bit fixed-point arithmetic with 8 fractional bits
98 // (scale factor of 256)
99 uint16_t fx = ((uint16_t)x * (inputWidth - 1) * 256) / (width - 1);
100 uint16_t fy =
101 ((uint16_t)y * (inputHeight - 1) * 256) / (height - 1);
102
103 uint8_t ix = fx >> 8; // Integer part
104 uint8_t iy = fy >> 8;
105 uint8_t dx = fx & 0xFF; // Fractional part
106 uint8_t dy = fy & 0xFF;
107
108 uint8_t ix1 = (ix + 1 < inputWidth) ? ix + 1 : ix;
109 uint8_t iy1 = (iy + 1 < inputHeight) ? iy + 1 : iy;
110
111 uint16_t i00 = iy * inputWidth + ix;
112 uint16_t i10 = iy * inputWidth + ix1;
113 uint16_t i01 = iy1 * inputWidth + ix;
114 uint16_t i11 = iy1 * inputWidth + ix1;
115
116 CRGB c00 = input[i00];
117 CRGB c10 = input[i10];
118 CRGB c01 = input[i01];
119 CRGB c11 = input[i11];
120
121 CRGB result;
122 result.r = bilinearInterpolatePowerOf2(c00.r, c10.r, c01.r, c11.r, dx, dy);
123 result.g = bilinearInterpolatePowerOf2(c00.g, c10.g, c01.g, c11.g, dx, dy);
124 result.b = bilinearInterpolatePowerOf2(c00.b, c10.b, c01.b, c11.b, dx, dy);
125
126 uint16_t idx = xyMap.mapToIndex(x, y);
127 if (idx < n) {
128 output[idx] = result;
129 }
130 }
131 }
132}
uint8_t bilinearInterpolatePowerOf2(uint8_t v00, uint8_t v10, uint8_t v01, uint8_t v11, uint8_t dx, uint8_t dy)

References bilinearInterpolatePowerOf2(), x, xyMap, and y.

Referenced by bilinearExpand(), and fl::ScaleUp::expand().

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

◆ bilinearInterpolate()

uint8_t fl::bilinearInterpolate ( uint8_t v00,
uint8_t v10,
uint8_t v01,
uint8_t v11,
uint16_t dx,
uint16_t dy )

Definition at line 67 of file bilinear_expansion.cpp.

68 {
69 uint16_t dx_inv = 256 - dx;
70 uint16_t dy_inv = 256 - dy;
71
72 uint32_t w00 = (uint32_t)dx_inv * dy_inv;
73 uint32_t w10 = (uint32_t)dx * dy_inv;
74 uint32_t w01 = (uint32_t)dx_inv * dy;
75 uint32_t w11 = (uint32_t)dx * dy;
76
77 uint32_t sum = v00 * w00 + v10 * w10 + v01 * w01 + v11 * w11;
78
79 // Normalize the result by dividing by 65536 (shift right by 16 bits),
80 // with rounding
81 uint8_t result = (uint8_t)((sum + 32768) >> 16);
82
83 return result;
84}

Referenced by bilinearExpandArbitrary().

+ Here is the caller graph for this function:

◆ bilinearInterpolateFloat()

uint8_t fl::bilinearInterpolateFloat ( uint8_t v00,
uint8_t v10,
uint8_t v01,
uint8_t v11,
float dx,
float dy )

Definition at line 159 of file bilinear_expansion.cpp.

160 {
161 float dx_inv = 1.0f - dx;
162 float dy_inv = 1.0f - dy;
163
164 // Calculate the weights for each corner
165 float w00 = dx_inv * dy_inv;
166 float w10 = dx * dy_inv;
167 float w01 = dx_inv * dy;
168 float w11 = dx * dy;
169
170 // Compute the weighted sum
171 float sum = v00 * w00 + v10 * w10 + v01 * w01 + v11 * w11;
172
173 // Clamp the result to [0, 255] and round
174 uint8_t result = static_cast<uint8_t>(sum + 0.5f);
175
176 return result;
177}

Referenced by bilinearExpandArbitraryFloat(), and bilinearExpandFloat().

+ Here is the caller graph for this function:

◆ bilinearInterpolatePowerOf2()

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

Definition at line 134 of file bilinear_expansion.cpp.

135 {
136 uint16_t dx_inv = 256 - dx; // 0 to 256
137 uint16_t dy_inv = 256 - dy; // 0 to 256
138
139 // Scale down weights to fit into uint16_t
140 uint16_t w00 = (dx_inv * dy_inv) >> 8; // Max value 256
141 uint16_t w10 = (dx * dy_inv) >> 8;
142 uint16_t w01 = (dx_inv * dy) >> 8;
143 uint16_t w11 = (dx * dy) >> 8;
144
145 // Sum of weights should be approximately 256
146 uint16_t weight_sum = w00 + w10 + w01 + w11;
147
148 // Compute the weighted sum of pixel values
149 uint16_t sum = v00 * w00 + v10 * w10 + v01 * w01 + v11 * w11;
150
151 // Normalize the result
152 uint8_t result = (sum + (weight_sum >> 1)) / weight_sum;
153
154 return result;
155}

Referenced by bilinearExpandPowerOf2().

+ Here is the caller graph for this function:

◆ cos16lut()

static FASTLED_FORCE_INLINE int16_t fl::cos16lut ( uint16_t angle)
static

Definition at line 63 of file sin32.h.

64{
65 uint8_t angle256 = angle / 256;
66 int32_t subAngle = angle % 256;
67 return (cosArray[angle256] * (256 - subAngle) + cosArray[angle256 + 1] * subAngle) / 256;
68}
const int16_t * cosArray
Definition sin32.cpp:33

References cosArray, and FASTLED_FORCE_INLINE.

◆ cos32()

static FASTLED_FORCE_INLINE int32_t fl::cos32 ( uint32_t angle)
static

Definition at line 45 of file sin32.h.

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

References cosArray, and FASTLED_FORCE_INLINE.

◆ drawSquare()

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

◆ fadeToColorBy()

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

◆ fastled_file_offset()

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

Definition at line 8 of file dbg.h.

8 {
9 const char* p = file;
10 const char* last_slash = nullptr;
11
12 while (*p) {
13 if (p[0] == 's' && p[1] == 'r' && p[2] == 'c' && p[3] == '/') {
14 return p; // Skip past "src/"
15 }
16 if (*p == '/') { // fallback to using last slash
17 last_slash = p;
18 }
19 p++;
20 }
21 // If "src/" not found but we found at least one slash, return after the last slash
22 if (last_slash) {
23 return last_slash + 1;
24 }
25 return file; // If no slashes found at all, return original path
26}
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
Definition noise.cpp:56

References p.

◆ FASTLED_SMART_PTR() [1/28]

fl::FASTLED_SMART_PTR ( Animartrix )

◆ FASTLED_SMART_PTR() [2/28]

fl::FASTLED_SMART_PTR ( ByteStream )

◆ FASTLED_SMART_PTR() [3/28]

fl::FASTLED_SMART_PTR ( ByteStreamMemory )

◆ FASTLED_SMART_PTR() [4/28]

fl::FASTLED_SMART_PTR ( Cylon )

◆ FASTLED_SMART_PTR() [5/28]

fl::FASTLED_SMART_PTR ( DemoReel100 )

◆ FASTLED_SMART_PTR() [6/28]

fl::FASTLED_SMART_PTR ( DigitalPinImpl )

◆ FASTLED_SMART_PTR() [7/28]

fl::FASTLED_SMART_PTR ( FileHandle )

◆ FASTLED_SMART_PTR() [8/28]

fl::FASTLED_SMART_PTR ( FileSystem )

◆ FASTLED_SMART_PTR() [9/28]

fl::FASTLED_SMART_PTR ( Fire2012 )

Simple one-dimensional fire animation function.

◆ FASTLED_SMART_PTR() [10/28]

fl::FASTLED_SMART_PTR ( Frame )

◆ FASTLED_SMART_PTR() [11/28]

fl::FASTLED_SMART_PTR ( FrameInterpolator )

◆ FASTLED_SMART_PTR() [12/28]

fl::FASTLED_SMART_PTR ( FsImpl )

◆ FASTLED_SMART_PTR() [13/28]

fl::FASTLED_SMART_PTR ( Fx )

◆ FASTLED_SMART_PTR() [14/28]

fl::FASTLED_SMART_PTR ( Fx2d )

◆ FASTLED_SMART_PTR() [15/28]

fl::FASTLED_SMART_PTR ( FxLayer )

◆ FASTLED_SMART_PTR() [16/28]

fl::FASTLED_SMART_PTR ( NoisePalette )

◆ FASTLED_SMART_PTR() [17/28]

fl::FASTLED_SMART_PTR ( NoiseWave )

◆ FASTLED_SMART_PTR() [18/28]

fl::FASTLED_SMART_PTR ( Pacifica )

◆ FASTLED_SMART_PTR() [19/28]

fl::FASTLED_SMART_PTR ( PixelStream )

◆ FASTLED_SMART_PTR() [20/28]

fl::FASTLED_SMART_PTR ( Pride2015 )

◆ FASTLED_SMART_PTR() [21/28]

fl::FASTLED_SMART_PTR ( RedSquare )

◆ FASTLED_SMART_PTR() [22/28]

fl::FASTLED_SMART_PTR ( ScaleUp )

◆ FASTLED_SMART_PTR() [23/28]

fl::FASTLED_SMART_PTR ( StringHolder )

◆ FASTLED_SMART_PTR() [24/28]

fl::FASTLED_SMART_PTR ( TimeFunction )

◆ FASTLED_SMART_PTR() [25/28]

fl::FASTLED_SMART_PTR ( TimeScale )

◆ FASTLED_SMART_PTR() [26/28]

fl::FASTLED_SMART_PTR ( TwinkleFox )

◆ FASTLED_SMART_PTR() [27/28]

fl::FASTLED_SMART_PTR ( VideoFxWrapper )

◆ FASTLED_SMART_PTR() [28/28]

fl::FASTLED_SMART_PTR ( VideoImpl )

◆ FASTLED_SMART_PTR_NO_FWD() [1/2]

fl::FASTLED_SMART_PTR_NO_FWD ( LUT16 )

◆ FASTLED_SMART_PTR_NO_FWD() [2/2]

fl::FASTLED_SMART_PTR_NO_FWD ( LUTXYFLOAT )

◆ FASTLED_UI_DEFINE_OPERATORS() [1/4]

fl::FASTLED_UI_DEFINE_OPERATORS ( UIButton )

◆ FASTLED_UI_DEFINE_OPERATORS() [2/4]

fl::FASTLED_UI_DEFINE_OPERATORS ( UICheckbox )

◆ FASTLED_UI_DEFINE_OPERATORS() [3/4]

fl::FASTLED_UI_DEFINE_OPERATORS ( UINumberField )

◆ FASTLED_UI_DEFINE_OPERATORS() [4/4]

fl::FASTLED_UI_DEFINE_OPERATORS ( UISlider )

◆ five_bit_bitshift()

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

Definition at line 73 of file five_bit_hd_gamma.cpp.

74 {
75 if (brightness == 0) {
76 *out = CRGB(0, 0, 0);
77 *out_power_5bit = 0;
78 return 0;
79 }
80 if (r16 == 0 && g16 == 0 && b16 == 0) {
81 *out = CRGB(0, 0, 0);
82 *out_power_5bit = (brightness <= 31) ? brightness : 31;
83 return brightness;
84 }
85
86 // Note: One day someone smarter than me will come along and invent a closed
87 // form solution for this. However, the numerical method works extremely
88 // well and has been optimized to avoid division performance penalties as
89 // much as possible.
90
91 // Step 1: Initialize brightness
92 static const uint8_t kStartBrightness = 0b00010000;
93 uint8_t v5 = kStartBrightness;
94 // Step 2: Boost brightness by swapping power with the driver brightness.
96
97 // Step 3: Boost brightness of the color channels by swapping power with the
98 // driver brightness.
99 uint16_t max_component = max3(r16, g16, b16);
100 // five_bit_color_bitshift(&r16, &g16, &b16, &v5);
101 uint8_t shifts = brightness_bitshifter16(&v5, &max_component, 4, 2);
102 if (shifts) {
103 r16 = r16 << shifts;
104 g16 = g16 << shifts;
105 b16 = b16 << shifts;
106 }
107
108 // Step 4: scale by final brightness factor.
109 if (brightness != 0xff) {
110 r16 = scale16by8(r16, brightness);
111 g16 = scale16by8(g16, brightness);
112 b16 = scale16by8(b16, brightness);
113 }
114
115
116 // brighten hardware brightness by turning on low order bits
117 if (v5 > 1) {
118 // since v5 is a power of two, subtracting one will invert the leading bit
119 // and invert all the bits below it.
120 // Example: 0b00010000 -1 = 0b00001111
121 // So 0b00010000 | 0b00001111 = 0b00011111
122 v5 = v5 | (v5 - 1);
123 }
124 // Step 5: Convert back to 8-bit and output.
125 *out = CRGB(map16_to_8(r16), map16_to_8(g16), map16_to_8(b16));
126 *out_power_5bit = v5;
127 return brightness;
128}
UISlider brightness("Brightness", 255, 0, 255)
uint8_t brightness_bitshifter8(uint8_t *brightness_src, uint8_t *brightness_dst, uint8_t max_shifts)
uint8_t brightness_bitshifter16(uint8_t *brightness_src, uint16_t *brightness_dst, uint8_t max_shifts, uint8_t steps=2)
LIB8STATIC_ALWAYS_INLINE uint8_t map16_to_8(uint16_t x)
Definition intmap.h:31

References brightness, brightness_bitshifter16(), brightness_bitshifter8(), map16_to_8(), and scale16by8().

Referenced by __builtin_five_bit_hd_gamma_bitshift().

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

◆ five_bit_hd_gamma_bitshift()

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

Definition at line 57 of file five_bit_hd_gamma.h.

61 {
63 colors_scale,
64 global_brightness,
65 out_colors,
66 out_power_5bit);
67}
void __builtin_five_bit_hd_gamma_bitshift(CRGB colors, CRGB colors_scale, uint8_t global_brightness, CRGB *out_colors, uint8_t *out_power_5bit)

References __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,
uint16_t * r16,
uint16_t * g16,
uint16_t * b16 )

Definition at line 28 of file five_bit_hd_gamma.cpp.

29 {
30 uint16_t _r16 = map8_to_16(color.r);
31 uint16_t _g16 = map8_to_16(color.g);
32 uint16_t _b16 = map8_to_16(color.b);
33 *r16 = scale16by8(_r16, color.r);
34 *g16 = scale16by8(_g16, color.g);
35 *b16 = scale16by8(_b16, color.b);
36}
LIB8STATIC_ALWAYS_INLINE uint16_t map8_to_16(uint8_t x)
Definition intmap.h:25

References map8_to_16(), and scale16by8().

Referenced by __builtin_five_bit_hd_gamma_bitshift().

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

◆ LargeBlockAllocate()

void * fl::LargeBlockAllocate ( size_t size,
bool zero )

Definition at line 42 of file allocator.cpp.

42 {
43 void* ptr = Alloc(size);
44 if (zero) {
45 memset(ptr, 0, size);
46 }
47 return ptr;
48}

Referenced by fl::Frame::Frame(), and fl::LargeBlockAllocator< T >::Alloc().

+ Here is the caller graph for this function:

◆ LargeBlockDeallocate()

void fl::LargeBlockDeallocate ( void * ptr)

Definition at line 50 of file allocator.cpp.

50 {
51 Free(ptr);
52}

Referenced by fl::Frame::~Frame(), and fl::LargeBlockAllocator< T >::Free().

+ Here is the caller graph for this function:

◆ make_sdcard_filesystem()

FsImplPtr fl::make_sdcard_filesystem ( int cs_pin)

Definition at line 190 of file file_system.cpp.

190 {
191 FASTLED_UNUSED(cs_pin);
192 FsImplPtr out = FsImplPtr::TakeOwnership(new NullFileSystem());
193 return out;
194}
#define FASTLED_UNUSED(x)
Definition unused.h:3

References FASTLED_UNUSED.

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

+ Here is the caller graph for this function:

◆ parseJson()

bool fl::parseJson ( const char * json,
fl::JsonDocument * doc,
Str * _error )

Definition at line 6 of file json.cpp.

6 {
7 #if !FASTLED_ENABLE_JSON
8 if (_error) {
9 *_error = "JSON not enabled";
10 }
11 return false;
12 #else
13 FLArduinoJson::DeserializationError error = deserializeJson(*doc, json);
14 if (error) {
15 if (_error) {
16 *_error = error.c_str();
17 }
18 return false;
19 }
20 return true;
21 #endif
22}
const char * c_str() const
Definition str.h:247

References fl::StrN< SIZE >::c_str().

Referenced by fl::ScreenMap::ParseJson(), and fl::FileSystem::readJson().

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

◆ SetLargeBlockAllocator()

void fl::SetLargeBlockAllocator ( void *(* alloc )(size_t),
void(* free )(void *) )

Definition at line 37 of file allocator.cpp.

37 {
38 Alloc = alloc;
39 Free = free;
40}

◆ sin16lut()

static FASTLED_FORCE_INLINE int16_t fl::sin16lut ( uint16_t angle)
static

Definition at line 54 of file sin32.h.

55{
56 uint8_t angle256 = angle / 256;
57 int32_t subAngle = angle % 256;
58 return (sinArray[angle256] * (256 - subAngle) + sinArray[angle256 + 1] * subAngle) / 256;
59}
const int16_t * sinArray
Definition sin32.cpp:31

References FASTLED_FORCE_INLINE, and sinArray.

◆ sin32()

static FASTLED_FORCE_INLINE int32_t fl::sin32 ( uint32_t angle)
static

Definition at line 36 of file sin32.h.

37{
38 uint8_t angle256 = angle / 65536;
39 int32_t subAngle = angle % 65536;
40 return sinArray[angle256] * (65536 - subAngle) + sinArray[angle256 + 1] * subAngle;
41}

References FASTLED_FORCE_INLINE, and sinArray.

◆ toJson()

void fl::toJson ( const fl::JsonDocument & doc,
Str * jsonBuffer )

Definition at line 24 of file json.cpp.

24 {
25 #if !FASTLED_ENABLE_JSON
26 return;
27 #else
28 serializeJson(doc, *jsonBuffer);
29 #endif
30}

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

+ Here is the caller graph for this function:

◆ x_linear()

FASTLED_FORCE_INLINE uint16_t fl::x_linear ( uint16_t x,
uint16_t length )

Definition at line 14 of file xmap.h.

14 {
15 (void)length;
16 return x;
17}

References FASTLED_FORCE_INLINE, and x.

Referenced by fl::XMap::mapToIndex().

+ Here is the caller graph for this function:

◆ x_reverse()

FASTLED_FORCE_INLINE uint16_t fl::x_reverse ( uint16_t x,
uint16_t length )

Definition at line 19 of file xmap.h.

19 {
20 return length - 1 - x;
21}

References FASTLED_FORCE_INLINE, and x.

Referenced by fl::XMap::mapToIndex().

+ Here is the caller graph for this function:

◆ xy_line_by_line()

FASTLED_FORCE_INLINE uint16_t fl::xy_line_by_line ( uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height )

Definition at line 26 of file xymap.h.

27 {
28 (void)height;
29 return y * width + x;
30}

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 uint16_t fl::xy_serpentine ( uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height )

Definition at line 16 of file xymap.h.

17 {
18 (void)height;
19 if (y & 1) // Even or odd row?
20 // reverse every second line for a serpentine lled layout
21 return (y + 1) * width - 1 - x;
22 else
23 return y * width + x;
24}

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 Ice_p
const TProgmemRGBPalette16 RedWhite_p
const TProgmemRGBPalette16 FairyLight_p
const TProgmemRGBPalette16 RedGreenWhite_p
const TProgmemRGBPalette16 BlueWhite_p
const TProgmemRGBPalette16 Holly_p
const TProgmemRGBPalette16 RetroC9_p
const TProgmemRGBPalette16 Snow_p
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.

Definition at line 295 of file twinklefox.h.

295 {
298 &Holly_p, &Ice_p};
const TProgmemRGBPalette16 Snow_p
Definition twinklefox.h:278
const TProgmemRGBPalette16 RetroC9_p
Definition twinklefox.h:283
const TProgmemRGBPalette16 BlueWhite_p
Definition twinklefox.h:255
const TProgmemRGBPalette16 RedGreenWhite_p
Definition twinklefox.h:240
const TProgmemRGBPalette16 RedWhite_p
Definition twinklefox.h:250
const TProgmemRGBPalette16 Ice_p
Definition twinklefox.h:288
const TProgmemRGBPalette16 FairyLight_p
Definition twinklefox.h:260
const TProgmemRGBPalette16 Holly_p
Definition twinklefox.h:245

Referenced by 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},
198 {WAVES, "WAVES", &FastLEDANIMartRIX::Waves},
201 {RINGS, "RINGS", &FastLEDANIMartRIX::Rings},
208 {WATER, "WATER", &FastLEDANIMartRIX::Water},
220 {MODULE_EXPERIMENT_SM1, "MODULE_EXPERIMENT_SM1", &FastLEDANIMartRIX::SM1},
221 {MODULE_EXPERIMENT_SM2, "MODULE_EXPERIMENT_SM2", &FastLEDANIMartRIX::SM2},
222 {MODULE_EXPERIMENT_SM3, "MODULE_EXPERIMENT_SM3", &FastLEDANIMartRIX::SM3},
223 {MODULE_EXPERIMENT_SM4, "MODULE_EXPERIMENT_SM4", &FastLEDANIMartRIX::SM4},
224 {MODULE_EXPERIMENT_SM5, "MODULE_EXPERIMENT_SM5", &FastLEDANIMartRIX::SM5},
225 {MODULE_EXPERIMENT_SM6, "MODULE_EXPERIMENT_SM6", &FastLEDANIMartRIX::SM6},
226 {MODULE_EXPERIMENT_SM8, "MODULE_EXPERIMENT_SM8", &FastLEDANIMartRIX::SM8},
227 {MODULE_EXPERIMENT_SM9, "MODULE_EXPERIMENT_SM9", &FastLEDANIMartRIX::SM9},
228 {MODULE_EXPERIMENT_SM10, "MODULE_EXPERIMENT_SM10", &FastLEDANIMartRIX::SM10},
229};

Referenced by fl::Animartrix::getAnimationName(), 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:542
@ Blue
<div style='background:#0000FF;width:4em;height:4em;'></div>
Definition crgb.h:498

Definition at line 255 of file twinklefox.h.

◆ cosArray

const int16_t * fl::cosArray = &sinLut[64]

Definition at line 33 of file sin32.cpp.

Referenced by cos16lut(), and cos32().

◆ FairyLight_p

const TProgmemRGBPalette16 fl::FairyLight_p
Initial value:

Definition at line 260 of file twinklefox.h.

◆ 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 245 of file twinklefox.h.

245 {
246 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c,
247 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c, 0x00580c,
248 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 288 of file twinklefox.h.

288 {
289 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040,
290 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040, 0x0C1040,
291 0x182080, 0x182080, 0x182080, 0x5080C0};

◆ RedGreenWhite_p

const TProgmemRGBPalette16 fl::RedGreenWhite_p
Initial value:
= {
@ Green
<div style='background:#008000;width:4em;height:4em;'></div>
Definition crgb.h:544
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:608

Definition at line 240 of file twinklefox.h.

◆ RedWhite_p

const TProgmemRGBPalette16 fl::RedWhite_p
Initial value:

Definition at line 250 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 283 of file twinklefox.h.

283 {
284 0xB80400, 0x902C02, 0xB80400, 0x902C02, 0x902C02, 0xB80400,
285 0x902C02, 0xB80400, 0x046002, 0x046002, 0x046002, 0x046002,
286 0x070758, 0x070758, 0x070758, 0x606820};

◆ sinArray

const int16_t * fl::sinArray = &sinLut[0]

Definition at line 31 of file sin32.cpp.

Referenced by sin16lut(), and sin32().

◆ sinLut

const int16_t fl::sinLut[]
Initial value:
=
{
0, 804, 1608, 2410, 3212, 4011, 4808, 5602, 6393, 7179, 7962, 8739, 9512, 10278, 11039, 11793,
12539, 13279, 14010, 14732, 15446, 16151, 16846, 17530, 18204, 18868, 19519, 20159, 20787, 21403, 22005, 22594,
23170, 23731, 24279, 24811, 25329, 25832, 26319, 26790, 27245, 27683, 28105, 28510, 28898, 29268, 29621, 29956,
30273, 30571, 30852, 31113, 31356, 31580, 31785, 31971, 32137, 32285, 32412, 32521, 32609, 32678, 32728, 32757,
32767, 32757, 32728, 32678, 32609, 32521, 32412, 32285, 32137, 31971, 31785, 31580, 31356, 31113, 30852, 30571,
30273, 29956, 29621, 29268, 28898, 28510, 28105, 27683, 27245, 26790, 26319, 25832, 25329, 24811, 24279, 23731,
23170, 22594, 22005, 21403, 20787, 20159, 19519, 18868, 18204, 17530, 16846, 16151, 15446, 14732, 14010, 13279,
12539, 11793, 11039, 10278, 9512, 8739, 7962, 7179, 6393, 5602, 4808, 4011, 3212, 2410, 1608, 804,
0, -804, -1608, -2410, -3212, -4011, -4808, -5602, -6393, -7179, -7962, -8739, -9512, -10278, -11039, -11793,
-12539, -13279, -14010, -14732, -15446, -16151, -16846, -17530, -18204, -18868, -19519, -20159, -20787, -21403, -22005, -22594,
-23170, -23731, -24279, -24811, -25329, -25832, -26319, -26790, -27245, -27683, -28105, -28510, -28898, -29268, -29621, -29956,
-30273, -30571, -30852, -31113, -31356, -31580, -31785, -31971, -32137, -32285, -32412, -32521, -32609, -32678, -32728, -32757,
-32767, -32757, -32728, -32678, -32609, -32521, -32412, -32285, -32137, -31971, -31785, -31580, -31356, -31113, -30852, -30571,
-30273, -29956, -29621, -29268, -28898, -28510, -28105, -27683, -27245, -26790, -26319, -25832, -25329, -24811, -24279, -23731,
-23170, -22594, -22005, -21403, -20787, -20159, -19519, -18868, -18204, -17530, -16846, -16151, -15446, -14732, -14010, -13279,
-12539, -11793, -11039, -10278, -9512, -8739, -7962, -7179, -6393, -5602, -4808, -4011, -3212, -2410, -1608, -804,
0, 804, 1608, 2410, 3212, 4011, 4808, 5602, 6393, 7179, 7962, 8739, 9512, 10278, 11039, 11793,
12539, 13279, 14010, 14732, 15446, 16151, 16846, 17530, 18204, 18868, 19519, 20159, 20787, 21403, 22005, 22594,
23170, 23731, 24279, 24811, 25329, 25832, 26319, 26790, 27245, 27683, 28105, 28510, 28898, 29268, 29621, 29956,
30273, 30571, 30852, 31113, 31356, 31580, 31785, 31971, 32137, 32285, 32412, 32521, 32609, 32678, 32728, 32757,
32767}

Definition at line 7 of file sin32.cpp.

8{
9 0, 804, 1608, 2410, 3212, 4011, 4808, 5602, 6393, 7179, 7962, 8739, 9512, 10278, 11039, 11793,
10 12539, 13279, 14010, 14732, 15446, 16151, 16846, 17530, 18204, 18868, 19519, 20159, 20787, 21403, 22005, 22594,
11 23170, 23731, 24279, 24811, 25329, 25832, 26319, 26790, 27245, 27683, 28105, 28510, 28898, 29268, 29621, 29956,
12 30273, 30571, 30852, 31113, 31356, 31580, 31785, 31971, 32137, 32285, 32412, 32521, 32609, 32678, 32728, 32757,
13 32767, 32757, 32728, 32678, 32609, 32521, 32412, 32285, 32137, 31971, 31785, 31580, 31356, 31113, 30852, 30571,
14 30273, 29956, 29621, 29268, 28898, 28510, 28105, 27683, 27245, 26790, 26319, 25832, 25329, 24811, 24279, 23731,
15 23170, 22594, 22005, 21403, 20787, 20159, 19519, 18868, 18204, 17530, 16846, 16151, 15446, 14732, 14010, 13279,
16 12539, 11793, 11039, 10278, 9512, 8739, 7962, 7179, 6393, 5602, 4808, 4011, 3212, 2410, 1608, 804,
17 0, -804, -1608, -2410, -3212, -4011, -4808, -5602, -6393, -7179, -7962, -8739, -9512, -10278, -11039, -11793,
18-12539, -13279, -14010, -14732, -15446, -16151, -16846, -17530, -18204, -18868, -19519, -20159, -20787, -21403, -22005, -22594,
19-23170, -23731, -24279, -24811, -25329, -25832, -26319, -26790, -27245, -27683, -28105, -28510, -28898, -29268, -29621, -29956,
20-30273, -30571, -30852, -31113, -31356, -31580, -31785, -31971, -32137, -32285, -32412, -32521, -32609, -32678, -32728, -32757,
21-32767, -32757, -32728, -32678, -32609, -32521, -32412, -32285, -32137, -31971, -31785, -31580, -31356, -31113, -30852, -30571,
22-30273, -29956, -29621, -29268, -28898, -28510, -28105, -27683, -27245, -26790, -26319, -25832, -25329, -24811, -24279, -23731,
23-23170, -22594, -22005, -21403, -20787, -20159, -19519, -18868, -18204, -17530, -16846, -16151, -15446, -14732, -14010, -13279,
24-12539, -11793, -11039, -10278, -9512, -8739, -7962, -7179, -6393, -5602, -4808, -4011, -3212, -2410, -1608, -804,
25 0, 804, 1608, 2410, 3212, 4011, 4808, 5602, 6393, 7179, 7962, 8739, 9512, 10278, 11039, 11793,
26 12539, 13279, 14010, 14732, 15446, 16151, 16846, 17530, 18204, 18868, 19519, 20159, 20787, 21403, 22005, 22594,
27 23170, 23731, 24279, 24811, 25329, 25832, 26319, 26790, 27245, 27683, 28105, 28510, 28898, 29268, 29621, 29956,
28 30273, 30571, 30852, 31113, 31356, 31580, 31785, 31971, 32137, 32285, 32412, 32521, 32609, 32678, 32728, 32757,
29 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 278 of file twinklefox.h.

278 {
279 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048,
280 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048,
281 0x304048, 0x304048, 0x304048, 0xE0F0FF};