| 1779 | int16_t xpos = 0; |
| 1780 | int16_t ypos = 0; |
| 1781 | int PNGDraw(PNGDRAW *pDraw) { |
| 1782 | uint16_t usPixels[MAX_IMAGE_WIDTH]; |
| 1783 | // static uint16_t dmaBuffer[MAX_IMAGE_WIDTH]; // static so buffer persists after fn exit |
| 1784 | uint8_t r = ((uint16_t)bruceConfig.bgColor & 0xF800) >> 8; |
| 1785 | uint8_t g = ((uint16_t)bruceConfig.bgColor & 0x07E0) >> 3; |
| 1786 | uint8_t b = ((uint16_t)bruceConfig.bgColor & 0x001F) << 3; |
| 1787 | png->getLineAsRGB565(pDraw, usPixels, PNG_RGB565_BIG_ENDIAN, b << 16 | g << 8 | r); |
| 1788 | if (!pngCacheOnly) { |
| 1789 | tft.drawPixel(0, 0, 0); |
| 1790 | tft.drawPixel(0, 0, 0); |
| 1791 | tft.pushImage(xpos, ypos + pDraw->y, pDraw->iWidth, 1, usPixels); |
| 1792 | } |
| 1793 | if (pngBinOut) { pngBinOut->write((uint8_t *)usPixels, pDraw->iWidth * sizeof(uint16_t)); } |
| 1794 | return 1; |
| 1795 | } |
| 1796 | |
| 1797 | // Build a cache path alongside the PNG: <dir>/tmp/<basename>.bin |
| 1798 | static String buildPngBinPath(const String &pngPath) { |