Skip to content

Commit

Permalink
Add new anit-aliased graphics functions
Browse files Browse the repository at this point in the history
Examples to follow.
  • Loading branch information
Bodmer committed Feb 3, 2022
1 parent 97ca3fd commit b6db90a
Show file tree
Hide file tree
Showing 9 changed files with 408 additions and 56 deletions.
4 changes: 2 additions & 2 deletions Extensions/Sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ void TFT_eSprite::setWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1)
** Function name: pushColor
** Description: Send a new pixel to the set window
***************************************************************************************/
void TFT_eSprite::pushColor(uint32_t color)
void TFT_eSprite::pushColor(uint16_t color)
{
if (!_created ) return;

Expand Down Expand Up @@ -1334,7 +1334,7 @@ void TFT_eSprite::pushColor(uint32_t color)
** Function name: pushColor
** Description: Send a "len" new pixels to the set window
***************************************************************************************/
void TFT_eSprite::pushColor(uint32_t color, uint16_t len)
void TFT_eSprite::pushColor(uint16_t color, uint32_t len)
{
if (!_created ) return;

Expand Down
8 changes: 6 additions & 2 deletions Extensions/Sprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class TFT_eSprite : public TFT_eSPI {
// Colours are converted to the set Sprite colour bit depth
setWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1),
// Push a color (aka singe pixel) to the screen
pushColor(uint32_t color),
pushColor(uint16_t color),
// Push len colors (pixels) to the screen
pushColor(uint32_t color, uint16_t len),
pushColor(uint16_t color, uint32_t len),
// Push a pixel preformatted as a 8 or 16 bit colour (avoids conversion overhead)
writeColor(uint16_t color),

Expand Down Expand Up @@ -149,6 +149,10 @@ class TFT_eSprite : public TFT_eSPI {
// Reserve memory for the Sprite and return a pointer
void* callocSprite(int16_t width, int16_t height, uint8_t frames = 1);

// Override the non-inlined TFT_eSPI functions
void begin_nin_write(void) { ; }
void end_nin_write(void) { ; }

protected:

uint8_t _bpp; // bits per pixel (1, 8 or 16)
Expand Down
4 changes: 4 additions & 0 deletions Processors/TFT_eSPI_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ SPI3_HOST = 2
#define RD_L
#define RD_H
#endif
#else
#define TFT_RD -1
#define RD_L
#define RD_H
#endif

////////////////////////////////////////////////////////////////////////////////////////
Expand Down
14 changes: 13 additions & 1 deletion Processors/TFT_eSPI_RP2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,20 @@
// Make sure TFT_RD is defined if not used to avoid an error message
////////////////////////////////////////////////////////////////////////////////////////
// At the moment read is not supported for parallel mode, tie TFT signal high
#ifndef TFT_RD
#ifdef TFT_RD
#if (TFT_RD >= 0)
#define RD_L sio_hw->gpio_clr = (1ul << TFT_RD)
//#define RD_L digitalWrite(TFT_WR, LOW)
#define RD_H sio_hw->gpio_set = (1ul << TFT_RD)
//#define RD_H digitalWrite(TFT_WR, HIGH)
#else
#define RD_L
#define RD_H
#endif
#else
#define TFT_RD -1
#define RD_L
#define RD_H
#endif

////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit b6db90a

Please sign in to comment.