166 Commits

Author SHA1 Message Date
Blaž Kristan
d7be9c9a66 Address issues reported 2025-03-10 07:12:45 +01:00
Blaž Kristan
9bfd34e6b2 Rework color_from_palette()
- respect paletteBlend
- bugfix in ColorFromPaletteWLED()
2025-02-19 11:47:13 +01:00
Blaž Kristan
8c717537c4 Lambda XY() 2025-02-06 15:12:04 +01:00
Damian Schneider
373f4cfefd removed unnecessary lambda function
performance is the same, the function just makes it a bit confusing.
2025-02-06 06:44:26 +01:00
Blaž Kristan
3a426e258b
Merge branch 'main' into blending-styles 2025-01-20 11:19:43 +01:00
Frank
566c5057f9 optimizations as per reviewer recommendations
* removed unneeded initializations in blur() and blur2D()
* remove check for _t in progress()
* code readability: if (_t) --> if(isInTransition())
* add `isInTransition()` checks to currentBri() and currentMode()
* added missing `_transitionprogress = 0xFFFFU` in stopTransition()
2025-01-19 07:35:46 +01:00
Blaž Kristan
01c463c8e8 More tuning
- replaced POD new/delete with malloc/free
- some more SEGLEN <= 1
- some gnu::pure
- more const attributes
- some static attributes
2025-01-19 07:35:46 +01:00
Frank
013684b5ca making some parameters const, plus minor improvements
* changed some parameters to "pointer to const", so compiler can better optimize code size and performance -  because data behind a const pointer will never be modified by the called function.
* made setPixelColor `const`

* fixed a few potentially uninitialized local vars (the may have random values if not initialized)

* avoid shadowing "state" in handleSerial()
* plus a few very minor improvements
2025-01-19 07:35:46 +01:00
Frank
703f84e5e1 code robustness improvements plus minor speedup
* make  XY() and _setPixelColorXY_raw() const (minor speedup)
* segment is a struct not a class: friend class Segment --> friend struct Segment
* fix missing braces around two macros
* use non-throwing "new" where possible
* improve robustness of transition code
2025-01-19 07:35:46 +01:00
Blaž Kristan
a65f97ac75 Merge branch 'main' into blending-styles 2025-01-14 22:39:20 +01:00
Damian Schneider
07cc3aa5c0
FX improvements and cleanup (#4145)
Improvements & merges of FX

- Scrolling Text: Gradient Palette support added
- Waving Cell: Improved with higher temporal resolution (smoother at lower speeds) and added additional mode setting and optional blurring
- Julia: added blur option
- Squared Swirl: added fade option

- Added smearing option to:
    - DNA
    - DNA Spiral
    - Drift
    - Drift Rose
    - Crazy Bees
    - Ripple
    - Colored Bursts
    - Frizzles
    - Lissajous
    - Sindots
    - Spaceships

- Added palette support to:
    - Crazy Bees
    - Polar Lights
    - Drift Rose

- Changed default palette handling (no more special treatment for some FX)
- Merged puddles and puddlepeak
- Merged Gravcenter, Gravcentric, Gravfreq and Gravimeter (saves 1.2k of flash)
- Merged meteor and meteor smooth
- Renamed police_base into mode_two_dots as that was just an alias
- Added 'Traffic Light' palette (originally defined in Polar Lights FX)
-  Firenoise: removed local palette, use fire palette -> slight change in looks (+bugfix)
- Some code cleanup (removed unused / commented stuff)
- Moved dev info for AR to the top so ist easier to find as a reference, also added link to KB there
2024-12-20 14:13:53 +01:00
Damian Schneider
cae98451e3 Merge remote-tracking branch 'upstream/main' into 0_15__speed_improvements 2024-12-20 09:12:01 +01:00
Damian Schneider
83da7569f5
code consolidation in drawCircle() (#4302)
- saves about 600bytes of flash
- speed tradoff: drawing is now a tiny bit slower but insignificant in my tests
2024-12-19 20:19:42 +01:00
Damian Schneider
26397ee8ad
Optimization: color_blend() (#4245)
Removing the bool saves on code size and makes the function a tiny bit faster. Also this is a cleaner solution IMHO.

-updated blend function to optimized 8bit calculation
- efficient color blend calculation in fews operations possible
- omitting min / max checks makes it faster on average
- using 8bit for "blend" variable does not significantly influence the resulting color, just transition points are slightly shifted but yield very good results (and better than the original 16bit version using the old fastled math with improper rounding)
- updated drawCircle and drawLine to use 8bit directly instead of 16bit with a shift
2024-12-19 18:20:56 +01:00
Damian Schneider
0a05611e1d more improvements to setPixelColor
- code is a bit cleaner and faster as well
- chaning array access to pointer access in bus_manager makes it a few instructions faster
- changed getNumberOfPins and getNumberOfChannels to return 32bit values, saving the unnecessary 8bit conversion
2024-11-26 20:59:36 +01:00
Blaž Kristan
5c2bac4b9d Merge branch '0_15' into 0_15__speed_improvements 2024-11-09 10:53:27 +01:00
Blaž Kristan
4cc2cc4ad4 Multiple fixes
- increase WLED_MAX_BUSSES for C3 (fixes #4215)
- fix for #4228
- fix for very long running effect (strip.now, strip.timebase)
- C++ API change to allow `seg.setColor().setOpacity()`
2024-10-26 15:16:11 +02:00
Christian Schwinne
e9d2182390
Re-license the WLED project from MIT to EUPL (#4194) 2024-10-16 00:07:19 +02:00
Blaž Kristan
be64930ebb Indentation and shadowed variable. 2024-10-07 16:50:51 +02:00
Blaž Kristan
eb5ad232a0 Minor tweaks and whitespace 2024-10-05 23:31:31 +02:00
Damian Schneider
ca062140f3 removed todo. 2024-10-03 19:39:39 +00:00
Damian Schneider
a15c391e6c Improvement to setPixelColorXY and some flash optimisations
- changes to `setPixelColorXY` give an extra FPS, some checks and the loops are only done when needed, additional function call is still faster (force inlining it gives negligible speed boost but eats more flash)
- commented out the unused `boxBlur` function
- code size improvemnts (also faster) in `moveX()` and `moveY()` by only copying whats required and avoiding code duplications
- consolidated the `blur()` functions by enabling asymmetrical blur2D() to replace `blurRow` and `blurCol`
- compiler warning fixes (explicit unsigned casts)
2024-10-03 21:19:34 +02:00
Blaz Kristan
ba3a61f623 Reduced code size by:
- removing WS2812FX::setMode()
- removing WS2812FX::setColor()
- removing floating point in transition
- color handling modification in set.cpp
- replaced uint8_t with unsigned in function parameters
- inlined WS2812FX::isUpdating()
- (MAY BE BREAKING) alexa & smartnest update
2024-10-02 20:14:25 +02:00
Frank
d3c401ed4e wu_pixel small optimization
5% faster
2024-09-29 19:29:12 +02:00
Blaz Kristan
336da25463 Private global _colorScaled 2024-09-29 14:14:07 +02:00
Damian Schneider
ffbc8c5f70 Reverting addition of bool unScale, added new improvements and fixes
- Added pre-calculation for segment brightness: stored in _segBri. The impact on FPS is not huge but measurable (~1-2FPS in my test conditions)
- Removed `bool unScaled` from `setPixelColor()` function again (it has no/minimal impact on speed but huge impact on flash usage: +850 bytes)
- Removed negative checking in `setPixelColorXY()` and replaced it with a local typecast to unsigned, saves a few instructions (tested and working)
- Changed int8_t to int in `moveX()` and `moveY()`
- Removed a few functions from IRAM as they are now not called for every pixel but only once per segment update
- Removed a `virtualWidth()` call from `ripple_base()`
- Bugfix in `mode_colortwinkle()`
2024-09-29 13:55:00 +02:00
Blaz Kristan
c842994df5 Pre-calculate virtual
- move SEGCOLOR() to Segment class
- add SEG_H, SEG_W macros
- try to speed up virtualXxxxx()
- compile warning fixes
2024-09-28 18:14:43 +02:00
Damian Schneider
7c0fe1285a updated setPixelColor() and getPixelColor() functions
uint16_t to unsigned to make it consisten throughout the hand-down.
colorFromPaletteWLED now returns uint32_t which saves the conversion to CRGB and back to uint32_t (in most uses at least).
also added (preliminary) CRGBW struct. I tried to use it in place of uint32_t colors but it adds a lot of overhead when passing the struct so reverted to uint32_t in most places.
updated a few FX to use the CRGBW struct and also cleaned some code to improve flash useage.
2024-09-28 15:26:14 +02:00
Blaz Kristan
33cf82a982 Indentations and a few optimisations
Restore addPixelColor() behaviour.
2024-09-23 18:03:17 +02:00
Damian Schneider
a88436c620 revert removal of adding with saturation, renamed 'fast' to 'saturate'
- blurring now uses desaturated adding: it is faster most of the times and blurring adds scaled colors so should rarely (ever?) saturate, I saw no visual difference in tests.
- formatting
2024-09-19 08:49:18 +02:00
Damian Schneider
696290527a cleanup and improved color_add()
- optimized color_add() again: now it is as fast with preserved ratio scaling than the "fast" variant was before (if no scaling is needed, it is even faster). plus it saves 250 bytes of flash
- bugfix in `color_fade()`
- removed a lot of whitespaces
2024-09-18 22:10:27 +02:00
Damian Schneider
2afff05014 minor tweak (break instead of continue in setPixelColorXY) 2024-09-14 11:45:27 +02:00
Damian Schneider
b07658b460 improved Segment::setPixelColorXY a tiny bit
uses less flash so it should be faster (did not notice any FPS difference though)
also cleaned code in ColorFromPaletteWLED (it is not faster, same amount of code)
2024-09-12 14:09:09 +02:00
Damian Schneider
c3f472fbcb some improvements to consider
no real difference in FPS but code is faster.
also 160bytes smaller, meaning it is actually faster
2024-09-11 21:41:42 +02:00
Blaz Kristan
1cee1c3562 Merge branch '0_15' into blending-styles 2024-09-11 17:28:48 +02:00
Blaz Kristan
eae5a74a11 color_fade bugfix
impure void remove
optimisations: hot
2024-09-11 17:14:59 +02:00
Blaz Kristan
b9080f9479 Mirroring bugfix. 2024-09-04 21:17:21 +02:00
Frank
c1c707c77a 8266 compatibility builds for older chips (another attempt t o solve #3690 and #3685)
some users have reported that releases after 0.14.0 are not working reliably. So we add a few "compat" for 8266 that try to reproduce the buildenv of 0.14.0 as much as possible.

* platform and platform_packages from 0.14.0
* not using PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
* due to smaller IRAM, we had to move some functions back from IRAM to normal flash (may cause slowdown)
2024-09-04 11:38:03 +02:00
Blaz Kristan
f6c47ac19c Fix some compiler warnings 2024-08-18 10:45:16 +02:00
Blaz Kristan
011afd0910 Merge branch '0_15' into blending-styles 2024-08-17 15:24:20 +02:00
Blaz Kristan
cec67d8eff Const and 2D box blur
- added 2D blur
2024-08-14 22:15:48 +02:00
Blaz Kristan
77723b615f Fix compiler warning 2024-08-08 21:10:27 +02:00
Blaz Kristan
e1598a9966 Merge branch '0_15' into blending-styles 2024-08-05 16:47:25 +02:00
Blaz Kristan
e82f38e277 Tuning 2024-08-05 16:42:21 +02:00
Blaž Kristan
365c1987ed Missing clipping fix
- small speed optimisations
2024-08-01 10:24:40 +02:00
Blaz Kristan
c03422ee37 Push variants 2024-07-30 17:26:50 +02:00
Blaž Kristan
f441ce9c17 Merge branch '0_15' into blending-styles 2024-05-12 08:12:58 +02:00
Blaz Kristan
4dbe9a7015 Antialiased line & circle 2024-05-10 00:02:28 +02:00
Blaz Kristan
8e8ffa30a6 Merge branch '0_15' into blending-styles 2024-04-26 20:45:26 +02:00
Blaz Kristan
d48bab02a1 Speed & size optimisations using native sized variables 2024-04-26 20:11:46 +02:00