.pio/libdeps/m5stack-core2/M5Core2/src/utility/Sprite.cpp
void TFT_eSprite::drawPixel(int32_t x, int32_t y, uint32_t color)
{
  // Range checking
  if ((x < 0) || (y < 0) || !_created) return;
  if ((x >= _iwidth) || (y >= _iheight)) return;

  if (_bpp == 16)
  {
    color = (color >> 8) | (color << 8);
    _img[x+y*_iwidth] = (uint16_t) color;
  }
  else if (_bpp == 8)
  {
    _img8[x+y*_iwidth] = (uint8_t)((color & 0xE000)>>8 | (color & 0x0700)>>6 | (color & 0x0018)>>3);
  }
  else // 1 bpp
  {
    if (_rotation == 1)
    {
      uint16_t tx = x;
      x = _dwidth - y - 1;
      y = tx;
    }
    else if (_rotation == 2)
    {
      x = _dwidth - x - 1;
      y = _dheight - y - 1;
    }
    else if (_rotation == 3)
    {
      uint16_t tx = x;
      x = y;
      y = _dheight - tx - 1;
    }

    if (color) _img8[(x + y * _bitwidth)>>3] |=  (0x80 >> (x & 0x7));
    else       _img8[(x + y * _bitwidth)>>3] &= ~(0x80 >> (x & 0x7));
  }
}
/***************************************************************************************
** Function name:           drawPixel
** Description:             push a single pixel at an arbitrary position
*************************************************************************************x*/
Function name:           drawPixel
Description:             push a single pixel at an arbitrary position
x
Function name : drawPixel Description : push a single pixel at an arbitrary position x
void TFT_eSprite::drawPixel(int32_t x, int32_t y, uint32_t color)
{
  if ((x < 0) || (y < 0) || !_created) return;
  if ((x >= _iwidth) || (y >= _iheight)) return;
  if (_bpp == 16)
  {
    color = (color >> 8) | (color << 8);
    _img[x+y*_iwidth] = (uint16_t) color;
  }
  else if (_bpp == 8)
  {
    _img8[x+y*_iwidth] = (uint8_t)((color & 0xE000)>>8 | (color & 0x0700)>>6 | (color & 0x0018)>>3);
  }
  else 
  {
    if (_rotation == 1)
    {
      uint16_t tx = x;
      x = _dwidth - y - 1;
      y = tx;
    }
    else if (_rotation == 2)
    {
      x = _dwidth - x - 1;
      y = _dheight - y - 1;
    }
    else if (_rotation == 3)
    {
      uint16_t tx = x;
      x = y;
      y = _dheight - tx - 1;
    }
    if (color) _img8[(x + y * _bitwidth)>>3] |=  (0x80 >> (x & 0x7));
    else       _img8[(x + y * _bitwidth)>>3] &= ~(0x80 >> (x & 0x7));
  }
}
void TFT_eSprite :: drawPixel ( int32_t x , int32_t y , uint32_t color ) { if ( ( x < 0 ) || ( y < 0 ) || ! _created ) return ; if ( ( x >= _iwidth ) || ( y >= _iheight ) ) return ; if ( _bpp == 16 ) { color = ( color >> 8 ) | ( color << 8 ) ; _img [ x + y * _iwidth ] = ( uint16_t ) color ; } else if ( _bpp == 8 ) { _img8 [ x + y * _iwidth ] = ( uint8_t ) ( ( color & 0xE000 ) >> 8 | ( color & 0x0700 ) >> 6 | ( color & 0x0018 ) >> 3 ) ; } else { if ( _rotation == 1 ) { uint16_t tx = x ; x = _dwidth - y - 1 ; y = tx ; } else if ( _rotation == 2 ) { x = _dwidth - x - 1 ; y = _dheight - y - 1 ; } else if ( _rotation == 3 ) { uint16_t tx = x ; x = y ; y = _dheight - tx - 1 ; } if ( color ) _img8 [ ( x + y * _bitwidth ) >> 3 ] |= ( 0x80 >> ( x & 0x7 ) ) ; else _img8 [ ( x + y * _bitwidth ) >> 3 ] &= ~ ( 0x80 >> ( x & 0x7 ) ) ; } }
Function name:           drawPixel
Description:             push a single pixel at an arbitrary position
x
Function name : drawPixel Description : push a single pixel at an arbitrary position x
// Range checking // 1 bpp