Add new alphaBlend functions
Added 24 bit colour handling alphaBlend to reduce precision loss in multiple blend stages (e.g. in 2D colour gradients). Added option for alpha dither to reduce colour banding in gradients with 16 bit colours. Get rid of compile warnings.
This commit is contained in:
1 parent
0e0fd75277
commit
8209c00316
8 files changed
+139
-242
No files matched your search
@@ -10,6 +10,44 @@
|
||||
|
||||
// See license in root directory.
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: begin_touch_read_write - was spi_begin_touch
|
||||
** Description: Start transaction and select touch controller
|
||||
***************************************************************************************/
|
||||
// The touch controller has a low SPI clock rate
|
||||
inline void TFT_eSPI::begin_touch_read_write(void){
|
||||
DMA_BUSY_CHECK;
|
||||
CS_H; // Just in case it has been left low
|
||||
#if defined (SPI_HAS_TRANSACTION) && defined (SUPPORT_TRANSACTIONS)
|
||||
if (locked) {locked = false; spi.beginTransaction(SPISettings(SPI_TOUCH_FREQUENCY, MSBFIRST, SPI_MODE0));}
|
||||
#else
|
||||
spi.setFrequency(SPI_TOUCH_FREQUENCY);
|
||||
#endif
|
||||
SET_BUS_READ_MODE;
|
||||
T_CS_L;
|
||||
}
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: end_touch_read_write - was spi_end_touch
|
||||
** Description: End transaction and deselect touch controller
|
||||
***************************************************************************************/
|
||||
inline void TFT_eSPI::end_touch_read_write(void){
|
||||
T_CS_H;
|
||||
#if defined (SPI_HAS_TRANSACTION) && defined (SUPPORT_TRANSACTIONS)
|
||||
if(!inTransaction) {if (!locked) {locked = true; spi.endTransaction();}}
|
||||
#else
|
||||
spi.setFrequency(SPI_FREQUENCY);
|
||||
#endif
|
||||
SET_BUS_WRITE_MODE;
|
||||
}
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: Legacy - deprecated
|
||||
** Description: Start/end transaction
|
||||
***************************************************************************************/
|
||||
void TFT_eSPI::spi_begin_touch() {begin_touch_read_write();}
|
||||
void TFT_eSPI::spi_end_touch() { end_touch_read_write();}
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: getTouchRaw
|
||||
** Description: read raw touch position. Always returns true.
|
||||
|
||||
Reference in new issue
Block a user