Correct jpeg decoder image edge rendering
Revert setup file and add setup 10
This commit is contained in:
1 parent
f907ac31b7
commit
0bcf7eaa6b
4 files changed
+6
-25
No files matched your search
@@ -130,32 +130,12 @@ void renderJPEG(int xpos, int ypos) {
|
||||
int mcu_x = JpegDec.MCUx * mcu_w + xpos; // Calculate coordinates of top left corner of current MCU
|
||||
int mcu_y = JpegDec.MCUy * mcu_h + ypos;
|
||||
|
||||
|
||||
// check if the image block size needs to be changed for the right edge
|
||||
// check if the image block size needs to be changed for the right and bottom edges
|
||||
if (mcu_x + mcu_w <= max_x) win_w = mcu_w;
|
||||
else win_w = min_w;
|
||||
|
||||
// check if the image block size needs to be changed for the bottom edge
|
||||
if (mcu_y + mcu_h <= max_y) win_h = mcu_h;
|
||||
else win_h = min_h;
|
||||
|
||||
// copy pixels into a contiguous block
|
||||
if (win_w != mcu_w)
|
||||
{
|
||||
uint16_t *cImg;
|
||||
int p = 0;
|
||||
cImg = pImg + win_w;
|
||||
for (int h = 1; h < win_h; h++)
|
||||
{
|
||||
p += mcu_w;
|
||||
for (int w = 0; w < win_w; w++)
|
||||
{
|
||||
*cImg = *(pImg + w + p);
|
||||
cImg++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// draw image MCU block only if it will fit on the screen
|
||||
if (( mcu_x + win_w ) <= tft.width() && ( mcu_y + win_h ) <= tft.height())
|
||||
{
|
||||
|
||||
@@ -23,9 +23,6 @@ TFT_eSPI tft = TFT_eSPI();
|
||||
// JPEG decoder library
|
||||
#include <JPEGDecoder.h>
|
||||
|
||||
// Chip Select Pin for SD card
|
||||
#define SD_CS 53
|
||||
|
||||
// Return the minimum of two values a and b
|
||||
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
|
||||
Reference in new issue
Block a user