ws sendLiveLedsWs: no skiplines to show large matrices uncompressed
This commit is contained in:
@@ -567,8 +567,6 @@ bool Segment::jsonToPixels(char * name, uint8_t fileNr) {
|
||||
|
||||
if (!requestJSONBufferLock(23)) return false;
|
||||
|
||||
USER_PRINTF("file %s %d", fileName, isFile);
|
||||
|
||||
if (!readObjectFromFile(fileName, nullptr, &doc)) {
|
||||
releaseJSONBufferLock();
|
||||
return false; //if file does not exist just exit
|
||||
@@ -576,12 +574,9 @@ bool Segment::jsonToPixels(char * name, uint8_t fileNr) {
|
||||
|
||||
JsonArray map = doc[F("seg")][F("i")];
|
||||
|
||||
// serializeJson(map, Serial);
|
||||
|
||||
if (!map.isNull() && map.size()) { // not an empty map
|
||||
|
||||
for (uint16_t i=0; i<map.size(); i+=3) {
|
||||
// USER_PRINTF("%s %s %s", map[i].as<String>().c_str(), map[i+1].as<String>().c_str(), map[i+2].as<String>().c_str());
|
||||
CRGB color = CRGB(map[i+2][0], map[i+2][1], map[i+2][2]);
|
||||
for (uint16_t j=map[i]; j<=map[i+1]; j++) {
|
||||
setPixelColor(j, color);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
// version code in format yymmddb (b = daily build)
|
||||
#define VERSION 2304050
|
||||
#define VERSION 2304060
|
||||
|
||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||
//#define WLED_USE_MY_CONFIG
|
||||
|
||||
@@ -162,12 +162,12 @@ bool sendLiveLedsWs(uint32_t wsClient)
|
||||
#ifdef ESP8266
|
||||
const size_t MAX_LIVE_LEDS_WS = 256U;
|
||||
#else
|
||||
const size_t MAX_LIVE_LEDS_WS = 1024U; //WLEDMM use 4096 as max matrix size
|
||||
const size_t MAX_LIVE_LEDS_WS = 4096U; //WLEDMM use 4096 as max matrix size
|
||||
#endif
|
||||
size_t n = ((used -1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS
|
||||
size_t pos = (strip.isMatrix ? 4 : 2);
|
||||
size_t bufSize = pos + (used/n)*3;
|
||||
size_t skipLines = 0;
|
||||
//WLEDMM: no skipLines
|
||||
|
||||
AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(bufSize);
|
||||
if (!wsBuf) return false; //out of memory
|
||||
@@ -179,25 +179,13 @@ bool sendLiveLedsWs(uint32_t wsClient)
|
||||
buffer[1] = 2; //version
|
||||
buffer[2] = Segment::maxWidth;
|
||||
buffer[3] = Segment::maxHeight;
|
||||
if (Segment::maxWidth * Segment::maxHeight > MAX_LIVE_LEDS_WS*4) {
|
||||
buffer[2] = Segment::maxWidth/4;
|
||||
buffer[3] = Segment::maxHeight/4;
|
||||
skipLines = 3;
|
||||
} else if (Segment::maxWidth * Segment::maxHeight > MAX_LIVE_LEDS_WS) {
|
||||
buffer[2] = Segment::maxWidth/2;
|
||||
buffer[3] = Segment::maxHeight/2;
|
||||
skipLines = 1;
|
||||
}
|
||||
//WLEDMM: no skipLines
|
||||
}
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; pos < bufSize -2; i += n)
|
||||
{
|
||||
#ifndef WLED_DISABLE_2D
|
||||
if (strip.isMatrix && skipLines) {
|
||||
if ((i/Segment::maxWidth)%(skipLines+1)) i += Segment::maxWidth * skipLines;
|
||||
}
|
||||
#endif
|
||||
//WLEDMM: no skipLines
|
||||
uint32_t c = strip.getPixelColor(i);
|
||||
buffer[pos++] = qadd8(W(c), R(c)); //R, add white channel to RGB channels as a simple RGBW -> RGB map
|
||||
buffer[pos++] = qadd8(W(c), G(c)); //G
|
||||
|
||||
Reference in New Issue
Block a user