C++ DevKit
C++ set of OOP library
Canvas Class Referenceabstract

The canvas is a virtual memory in which the widget draws. More...

#include <canvas.h>

Inheritance diagram for Canvas:
Inheritance graph
Collaboration diagram for Canvas:
Collaboration graph

Public Member Functions

virtual void create_canvas_buffer ()=0
 Create a canvas buffer object.
virtual void fill_canvas_with_color (ColorIndex color)=0
 fill the canvas with a given color
 Canvas (uint8_t canvas_width_pixel, uint8_t canvas_height_pixel)
 Construct a new Canvas object.
virtual void clear_canvas_buffer ()
 fill the canvas buffer with 0x00
virtual void draw_pixel (const int x, const int y, const ColorIndex color=ColorIndex::WHITE)=0
 the graphic primitive to draw a pixel

Public Attributes

CanvasFormat canvas_format
 the actual format of the canvas
ColorIndex fg_color
 a copy of the widget foreground color
ColorIndex bg_color
 a copy of the widget background color
uint8_t canvas_width_pixel
 the width (in pixel) of the canvas and also of those of the associated widget
uint8_t canvas_height_pixel
 the height (in pixel) of the canvas and also of those of the associated widget
size_t canvas_buffer_size_byte
 the size (in bytes) of the buffer
size_t canvas_buffer_size_pixel
 the size (in pixel) of the buffer
uint8_t * canvas_buffer {nullptr}
 the 8bit canvas buffer
uint16_t * canvas_16buffer {nullptr}
 the 16bit canvasbuffer

Detailed Description

The canvas is a virtual memory in which the widget draws.

Constructor & Destructor Documentation

◆ Canvas()

Canvas::Canvas ( uint8_t canvas_width_pixel,
uint8_t canvas_height_pixel )

Construct a new Canvas object.

Parameters
canvas_width_pixelWidth of the canvas (in pixel)
canvas_height_pixelheight of the canvas(in pixel)
Here is the caller graph for this function:

Member Function Documentation

◆ clear_canvas_buffer()

void Canvas::clear_canvas_buffer ( )
virtual

fill the canvas buffer with 0x00

Reimplemented in CanvasTrueRGB.

Here is the caller graph for this function:

◆ create_canvas_buffer()

virtual void Canvas::create_canvas_buffer ( )
pure virtual

Create a canvas buffer object.

Implemented in CanvasHMSB, CanvasRGB, CanvasTrueRGB, and CanvasVLSB.

◆ draw_pixel()

virtual void Canvas::draw_pixel ( const int x,
const int y,
const ColorIndex color = ColorIndex::WHITE )
pure virtual

the graphic primitive to draw a pixel

Parameters
xthe x position of the pixel
ythe y position of the pixel
colorthe color of the pixel

Implemented in CanvasHMSB, CanvasRGB, CanvasTrueRGB, and CanvasVLSB.

◆ fill_canvas_with_color()

virtual void Canvas::fill_canvas_with_color ( ColorIndex color)
pure virtual

fill the canvas with a given color

Parameters
color

Implemented in CanvasHMSB, CanvasRGB, CanvasTrueRGB, and CanvasVLSB.


The documentation for this class was generated from the following files: