diff --git a/examples/PNG Images/Flash_PNG/Flash_PNG.ino b/examples/PNG Images/Flash_PNG/Flash_PNG.ino index 6fcbadb..ca05753 100644 --- a/examples/PNG Images/Flash_PNG/Flash_PNG.ino +++ b/examples/PNG Images/Flash_PNG/Flash_PNG.ino @@ -18,7 +18,7 @@ PNG png; // PNG decoder inatance -#define MAX_IMAGE_WDITH 240 // Adjust for your images +#define MAX_IMAGE_WIDTH 240 // Adjust for your images int16_t xpos = 0; int16_t ypos = 0; @@ -50,7 +50,7 @@ void loop() { int16_t rc = png.openFLASH((uint8_t *)panda, sizeof(panda), pngDraw); if (rc == PNG_SUCCESS) { - Serial.println("Successfully png file"); + Serial.println("Successfully opened png file"); Serial.printf("image specs: (%d x %d), %d bpp, pixel type: %d\n", png.getWidth(), png.getHeight(), png.getBpp(), png.getPixelType()); tft.startWrite(); uint32_t dt = millis(); @@ -72,7 +72,7 @@ void loop() // you will need to adapt this function to suit. // Callback function to draw pixels to the display void pngDraw(PNGDRAW *pDraw) { - uint16_t lineBuffer[MAX_IMAGE_WDITH]; + uint16_t lineBuffer[MAX_IMAGE_WIDTH]; png.getLineAsRGB565(pDraw, lineBuffer, PNG_RGB565_BIG_ENDIAN, 0xffffffff); tft.pushImage(xpos, ypos + pDraw->y, pDraw->iWidth, 1, lineBuffer); } diff --git a/examples/PNG Images/Flash_transparent_PNG/Flash_transparent_PNG.ino b/examples/PNG Images/Flash_transparent_PNG/Flash_transparent_PNG.ino index 045a7c3..39e09a6 100644 --- a/examples/PNG Images/Flash_transparent_PNG/Flash_transparent_PNG.ino +++ b/examples/PNG Images/Flash_transparent_PNG/Flash_transparent_PNG.ino @@ -24,7 +24,7 @@ PNG png; // PNG decoder instance -#define MAX_IMAGE_WDITH 240 // Sets rendering line buffer lengths, adjust for your images +#define MAX_IMAGE_WIDTH 240 // Sets rendering line buffer lengths, adjust for your images // Include the TFT library - see https://github.com/Bodmer/TFT_eSPI for library information #include "SPI.h" @@ -60,7 +60,7 @@ void loop() int16_t rc = png.openFLASH((uint8_t *)bob, sizeof(bob), pngDraw); if (rc == PNG_SUCCESS) { - Serial.println("Successfully png file"); + Serial.println("Successfully opened png file"); pngw = png.getWidth(); pngh = png.getHeight(); Serial.printf("Image metrics: (%d x %d), %d bpp, pixel type: %d\n", pngw, pngh, png.getBpp(), png.getPixelType()); diff --git a/examples/PNG Images/Flash_transparent_PNG/png_support.ino b/examples/PNG Images/Flash_transparent_PNG/png_support.ino index 1c90042..c77efe6 100644 --- a/examples/PNG Images/Flash_transparent_PNG/png_support.ino +++ b/examples/PNG Images/Flash_transparent_PNG/png_support.ino @@ -7,8 +7,8 @@ // This function will be called during decoding of the png file to render each image // line to the TFT. PNGdec generates the image line and a 1bpp mask. void pngDraw(PNGDRAW *pDraw) { - uint16_t lineBuffer[MAX_IMAGE_WDITH]; // Line buffer for rendering - uint8_t maskBuffer[1 + MAX_IMAGE_WDITH / 8]; // Mask buffer + uint16_t lineBuffer[MAX_IMAGE_WIDTH]; // Line buffer for rendering + uint8_t maskBuffer[1 + MAX_IMAGE_WIDTH / 8]; // Mask buffer png.getLineAsRGB565(pDraw, lineBuffer, PNG_RGB565_BIG_ENDIAN, 0xffffffff); diff --git a/examples/PNG Images/LittleFS_PNG/LittleFS_PNG.ino b/examples/PNG Images/LittleFS_PNG/LittleFS_PNG.ino index 1ffb3ca..9af73b8 100644 --- a/examples/PNG Images/LittleFS_PNG/LittleFS_PNG.ino +++ b/examples/PNG Images/LittleFS_PNG/LittleFS_PNG.ino @@ -17,7 +17,7 @@ #include PNG png; -#define MAX_IMAGE_WDITH 240 // Adjust for your images +#define MAX_IMAGE_WIDTH 240 // Adjust for your images int16_t xpos = 0; int16_t ypos = 0; @@ -67,7 +67,7 @@ void loop() tft.startWrite(); Serial.printf("image specs: (%d x %d), %d bpp, pixel type: %d\n", png.getWidth(), png.getHeight(), png.getBpp(), png.getPixelType()); uint32_t dt = millis(); - if (png.getWidth() > MAX_IMAGE_WDITH) { + if (png.getWidth() > MAX_IMAGE_WIDTH) { Serial.println("Image too wide for allocated line buffer size!"); } else { @@ -93,7 +93,7 @@ void loop() // you will need to adapt this function to suit. // Callback function to draw pixels to the display void pngDraw(PNGDRAW *pDraw) { - uint16_t lineBuffer[MAX_IMAGE_WDITH]; + uint16_t lineBuffer[MAX_IMAGE_WIDTH]; png.getLineAsRGB565(pDraw, lineBuffer, PNG_RGB565_BIG_ENDIAN, 0xffffffff); tft.pushImage(xpos, ypos + pDraw->y, pDraw->iWidth, 1, lineBuffer); } diff --git a/examples/PNG Images/LittleFS_PNG_DMA/LittleFS_PNG_DMA.ino b/examples/PNG Images/LittleFS_PNG_DMA/LittleFS_PNG_DMA.ino index 1ad440d..5f751c1 100644 --- a/examples/PNG Images/LittleFS_PNG_DMA/LittleFS_PNG_DMA.ino +++ b/examples/PNG Images/LittleFS_PNG_DMA/LittleFS_PNG_DMA.ino @@ -22,7 +22,7 @@ #include PNG png; -#define MAX_IMAGE_WDITH 240 // Adjust for your images +#define MAX_IMAGE_WIDTH 240 // Adjust for your images int16_t xpos = 0; int16_t ypos = 0; @@ -73,7 +73,7 @@ void loop() tft.startWrite(); Serial.printf("image specs: (%d x %d), %d bpp, pixel type: %d\n", png.getWidth(), png.getHeight(), png.getBpp(), png.getPixelType()); uint32_t dt = millis(); - if (png.getWidth() > MAX_IMAGE_WDITH) { + if (png.getWidth() > MAX_IMAGE_WIDTH) { Serial.println("Image too wide for allocated lin buffer!"); } else { @@ -99,8 +99,8 @@ void loop() // you will need to adapt this function to suit. // Callback function to draw pixels to the display void pngDraw(PNGDRAW *pDraw) { - uint16_t lineBuffer[MAX_IMAGE_WDITH]; - static uint16_t dmaBuffer[MAX_IMAGE_WDITH]; // static so buffer persists after fn exit + uint16_t lineBuffer[MAX_IMAGE_WIDTH]; + static uint16_t dmaBuffer[MAX_IMAGE_WIDTH]; // static so buffer persists after fn exit png.getLineAsRGB565(pDraw, lineBuffer, PNG_RGB565_BIG_ENDIAN, 0xffffffff); tft.pushImageDMA(xpos, ypos + pDraw->y, pDraw->iWidth, 1, lineBuffer, dmaBuffer);