MCPcopy Create free account
hub / github.com/BruceDevices/firmware / pushSprite

Method pushSprite

lib/TFT_eSPI/Extensions/Sprite.cpp:659–675  ·  view source on GitHub ↗

** Function name: pushSprite ** Description: Push the sprite to the TFT at x, y ***************************************************************************************/

Source from the content-addressed store, hash-verified

657** Description: Push the sprite to the TFT at x, y
658***************************************************************************************/
659void TFT_eSprite::pushSprite(int32_t x, int32_t y)
660{
661 if (!_created) return;
662
663 if (_bpp == 16)
664 {
665 bool oldSwapBytes = _tft->getSwapBytes();
666 _tft->setSwapBytes(false);
667 _tft->pushImage(x, y, _dwidth, _dheight, _img );
668 _tft->setSwapBytes(oldSwapBytes);
669 }
670 else if (_bpp == 4)
671 {
672 _tft->pushImage(x, y, _dwidth, _dheight, _img4, false, _colorMap);
673 }
674 else _tft->pushImage(x, y, _dwidth, _dheight, _img8, (bool)(_bpp == 8));
675}
676
677
678/***************************************************************************************

Callers

nothing calls this directly

Calls 6

startWriteMethod · 0.80
endWriteMethod · 0.80
getSwapBytesMethod · 0.45
setSwapBytesMethod · 0.45
pushImageMethod · 0.45
drawPixelMethod · 0.45

Tested by

no test coverage detected