#include <Canvas.h>
Public Member Functions | |
Constructors and Destructors | |
| Canvas (void) | |
| Default constructor sets canvass to the full size of the display. | |
| Canvas (bool temporary) | |
| Constructor sets canvass to the full size of the display. | |
| Canvas (uint16_t width, uint16_t height, bool temporary=false) | |
| Constructor. | |
| ~Canvas (void)=default | |
| Default destructor. | |
General Methods | |
| virtual void | loadImage (void) const |
| Loads imagery onto the canvas. | |
| void | setActive (void) const |
| Sets this canvas as both the active canvas and active window. | |
| void | setMainWindow (void) const |
| Sets this canvas as the Main Window, displaying it in the TFT. | |
Accessor Methods | |
| uint16_t | width (void) const |
| Accessor method providing the canvas width. | |
| uint16_t | height (void) const |
| Accessor method providing the canvas height. | |
| uint32_t | address (void) const |
| Accessor method providing the canvas' starting address in DRAM. | |
Bit Transfer Engine (BTE) Operations | |
| void | BTE_CopyFrom (const Canvas &source) const |
Uses BTE engine to copy entire image from source canvas to this one. | |
| void | BTE_CopyFrom (const Canvas &source, uint16_t DT_x0, uint16_t DT_y0) const |
Uses BTE engine to copy imagery from source canvas to this one. | |
| 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. | |
| 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. | |
| 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 an opacity encoded image from source to the image on this canvas. | |
| void | BTE_AddTransparantImageFrom (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. | |
Static Public Member Functions | |
| static void | BL_ON (void) |
| Turns the TFT backlight on. | |
| static void | BL_OFF (void) |
| Turns the TFT backlight off. | |
| static uint32_t | nextAddress (void) |
| Location in DRAM whether the next image Canvas will be placed. | |
Protected Member Functions | |
| void | _validate (void) const |
| Protected method used to validate that the images used to create this canvas are appropriately size. | |
| void | BTE_SetAsS0 (uint16_t x0, uint16_t y0) const |
| Sets the location of the S0 source image for the BTE engine. | |
| void | BTE_SetAsS1 (uint16_t x0, uint16_t y0) const |
| Sets the location of the S1 source image for the BTE engine. | |
| void | BTE_SetAsDT (uint16_t x0, uint16_t y0) const |
| Sets the location of the destination (DT) image for the BTE engine. | |
Graphics primatives | |
| void | clear (void) |
| Erases the canvas, setting all pixels to Black. | |
| void | clear (uint16_t color) |
| Erases the canvas, setting all pixels to the specified color. | |
| 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. | |
| 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. | |
| void | drawSquare (unsigned short x0, unsigned short y0, unsigned short x1, unsigned short y1, unsigned short color) const |
| Draws an unfilled square. | |
| static void | drawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) |
| Draws a line onto the display. | |
|
inline |
Default constructor sets canvass to the full size of the display.
| Canvas::Canvas | ( | bool | temporary | ) |
Constructor sets canvass to the full size of the display.
| [in] | temporary | (Optional) If true, the canvas is temporary. Future canvasses will overwrite the DRAM used by this canvas. |
| Canvas::Canvas | ( | uint16_t | width, |
| uint16_t | height, | ||
| bool | temporary = false ) |
Constructor.
| [in] | width | Width of the constructed canvas |
| [in] | height | Height of the constructed canvas |
| [in] | temporary | (Optional) If true, the canvas is temporary. Future canvasses will overwrite the DRAM used by this canvas. |
|
default |
Default destructor.
|
protected |
Protected method used to validate that the images used to create this canvas are appropriately size.
Verify that the width of any images used by this object has a width that is a multiple of 4. This is required by the LT7683 graphics chip.
|
inline |
Accessor method providing the canvas' starting address in DRAM.
|
inlinestatic |
Turns the TFT backlight off.
|
inlinestatic |
Turns the TFT backlight on.
|
inline |
Adds an opacity encoded image from source to the image on this canvas.
| [in] | source | canvas containg the source imagery |
| [in] | Src_x0 | Upper left x-coordinate of image block within source |
| [in] | Src_y0 | Upper left y-coodrinate of image block within source |
| [in] | DT_x0 | Upper left x-coordinate in this canvas where image block is to be copied |
| [in] | DT_y0 | Upper left y-coordinate in this canvas where image block is to be copied |
| [in] | width | Width of the image block to be transferred |
| [in] | height | Height of the image block to be transferred |
|
inline |
Adds an opacity encoded image from source to the image on this canvas.
| [in] | source | canvas containg the source imagery |
| [in] | Src_x0 | Upper left x-coordinate of image block within source |
| [in] | Src_y0 | Upper left y-coodrinate of image block within source |
| [in] | DT_x0 | Upper left x-coordinate in this canvas where image block is to be copied |
| [in] | DT_y0 | Upper left y-coordinate in this canvas where image block is to be copied |
| [in] | width | Width of the image block to be transferred |
| [in] | height | Height of the image block to be transferred |
| void Canvas::BTE_CopyFrom | ( | const Canvas & | source | ) | const |
Uses BTE engine to copy entire image from source canvas to this one.
| [in] | source | canvas containg the source imagery |
| void Canvas::BTE_CopyFrom | ( | const Canvas & | source, |
| uint16_t | DT_x0, | ||
| uint16_t | DT_y0 ) const |
Uses BTE engine to copy imagery from source canvas to this one.
| [in] | source | canvas containg the source imagery |
| [in] | DT_x0 | Upper left x-coordinate in this canvas where image block is to be copied |
| [in] | DT_y0 | Upper left y-coordinate in this canvas where image block is to be copied |
|
inline |
Uses BTE engine to copy imagery from source canvas to this one.
| [in] | source | canvas containg the source imagery |
| [in] | Src_x0 | Upper left x-coordinate of image block within source |
| [in] | Src_y0 | Upper left y-coodrinate of image block within source |
| [in] | DT_x0 | Upper left x-coordinate in this canvas where image block is to be copied |
| [in] | DT_y0 | Upper left y-coordinate in this canvas where image block is to be copied |
| [in] | width | Width of the image block to be transferred |
| [in] | height | Height of the image block to be transferred |
| void Canvas::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.
| [in] | S0 | Canvas containg the S0 source imagery |
| [in] | S0_x0 | Upper left x-coordinate of image block within S0 to be processed by BTE |
| [in] | S0_y0 | Upper left y-coodrinate of image block within S0 to be processed by BTE |
| [in] | S1 | Canvas containg the S1 source imagery |
| [in] | S1_x0 | Upper left x-coordinate of image block within S1 to be processed by BTE |
| [in] | S1_y0 | Upper left y-coodrinate of image block within S1 to be processed by BTE |
| [in] | DT_x0 | Upper left x-coordinate where the final image is to placed within this canvas |
| [in] | DT_y0 | Upper left y-coordinate where the final image is to placed within this canvas |
| [in] | DT_width | Width of the image block to be processed by the BTE |
| [in] | DT_height | Height of the image block to be processed by the BTE |
| [in] | ROP | Code define the raster operation: S0 (ROP) S1 = DT |
| [in] | S1_OpacityOn | If true, S1 image is treated as a 16bpp image with encoded opacity. If false, S1 is a standard 16bpp image |
|
protected |
Sets the location of the destination (DT) image for the BTE engine.
| [in] | x0 | Upper left x-coordinate of the DT image in this canvas |
| [in] | y0 | Upper left y-coordinate of the DT image in this canvas |
|
protected |
Sets the location of the S0 source image for the BTE engine.
| [in] | x0 | Upper left x-coordinate of the S0 image in this canvas |
| [in] | y0 | Upper left y-coordinate of the S0 image in this canvas |
|
protected |
Sets the location of the S1 source image for the BTE engine.
| [in] | x0 | Upper left x-coordinate of the S1 image in this canvas |
| [in] | y0 | Upper left y-coordinate of the S1 image in this canvas |
|
inline |
Erases the canvas, setting all pixels to the specified color.
| [in] | color | 16 bit color value |
|
inline |
Erases the canvas, setting all pixels to Black.
|
static |
Draws a line onto the display.
| x0 | [in] Starting x-pos |
| y0 | [in] Starting y-pos |
| x1 | [in] Ending x-pos |
| y1 | [in] Ending y-pos |
| color | [in] 16-bit color of the line |
| void Canvas::drawSquare | ( | unsigned short | x0, |
| unsigned short | y0, | ||
| unsigned short | x1, | ||
| unsigned short | y1, | ||
| unsigned short | color ) const |
Draws an unfilled square.
| [in] | x0 | UL x-coordinate |
| [in] | y0 | UL y-coordinate |
| [in] | x1 | LR x-coordinate |
| [in] | y1 | LR y-coordinate |
| [in] | color | 16-bit color |
|
inline |
Accessor method providing the canvas height.
|
inlinevirtual |
Loads imagery onto the canvas.
This method doesn't do anything for this class. However, it is expected that derived classes will override this method, providing functionality appropriate for that class.
Reimplemented in DRAM_Canvas, and ROM_Canvas.
|
inlinestatic |
Location in DRAM whether the next image Canvas will be placed.
| void Canvas::setActive | ( | void | ) | const |
Sets this canvas as both the active canvas and active window.
| void Canvas::setMainWindow | ( | void | ) | const |
Sets this canvas as the Main Window, displaying it in the TFT.
| void Canvas::solidFill | ( | uint16_t | x0, |
| uint16_t | y0, | ||
| uint16_t | width, | ||
| uint16_t | height, | ||
| uint16_t | color ) const |
Draws a filled square onto the canvas.
| [in] | x0 | Upper left x-coordinate |
| [in] | y0 | Upper left y-coodrinate |
| [in] | width | width of square |
| [in] | height | height of square |
| [in] | color | 16 bit color of the square |
| void Canvas::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.
| [in] | x0 | Upper left x-coordinate |
| [in] | y0 | Upper left y-coodrinate |
| [in] | fColor | 16 bit foreground color of the text |
| [in] | bColor | 16 bit background color of the text |
| [in] | text | Text to be displayed |
| [in] | small | (Optional) If true, a smaller font is used |
|
inline |
Accessor method providing the canvas width.