Unverified Commit 0fdd2518 authored by Bodmer's avatar Bodmer Committed by GitHub

Fix #289

A 16 bit color image can now be plotted into an 8 bit Sprite.
parent 8cf85c89
......@@ -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++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment