Commit Graph

193 Commits

Author SHA1 Message Date
Frank
855d61af4e draw character minor speedup
Only use palette math when text with color gradient is needed
2024-10-22 23:10:30 +02:00
Frank
7c6178418a cache virtualLength() and some cleanup
speedup for 1D->2D mapping
2024-10-19 23:29:53 +02:00
Frank
670c621ffe Arc - gPC fix by @Brandon502
with fix for missing pixel on 8x32 and similar ratios.
2024-10-19 22:26:11 +02:00
Frank
e75fc4d457 fix holes in DNA effect (>32 pixel high segments)
avoid holes by using drawLine when there is a gap
2024-10-16 21:25:52 +02:00
Ewoud
33318dab25 Merge pull request #170 from MoonModules/license 2024-10-16 00:14:46 +02:00
Frank
22b16ab542 Align all licensing statements with EUPL-1.2 2024-10-14 21:52:52 +02:00
Frank
4fadcade93 fix for off-by-one error in Lissajous (float version) 2024-10-06 19:59:59 +02:00
Frank
79f5db6d65 fadePixelColorXY bugfix 2024-10-02 16:12:48 +02:00
Frank
63ff7205d6 wu_pixel small optimization
5% faster
2024-09-29 18:37:18 +02:00
Frank
3110b0a476 fix for XL builds
some usermod still seems to used sPC(float, float, c).

> Linking .pio/build/esp32_4MB_XL/firmware.elf
.pio/build/esp32_4MB_XL/src/usermods_list.cpp.o:(.literal._ZN7Frame3DD5Ev[Frame3D::~Frame3D()]+0x4): undefined reference to `Segment::setPixelColorXY(float, float, unsigned int, bool, bool)'
2024-09-29 18:02:39 +02:00
Frank
7e9474e78c depricate sPC(float, float)
the function is already removed in upstream.
You can use wu_pixel() instead, which is much faster and more accurate.
2024-09-29 17:51:44 +02:00
Frank
2aa0d47036 adding getPixelColorRestored()
similar to getPixelColor, but returns the original pixel without brightness adjustments.

* getPixelColorRestored is used by segment::sPC and segment::gPC
* getPixelColor is still used by ABL (auto brightness limiter)
2024-09-28 02:43:12 +02:00
Frank
b245112d2a some drawing speedups
* speedups for addPixelColorXY, fadePixelColorXY, fadeToBlackBy
2024-09-28 02:19:53 +02:00
Frank
0555b8e5f2 HUB75: avoid allocating ledMap
based on an idea by @troyhacks : fight heap fragmentation by avoiding to allocate ledMap when not needed.
2024-09-28 02:18:24 +02:00
Frank
3a506aded2 trying to keep scrolling text readable
the problem (partly solved) is that scrolling text does not erase any previous text, but simply paints pixels in addition.

* add a "shadow" area around each letter, which is explicitly painted black
* only possible when  Trail=0, and overlay option selected
2024-09-28 02:12:53 +02:00
Frank
80a2f2b85b minor corrections
* fix some override problems bus_manager (canShow() must not be const!!!)
* fixing some "comparing integer with different signedness" warnings
2024-09-21 19:41:51 +02:00
Blaz Kristan
6d83adae3c Mirroring bugfix. 2024-09-05 00:06:12 +02:00
Frank
b47c55db90 fix 8266 builds
wled00/FX_fcn.cpp:974:16: error: '_isSuperSimpleSegment' was not declared in this scope
2024-08-18 13:21:55 +02:00
Frank
b9007f2dc6 bugfix
fix compiler error on non-fastpath builds
2024-08-16 18:02:25 +02:00
Frank
030a7cee53 another small speedup, and segment stability improvement
* removed a few sanity check that are done again later in getPixelColor
* stability: prevent crashes when changing segments settings or effect options
2024-08-16 17:54:11 +02:00
Frank
6e415dfbbe HUB75 hack
HUB75 is very memory hungry - this hack deletes the mapping table when its not needed --> frees 8Kb with a 64x64 panel.
2024-08-07 18:31:06 +02:00
Frank
7f9da309c9 const const const
adding hints for the compiler for optimization.
In case your custom build complains about "const", just remove the keyword. based on e82f38e277, but going further :-)

* "const" class functions : function does not modify any class attributes ( --> "this" becomes const)

* __attribute__((pure)) :  function return value depends only on the parameters and/or global variables. The function does not modify any global or static variables.
* __attribute__((const)) : function only examines arguments (no globals), and has no effects except the return value. This slightly more strict than "pure"
* hot: tells the compiler "this functions is called very often"
* cold: the opposite of hot
2024-08-07 14:58:38 +02:00
Frank
273154db76 drawArc speedup (Circle mapping mode)
* Optimize drawArc to skip pixels that are off-screen or outside the circle's bounding box. Also move repeating calculations out of the inner loop.

testcase 64x64 : 8fps --> 33 fps :-)
2024-08-06 18:13:59 +02:00
Frank
42919f9daf blob effect improvements, and a dirty hack for HUB75 double buffer
* mode_2Dfloatingblobs() improvements for large panels
* Segment::fillCircle() speed optimizations
* HUB75 hack (disabled by default): skip first fill(BLACK) when using double buffering (as the buffer gets cleared after each frame)
2024-08-06 15:53:46 +02:00
Frank
5240c3450b Segment drawing optimizations (FASTPATH only)
* cache width, height, and a few more values that are normally re-calculated for each pixel
* make normal sPC a bit faster
* Segment::fade_out() optimization

--> only active in FASTPATH mode, to preserve flash on small devices (8266)
--> code still needs some polishing
--> up to 20% speedup with some 2D effects (esp32,  flash qio 80Mhz, -O2)
2024-08-05 21:30:25 +02:00
Frank
9bcc5da132 code cleanup
- removed commented-out code
- reduced blank lines
2024-07-16 20:48:15 +02:00
Frank
7a83f1759d removed a/b testing via Reverse X (segment option) 2024-07-16 20:26:52 +02:00
Frank
96584c6c70 better rounding 2024-07-16 15:13:05 +02:00
Frank
e3d27de395 better handling of perspective
drawLine parameter "depth" shortens a line by a fraction - useful for VP perspective (vanishing point)
2024-07-16 13:27:56 +02:00
Frank
6aaf7a908d more sPC optimizations
* made setPixelColorXY_fast private
* optimized Segment::fill() to use setPixelColorXY_fast
* "bar" 1D expand optimization
2024-07-14 23:49:37 +02:00
Frank
dddd1574ec (experimental) setPixelColorXY_fast speedup by setPixelColorXY_fast
* adding a _fast_ variant of SetPixelColorXY, that does not perform any error checking.
* drawLine uses the fast setPixelColor variant (bresenham algo only)
* for TESTING: segment option "reverse" switches back to the "original slow" code.
surely needs some more optimization and improvements.

First test on GEQ 3D shows 10%-30% speedup
2024-07-14 14:11:11 +02:00
Troy
52130e176c Merge branch 'mdev' into 3DGEQ 2024-07-12 22:10:39 -04:00
Troy
ce8f01bf90 Bugfixed GEQ 3D
Bug fixes after lots of testing, better settings, etc.

Big thanks to @netmindz  for restructuring the code.

Add rough distance stop to Segment::drawLine()
2024-07-12 22:03:33 -04:00
Frank
346914b965 setPixelColorXY small optimizations
Caching a few segment vars gives a 5% speedup on big setups.

Its 2024, and compilers are still stupid :-P
2024-07-13 01:37:43 +02:00
Frank
c07658a7cb post-merge
* fix drawLine prototype
* a few more "inline"
* typo
2024-06-26 23:41:38 +02:00
Blaz Kristan
2aad3f5356 Antialiased line & circle 2024-06-26 22:40:59 +02:00
Frank
6c93250cd8 small improvement
addPixelColorXY() is actually the same code as color_add()
2024-04-20 23:24:27 +02:00
Frank
d0f018586e bugfix
comparing uint32_t to fastled CRGB does not work.
2024-04-20 22:42:26 +02:00
Frank
e886ece189 Segment::setPixelColorXY optimization
use a shortcut when the segment is "simple" and just a single pixel needs to be set on HW level.
2024-04-20 22:02:15 +02:00
Frank
93b8c63e2b post PR3904 fixes and improvements
* fix compiler warnings (uninitialized vars, ambiguous  functions calls)
* restore some lost function prototypes
* avoid negative pixel indices
* only use "fast" color_add when there is no risk of  "overshooting" results
* minor optimizations
2024-04-18 21:09:14 +02:00
Blaž Kristan
48c64aecff Merge pull request #3904 from DedeHai/FX_fcn_improvements
added improvements to color scaling and blurring
2024-04-18 19:26:57 +02:00
netmindz
0f79e9b7ff Merge pull request #124 from netmindz/auto-playlist
New Usermod - Auto Playlist
2024-04-16 22:38:56 +01:00
Frank
019cafc5e0 report out-of-memory situations to the user 2024-04-16 19:10:46 +02:00
Troy
6e23b09a93 Update FX_2Dfcn.cpp
removed temp debugging
2024-04-04 21:46:35 -04:00
Troy
22be977df8 IfDefs to quiet some other debug lines during debugging. 2024-03-25 12:19:13 -04:00
Troy
5ff44755d8 calculations based on normalized FFT results 2024-03-25 08:19:05 -04:00
Frank
8905992a89 code spell checking - part4 (MM specific) 2023-12-15 00:14:57 +01:00
Ewoud
0092e49eb3 GFX/Preview done right if > 4096 pixels + unlimited virtual pixels in 2d 2023-10-24 16:58:35 +02:00
Frank
9a3a97eff1 pre-merge
cleanup:
- version increase
- clean up debug messages
- minor fixes in platformio.ini
- fix compilation with -D WLED_DISABLE_2D

helping the compiler to optimize:
- a few more __attribute__((pure))
- fx.cpp marked a few local functions as "static"
2023-07-13 19:58:48 +02:00
Frank
3295579e05 jsonToPixels robustness
avoid string overflow when constructing filename
2023-07-13 18:36:11 +02:00