| 2827 | } |
| 2828 | |
| 2829 | void 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 | |
| 2851 | void rotateBuffer(uint8_t rotation, uint8_t ¤tOrientation, 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) |
no test coverage detected