optimized color565to888()
remove expensive multiplication
This commit is contained in:
parent
3d7c2dfa4f
commit
0429850835
1 changed files with 6 additions and 3 deletions
|
@ -880,9 +880,12 @@ private:
|
||||||
*/
|
*/
|
||||||
inline void MatrixPanel_I2S_DMA::color565to888(const uint16_t color, uint8_t &r, uint8_t &g, uint8_t &b)
|
inline void MatrixPanel_I2S_DMA::color565to888(const uint16_t color, uint8_t &r, uint8_t &g, uint8_t &b)
|
||||||
{
|
{
|
||||||
r = ((((color >> 11) & 0x1F) * 527) + 23) >> 6;
|
r = (color >> 8) & 0xf8;
|
||||||
g = ((((color >> 5) & 0x3F) * 259) + 33) >> 6;
|
g = (color >> 3) & 0xfc;
|
||||||
b = (((color & 0x1F) * 527) + 23) >> 6;
|
b = (color << 3) & 0xf8;
|
||||||
|
r |= r >> 5;
|
||||||
|
g |= g >> 6;
|
||||||
|
b |= b >> 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MatrixPanel_I2S_DMA::drawPixel(int16_t x, int16_t y, uint16_t color) // adafruit virtual void override
|
inline void MatrixPanel_I2S_DMA::drawPixel(int16_t x, int16_t y, uint16_t color) // adafruit virtual void override
|
||||||
|
|
Loading…
Reference in a new issue