snapshot
This commit is contained in:
@@ -17,14 +17,13 @@ typedef struct myprivate
|
||||
bool bConvert;
|
||||
} PRIVATE;
|
||||
|
||||
int PNGDraw(PNGDRAW *pDraw)
|
||||
void PNGDraw(PNGDRAW *pDraw)
|
||||
{
|
||||
PRIVATE *pPriv = (PRIVATE *)pDraw->pUser;
|
||||
uint16_t usPixels[320];
|
||||
uint16_t usPixels[240];
|
||||
|
||||
if (pPriv->bConvert)
|
||||
png.getLineAsRGB565(pDraw, usPixels, PNG_RGB565_LITTLE_ENDIAN, 0xffffffff); // don't do alpha color blending
|
||||
return 1;
|
||||
} /* PNGDraw() */
|
||||
|
||||
void setup() {
|
||||
@@ -46,13 +45,9 @@ PRIVATE priv;
|
||||
priv.bConvert = false;
|
||||
lTime = micros();
|
||||
rc = png.decode((void *)&priv, PNG_FAST_PALETTE);
|
||||
if (rc == PNG_SUCCESS) {
|
||||
lTime = micros() - lTime;
|
||||
sprintf(szTemp, "Decode time for native pixels = %d us\n", (int)lTime);
|
||||
Serial.print(szTemp);
|
||||
} else {
|
||||
Serial.print("Decode error: "); Serial.println(rc, DEC);
|
||||
}
|
||||
lTime = micros() - lTime;
|
||||
sprintf(szTemp, "Decode time for native pixels = %d us\n", (int)lTime);
|
||||
Serial.print(szTemp);
|
||||
priv.bConvert = true;
|
||||
lTime = micros();
|
||||
rc = png.decode((void *)&priv, PNG_FAST_PALETTE);
|
||||
|
||||
Reference in New Issue
Block a user