36 const uint16_t _width;
37 const uint16_t _height;
38 const uint32_t _DRAM_address;
40 static uint32_t _nextDRAM_Address;
149 return _DRAM_address;
165 static void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);
195 void solidFill(uint16_t x0, uint16_t y0, uint16_t
width, uint16_t
height, uint16_t color)
const;
206 void text(uint16_t x0, uint16_t y0, uint16_t fColor, uint16_t bColor,
const char *
text,
bool small =
false)
const;
216 void drawRect(
unsigned short x0,
unsigned short y0,
unsigned short x1,
unsigned short y1,
unsigned short color)
const;
228 void drawRoundedRect(
unsigned short x0,
unsigned short y0,
unsigned short x1,
unsigned short y1,
229 unsigned short color,
unsigned short radius,
bool fill =
false)
const;
265 void BTE_ROP(
const Canvas &S0, uint16_t S0_x0, uint16_t S0_y0,
266 const Canvas &S1, uint16_t S1_x0, uint16_t S1_y0,
267 uint16_t DT_x0, uint16_t DT_y0, uint16_t DT_width, uint16_t DT_height,
268 uint8_t ROP,
bool S1_OpacityOn =
false)
const;
282 const uint8_t ROP = 0x0C;
283 BTE_ROP(source, Src_x0, Src_y0, source, Src_x0, Src_y0, DT_x0, DT_y0,
width,
height, ROP,
false);
301 const Canvas &S1, uint16_t S1_x0, uint16_t S1_y0,
302 uint16_t DT_x0, uint16_t DT_y0, uint16_t
width, uint16_t
height,
bool S1OpacityOn=
false)
const
304 const uint8_t ROP = 0x0E;
306 BTE_ROP(S0, S0_x0, S0_y0, S1, S1_x0, S1_y0, DT_x0, DT_y0,
width,
height, ROP, S1OpacityOn);
320 uint16_t DT_x0, uint16_t DT_y0, uint16_t
width, uint16_t
height)
const
322 const uint8_t ROP = 0x0E;
324 BTE_ROP(*
this, DT_x0, DT_y0, source, Src_x0, Src_y0, DT_x0, DT_y0,
width,
height, ROP,
false);
339 const uint8_t ROP = 0x0E;
341 BTE_ROP(*
this, DT_x0, DT_y0, source, Src_x0, Src_y0, DT_x0, DT_y0,
width,
height, ROP,
true);
351 static void BL_ON(
void);
367 return _nextDRAM_Address;
407 uint32_t _ROM_Address;
411 ROM_Canvas(
void) =
delete;
417 ROM_Canvas(
ROM_Image image,
bool temporary =
false);
452 DRAM_Canvas(
void) =
delete;
459 DRAM_Canvas(
const Canvas &srcCanvas,
bool temporary =
false);
467 DRAM_Canvas(
const Canvas &srcCanvas,
const Block_Image imgBlock,
bool temporary =
false);
494inline T nearest4(T num)
496 return static_cast<T
>(ceil(num / 4.0) * 4);
Defines the locations of individual sub-images stored in ROM.
#define Black
Definition TFTM070A1.h:56
Provides higher level TFT graphic functionality used by the menu system.
Definition Canvas.h:34
void drawRoundedRect(unsigned short x0, unsigned short y0, unsigned short x1, unsigned short y1, unsigned short color, unsigned short radius, bool fill=false) const
Draws an unfilled rounded square.
Definition Canvas.cpp:190
static void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color)
Draws a line onto the display.
Definition Canvas.cpp:142
~Canvas(void)=default
Default destructor.
void clear(uint16_t color)
Erases the canvas, setting all pixels to the specified color.
Definition Canvas.h:181
void BTE_ROP(const Canvas &S0, uint16_t S0_x0, uint16_t S0_y0, const Canvas &S1, uint16_t S1_x0, uint16_t S1_y0, uint16_t DT_x0, uint16_t DT_y0, uint16_t DT_width, uint16_t DT_height, uint8_t ROP, bool S1_OpacityOn=false) const
Gneralized ROP operation. This assumes that object calling this method is the destimation DT canvas.
Definition Canvas.cpp:95
void BTE_AddImageFrom(const Canvas &S0, uint16_t S0_x0, uint16_t S0_y0, const Canvas &S1, uint16_t S1_x0, uint16_t S1_y0, uint16_t DT_x0, uint16_t DT_y0, uint16_t width, uint16_t height, bool S1OpacityOn=false) const
Adds image from source to the image on this canvas.
Definition Canvas.h:300
void clear(void)
Erases the canvas, setting all pixels to Black.
Definition Canvas.h:172
void setActive(void) const
Sets this canvas as both the active canvas and active window.
Definition Canvas.cpp:31
static void BL_OFF(void)
Turns the TFT backlight off.
Definition Canvas.cpp:55
void setMainWindow(void) const
Sets this canvas as the Main Window, displaying it in the TFT.
Definition Canvas.cpp:42
Canvas(void)
Default constructor sets canvass to the full size of the display.
Definition Canvas.h:58
void BTE_AddTransparentImageFrom(const Canvas &source, uint16_t Src_x0, uint16_t Src_y0, uint16_t DT_x0, uint16_t DT_y0, uint16_t width, uint16_t height) const
Adds an opacity encoded image from source to the image on this canvas.
Definition Canvas.h:337
static void BL_ON(void)
Turns the TFT backlight on.
Definition Canvas.cpp:50
void BTE_SetAsDT(uint16_t x0, uint16_t y0) const
Sets the location of the destination (DT) image for the BTE engine.
Definition Canvas.cpp:76
void BTE_SetAsS0(uint16_t x0, uint16_t y0) const
Sets the location of the S0 source image for the BTE engine.
Definition Canvas.cpp:60
static uint32_t nextAddress(void)
Location in DRAM whether the next image Canvas will be placed.
Definition Canvas.h:365
uint16_t width(void) const
Accessor method providing the canvas width.
Definition Canvas.h:125
void BTE_AddImageFrom(const Canvas &source, uint16_t Src_x0, uint16_t Src_y0, uint16_t DT_x0, uint16_t DT_y0, uint16_t width, uint16_t height) const
Adds image from source to the image on this canvas.
Definition Canvas.h:319
uint16_t height(void) const
Accessor method providing the canvas height.
Definition Canvas.h:136
void BTE_CopyFrom(const Canvas &source, uint16_t Src_x0, uint16_t Src_y0, uint16_t DT_x0, uint16_t DT_y0, uint16_t width, uint16_t height) const
Uses BTE engine to copy imagery from source canvas to this one.
Definition Canvas.h:280
void BTE_SetAsS1(uint16_t x0, uint16_t y0) const
Sets the location of the S1 source image for the BTE engine.
Definition Canvas.cpp:68
void BTE_CopyFrom(const Canvas &source) const
Uses BTE engine to copy entire image from source canvas to this one.
Definition Canvas.cpp:85
void _validate(void) const
Protected method used to validate that the images used to create this canvas are appropriately size.
Definition Canvas.cpp:208
void solidFill(uint16_t x0, uint16_t y0, uint16_t width, uint16_t height, uint16_t color) const
Draws a filled square onto the canvas.
Definition Canvas.cpp:150
void drawRect(unsigned short x0, unsigned short y0, unsigned short x1, unsigned short y1, unsigned short color) const
Draws an unfilled square.
Definition Canvas.cpp:182
uint32_t address(void) const
Accessor method providing the canvas' starting address in DRAM.
Definition Canvas.h:147
virtual void loadImage(void) const
Loads imagery onto the canvas.
Definition Canvas.h:94
void text(uint16_t x0, uint16_t y0, uint16_t fColor, uint16_t bColor, const char *text, bool small=false) const
Draws text onto the canvas.
Definition Canvas.cpp:165
void loadImage(void) const override
Loads the image from Flash ROM onto this Canvas.
Definition Canvas.cpp:265
~DRAM_Canvas(void)=default
Default destructor.
~ROM_Canvas(void)=default
Default destructor.
void loadImage(void) const override
Loads the image from Flash ROM onto this Canvas.
Definition Canvas.cpp:228
Structure to define sub-images. Generally associated with a ROM_Image.
Definition ROM_Images.h:22
Structure to define the size and location of an image in Flash.
Definition ROM_Images.h:14