A 16 bit color image can now be plotted into an 8 bit Sprite.
This commit is contained in:
Bodmer
2019-01-22 17:43:31 +00:00
committed by GitHub
parent 8cf85c89d3
commit 0fdd25186a

View File

@@ -587,6 +587,7 @@ void TFT_eSprite::pushImage(int32_t x, int32_t y, uint32_t w, uint32_t h, uint1
uint16_t color = data[xp + yp * w];
if(_iswapBytes) color = color<<8 | color>>8;
_img8[x + ys * _iwidth] = (uint8_t)((color & 0xE000)>>8 | (color & 0x0700)>>6 | (color & 0x0018)>>3);
x++;
}
ys++;
}
@@ -679,6 +680,7 @@ void TFT_eSprite::pushImage(int32_t x, int32_t y, uint32_t w, uint32_t h, const
uint16_t color = pgm_read_word(data + xp + yp * w);
if(_iswapBytes) color = color<<8 | color>>8;
_img8[x + ys * _iwidth] = (uint8_t)((color & 0xE000)>>8 | (color & 0x0700)>>6 | (color & 0x0018)>>3);
x++;
}
ys++;
}