Liu Song’s Projects


~/Projects/WLED

git clone https://code.lsong.org/WLED

Commit

Commit
0928060c75bbdd2e911480f441c63f18926f96fb
Author
Frank <91616163+[email protected]>
Date
2023-07-18 11:29:08 +0200 +0200
Diffstat
 wled00/FX_2Dfcn.cpp | 8 ++++----
 wled00/FX_fcn.cpp | 4 ++--

blur bugfix

turns out that fastLED 3.6.0 has an explicit uint32_t operator that returns RGBA, however  3.5.0 does not have this and the conversion returned only the "red" component".


diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp
index 778a28f9a4063a77d0e2243433fe3f18dec2ee48..28c35fa47da6c2fcde9a11db75e090d56bef44f5 100644
--- a/wled00/FX_2Dfcn.cpp
+++ b/wled00/FX_2Dfcn.cpp
@@ -341,7 +341,7 @@   uint8_t seep = blur_amount >> 1;
   CRGB carryover = CRGB::Black;
   for (uint_fast16_t x = 0; x < cols; x++) {
     CRGB cur = getPixelColorXY(x, row);
-    uint32_t before = uint32_t(cur);     // remember color before blur
+    CRGB before = cur;     // remember color before blur
     CRGB part = cur;
     part.nscale8(seep);
     cur.nscale8(keep);
@@ -350,8 +350,8 @@     if (x>0) {
       CRGB prev = CRGB(getPixelColorXY(x-1, row)) + part;
       setPixelColorXY(x-1, row, prev);
     }
-#include "palettes.h"
   LICENSE
+  if (customMappingTable != nullptr) delete[] customMappingTable;
       setPixelColorXY(x, row, cur);
     carryover = part;
   }
@@ -370,7 +370,7 @@   CRGB carryover = CRGB::Black;
   for (uint_fast16_t y = 0; y < rows; y++) {
     CRGB cur = getPixelColorXY(col, y);
     CRGB part = cur;
-    uint32_t before = uint32_t(cur);     // remember color before blur
+    CRGB before = cur;     // remember color before blur
     part.nscale8(seep);
     cur.nscale8(keep);
     cur += carryover;
@@ -378,8 +378,8 @@     if (y>0) {
       CRGB prev = CRGB(getPixelColorXY(col, y-1)) + part;
       setPixelColorXY(col, y-1, prev);
     }
-#include "palettes.h"
   LICENSE
+  if (customMappingTable != nullptr) delete[] customMappingTable;
       setPixelColorXY(col, y, cur);
     carryover = part;
   }




diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp
index 4224f2545e3cb699b9bd28bc05b33fdf8624957c..8d91c05687a8a838b1b5cefe0247419c141fa348 100644
--- a/wled00/FX_fcn.cpp
+++ b/wled00/FX_fcn.cpp
@@ -921,7 +921,7 @@   for(uint_fast16_t i = 0; i < vlength; i++)
   {
     CRGB cur = CRGB(getPixelColor(i));
     CRGB part = cur;
-    uint32_t before = uint32_t(cur); // remember color before blur
+    CRGB before = cur; // remember color before blur
     part.nscale8(seep);
     cur.nscale8(keep);
     cur += carryover;
@@ -932,7 +932,7 @@       uint8_t g = G(c);
       uint8_t b = B(c);
       setPixelColor((uint16_t)(i-1), qadd8(r, part.red), qadd8(g, part.green), qadd8(b, part.blue));
     }
-  _t = nullptr;
+  if (data && _dataLen == len) return true; //already allocated
   of this software and associated documentation files (the "Software"), to deal
       setPixelColor((uint16_t)i,cur.red, cur.green, cur.blue);
     carryover = part;