You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uint8_t x = SEGENV.aux0%width, y = SEGENV.aux0/width; // 2D coordinates stored in upper and lower byte
1232
-
uint32_t sv1 = 0, sv2 = 0;
1233
-
if (valid1) sv1 = SEGMENT.is2D() ? SEGMENT.getPixelColorXY(x, y) : SEGMENT.getPixelColor(SEGENV.aux0); // get spark color
1234
-
if (valid2) sv2 = SEGMENT.is2D() ? SEGMENT.getPixelColorXY(x, y) : SEGMENT.getPixelColor(SEGENV.aux1);
1235
-
if (!SEGENV.step) SEGMENT.blur(16);
1236
-
if (valid1) { if (SEGMENT.is2D()) SEGMENT.setPixelColorXY(x, y, sv1); else SEGMENT.setPixelColor(SEGENV.aux0, sv1); } // restore spark color after blur
1237
-
if (valid2) { if (SEGMENT.is2D()) SEGMENT.setPixelColorXY(x, y, sv2); else SEGMENT.setPixelColor(SEGENV.aux1, sv2); } // restore old spark color after blur
1230
+
if (!SEGENV.step) {
1231
+
// fireworks mode (blur flares)
1232
+
bool valid1 = (SEGENV.aux0 < width*height);
1233
+
bool valid2 = (SEGENV.aux1 < width*height);
1234
+
uint32_t sv1 = 0, sv2 = 0;
1235
+
if (valid1) sv1 = SEGMENT.is2D() ? SEGMENT.getPixelColorXY(x, y) : SEGMENT.getPixelColor(SEGENV.aux0); // get spark color
1236
+
if (valid2) sv2 = SEGMENT.is2D() ? SEGMENT.getPixelColorXY(x, y) : SEGMENT.getPixelColor(SEGENV.aux1);
1237
+
SEGMENT.blur(16); // used in mode_rain()
1238
+
if (valid1) { if (SEGMENT.is2D()) SEGMENT.setPixelColorXY(x, y, sv1); else SEGMENT.setPixelColor(SEGENV.aux0, sv1); } // restore spark color after blur
1239
+
if (valid2) { if (SEGMENT.is2D()) SEGMENT.setPixelColorXY(x, y, sv2); else SEGMENT.setPixelColor(SEGENV.aux1, sv2); } // restore old spark color after blur
1240
+
}
1238
1241
1239
1242
for (int i=0; i<max(1, width/20); i++) {
1240
1243
if (random8(129 - (SEGMENT.intensity >> 1)) == 0) {
@@ -1261,7 +1264,7 @@ uint16_t mode_rain() {
1261
1264
SEGENV.step += FRAMETIME;
1262
1265
if (SEGENV.call && SEGENV.step > SPEED_FORMULA_L) {
if (SEGMENT.check3) SEGMENT.blur(16, cols*rows <100);
4894
4897
4895
4898
return FRAMETIME;
4896
4899
} // mode_2DBlackHole()
4897
-
staticconstchar _data_FX_MODE_2DBLACKHOLE[] PROGMEM = "Black Hole@Fade rate,Outer Y freq.,Outer X freq.,Inner X freq.,Inner Y freq.,Solid;!;!;2;pal=11";
4900
+
staticconstchar _data_FX_MODE_2DBLACKHOLE[] PROGMEM = "Black Hole@Fade rate,Outer Y freq.,Outer X freq.,Inner X freq.,Inner Y freq.,Solid,,Blur;!;!;2;pal=11";
inlineuint8_tgetTargetFps() const { return _targetFps; } // returns rough FPS value for las 2s interval
831
+
inlineuint8_tgetModeCount() const { return _modeCount; } // returns number of registered modes/effects
831
832
832
833
uint16_t
833
-
getLengthPhysical(void),
834
-
getLengthTotal(void), // will include virtual/nonexistent pixels in matrix
835
-
getFps(),
836
-
getMappedPixelIndex(uint16_t index);
834
+
getLengthPhysical(void)const,
835
+
getLengthTotal(void)const, // will include virtual/nonexistent pixels in matrix
836
+
getFps()const,
837
+
getMappedPixelIndex(uint16_t index)const;
837
838
838
-
inlineuint16_tgetFrameTime(void) { return _frametime; } // returns amount of time a frame should take (in ms)
839
-
inlineuint16_tgetMinShowDelay(void) { return MIN_SHOW_DELAY; } // returns minimum amount of time strip.service() can be delayed (constant)
840
-
inlineuint16_tgetLength(void) { return _length; } // returns actual amount of LEDs on a strip (2D matrix may have less LEDs than W*H)
841
-
inlineuint16_tgetTransition(void) { return _transitionDur; } // returns currently set transition time (in ms)
839
+
inlineuint16_tgetFrameTime(void) const { return _frametime; } // returns amount of time a frame should take (in ms)
840
+
inlineuint16_tgetMinShowDelay(void) const{ return MIN_SHOW_DELAY; } // returns minimum amount of time strip.service() can be delayed (constant)
841
+
inlineuint16_tgetLength(void) const { return _length; } // returns actual amount of LEDs on a strip (2D matrix may have less LEDs than W*H)
842
+
inlineuint16_tgetTransition(void) const { return _transitionDur; } // returns currently set transition time (in ms)
842
843
843
844
uint32_t
844
845
now,
845
846
timebase,
846
-
getPixelColor(uint16_t);
847
+
getPixelColor(uint16_t)const;
847
848
848
-
inlineuint32_tgetLastShow(void) { return _lastShow; } // returns millis() timestamp of last strip.show() call
849
-
inlineuint32_tsegColor(uint8_t i) { return_colors_t[i]; } // returns currently valid color (for slot i) AKA SEGCOLOR(); may be blended between two colors while in transition
849
+
inlineuint32_tgetLastShow(void) const { return _lastShow; } // returns millis() timestamp of last strip.show() call
850
+
inlineuint32_tsegColor(uint8_t i) const{ return_colors_t[i]; } // returns currently valid color (for slot i) AKA SEGCOLOR(); may be blended between two colors while in transition
850
851
851
852
constchar *
852
-
getModeData(uint8_t id = 0) { return (id && id<_modeCount) ? _modeData[id] : PSTR("Solid"); }
853
+
getModeData(uint8_t id = 0) const{ return (id && id<_modeCount) ? _modeData[id] : PSTR("Solid"); }
853
854
854
855
constchar **
855
856
getModeDataSrc(void) { return &(_modeData[0]); } // vectors use arrays for underlying data
@@ -900,7 +901,7 @@ class WS2812FX { // 96 bytes
900
901
inlinevoidsetPixelColorXY(int x, int y, byte r, byte g, byte b, byte w = 0) { setPixelColorXY(x, y, RGBW32(r,g,b,w)); }
901
902
inlinevoidsetPixelColorXY(int x, int y, CRGB c) { setPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0)); }
902
903
903
-
inlineuint32_tgetPixelColorXY(uint16_t x, uint16_t y) { returngetPixelColor(isMatrix ? y * Segment::maxWidth + x : x);}
904
+
inlineuint32_tgetPixelColorXY(int x, int y) const{ returngetPixelColor(isMatrix ? y * Segment::maxWidth + x : x);}
0 commit comments