MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / drawJsonStream

Function drawJsonStream

ESP32_AP-Flasher/src/contentmanager.cpp:2829–2849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2827}
2828
2829void drawJsonStream(Stream &stream, String &filename, tagRecord *&taginfo, imgParam &imageParams) {
2830 TFT_eSprite spr = TFT_eSprite(&tft);
2831 initSprite(spr, imageParams.width, imageParams.height, imageParams);
2832 uint8_t screenCurrentOrientation = 0;
2833 JsonDocument doc;
2834 if (stream.find("[")) {
2835 do {
2836 DeserializationError error = deserializeJson(doc, stream);
2837 if (error) {
2838 wsErr("json error " + String(error.c_str()));
2839 break;
2840 } else {
2841 drawElement(doc.as<JsonObject>(), spr, imageParams, screenCurrentOrientation);
2842 doc.clear();
2843 }
2844 } while (stream.findUntil(",", "]"));
2845 }
2846
2847 spr2buffer(spr, filename, imageParams);
2848 spr.deleteSprite();
2849}
2850
2851void rotateBuffer(uint8_t rotation, uint8_t &currentOrientation, TFT_eSprite &spr, imgParam &imageParams) {
2852 rotation = rotation % 4; // First of all, let's be sure that the rotation have a valid value (0, 1, 2 or 3)

Callers 3

getJsonTemplateFileFunction · 0.85
getJsonTemplateUrlFunction · 0.85

Calls 5

initSpriteFunction · 0.85
wsErrFunction · 0.85
drawElementFunction · 0.85
spr2bufferFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected