Bugfix.
- fadePixelColorXY() - clearing 2D segment on mirror or reverse change - FX update (DNA Spiral, Colored bursts)
This commit is contained in:
parent
8dc262b415
commit
e410de9552
@ -4647,14 +4647,14 @@ uint16_t mode_2DColoredBursts() { // By: ldirko https://editor.so
|
|||||||
uint8_t rate = i * 255 / steps;
|
uint8_t rate = i * 255 / steps;
|
||||||
byte dx = lerp8by8(x1, y1, rate);
|
byte dx = lerp8by8(x1, y1, rate);
|
||||||
byte dy = lerp8by8(x2, y2, rate);
|
byte dy = lerp8by8(x2, y2, rate);
|
||||||
SEGMENT.setPixelColorXY(dx, dy, grad ? color.nscale8_video(255-rate) : color); // use addPixelColorXY for different look
|
//SEGMENT.setPixelColorXY(dx, dy, grad ? color.nscale8_video(255-rate) : color); // use addPixelColorXY for different look
|
||||||
//SEGMENT.addPixelColorXY(dx, dy, color); // use setPixelColorXY for different look
|
SEGMENT.addPixelColorXY(dx, dy, color); // use setPixelColorXY for different look
|
||||||
//if (grad) SEGMENT.fadePixelColorXY(dx, dy, rate);
|
if (grad) SEGMENT.fadePixelColorXY(dx, dy, rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dot) { //add white point at the ends of line
|
if (dot) { //add white point at the ends of line
|
||||||
SEGMENT.addPixelColorXY(x1, x2, WHITE);
|
SEGMENT.setPixelColorXY(x1, x2, WHITE);
|
||||||
SEGMENT.addPixelColorXY(y1, y2, WHITE);
|
SEGMENT.setPixelColorXY(y1, y2, DARKSLATEGRAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SEGMENT.custom3) SEGMENT.blur(SEGMENT.custom3/2);
|
if (SEGMENT.custom3) SEGMENT.blur(SEGMENT.custom3/2);
|
||||||
@ -4723,7 +4723,9 @@ uint16_t mode_2DDNASpiral() { // By: ldirko https://editor.soulma
|
|||||||
for (size_t k = 1; k <= steps; k++) {
|
for (size_t k = 1; k <= steps; k++) {
|
||||||
uint8_t rate = k * 255 / steps;
|
uint8_t rate = k * 255 / steps;
|
||||||
uint8_t dx = lerp8by8(x, x1, rate);
|
uint8_t dx = lerp8by8(x, x1, rate);
|
||||||
SEGMENT.setPixelColorXY(dx, i, ColorFromPalette(SEGPALETTE, hue, 255, LINEARBLEND).nscale8_video(rate));
|
//SEGMENT.setPixelColorXY(dx, i, ColorFromPalette(SEGPALETTE, hue, 255, LINEARBLEND).nscale8_video(rate));
|
||||||
|
SEGMENT.addPixelColorXY(dx, i, ColorFromPalette(SEGPALETTE, hue, 255, LINEARBLEND)); // use setPixelColorXY for different look
|
||||||
|
SEGMENT.fadePixelColorXY(dx, i, rate);
|
||||||
}
|
}
|
||||||
SEGMENT.setPixelColorXY(x, i, DARKSLATEGRAY);
|
SEGMENT.setPixelColorXY(x, i, DARKSLATEGRAY);
|
||||||
SEGMENT.setPixelColorXY(x1, i, WHITE);
|
SEGMENT.setPixelColorXY(x1, i, WHITE);
|
||||||
|
@ -272,7 +272,7 @@ void Segment::addPixelColorXY(int x, int y, uint32_t color) {
|
|||||||
|
|
||||||
void Segment::fadePixelColorXY(uint16_t x, uint16_t y, uint8_t fade) {
|
void Segment::fadePixelColorXY(uint16_t x, uint16_t y, uint8_t fade) {
|
||||||
CRGB pix = CRGB(getPixelColorXY(x,y)).nscale8_video(fade);
|
CRGB pix = CRGB(getPixelColorXY(x,y)).nscale8_video(fade);
|
||||||
setPixelColor(x, y, pix);
|
setPixelColorXY(x, y, pix);
|
||||||
}
|
}
|
||||||
|
|
||||||
// blurRow: perform a blur on a row of a rectangular matrix
|
// blurRow: perform a blur on a row of a rectangular matrix
|
||||||
|
@ -574,7 +574,7 @@ void IRAM_ATTR Segment::setPixelColor(int i, uint32_t col)
|
|||||||
int y = roundf(cos_t(rad) * i);
|
int y = roundf(cos_t(rad) * i);
|
||||||
setPixelColorXY(x, y, col);
|
setPixelColorXY(x, y, col);
|
||||||
}
|
}
|
||||||
// Bresenham’s Algorithm
|
// Bresenham’s Algorithm (may not fill every pixel)
|
||||||
//int d = 3 - (2*i);
|
//int d = 3 - (2*i);
|
||||||
//int y = i, x = 0;
|
//int y = i, x = 0;
|
||||||
//while (y >= x) {
|
//while (y >= x) {
|
||||||
|
@ -170,13 +170,20 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WLED_DISABLE_2D
|
||||||
|
bool reverse = seg.reverse;
|
||||||
|
bool mirror = seg.mirror;
|
||||||
|
#endif
|
||||||
seg.selected = elem["sel"] | seg.selected;
|
seg.selected = elem["sel"] | seg.selected;
|
||||||
seg.reverse = elem["rev"] | seg.reverse;
|
seg.reverse = elem["rev"] | seg.reverse;
|
||||||
seg.mirror = elem["mi"] | seg.mirror;
|
seg.mirror = elem["mi"] | seg.mirror;
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
seg.reverse_y = elem["rY"] | seg.reverse_y;
|
bool reverse_y = seg.reverse_y;
|
||||||
seg.mirror_y = elem["mY"] | seg.mirror_y;
|
bool mirror_y = seg.mirror_y;
|
||||||
seg.transpose = elem[F("tp")] | seg.transpose;
|
seg.reverse_y = elem["rY"] | seg.reverse_y;
|
||||||
|
seg.mirror_y = elem["mY"] | seg.mirror_y;
|
||||||
|
seg.transpose = elem[F("tp")] | seg.transpose;
|
||||||
|
if (seg.is2D() && seg.map1D2D == M12_pArc && (reverse != seg.reverse || reverse_y != seg.reverse_y || mirror != seg.mirror || mirror_y != seg.mirror_y)) seg.fill(BLACK); // clear entire segment (in case of Arc 1D to 2D expansion)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
byte fx = seg.mode;
|
byte fx = seg.mode;
|
||||||
|
Loading…
Reference in New Issue
Block a user