C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
display_device.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "pico/stdlib.h"
14#include "sw/widget/canvas.h"
15
18class DisplayDevice
19{
20private:
21 /* data */
22public:
23 DisplayDevice(/* args */);
24 ~DisplayDevice();
25};
26
29class GraphicDisplayDevice : public DisplayDevice
30{
31protected:
32public:
37
44
45
55 virtual void show(Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y) = 0;
56
63 GraphicDisplayDevice(size_t screen_width,
64 size_t screen_height);
65
67 virtual ~GraphicDisplayDevice();
68
69};
70
75class PrinterDevice : public DisplayDevice
76{
77private:
78public:
86 char *text_buffer = nullptr;
93 PrinterDevice(size_t number_of_char_width,
94 size_t number_of_char_hight);
96
98 virtual void show();
99};
The canvas is a virtual memory in which the widget draws.
Definition canvas.h:121
virtual ~GraphicDisplayDevice()
Destroy the Display Device object.
Definition display_device.cpp:11
virtual void check_display_device_compatibility(struct_ConfigGraphicWidget framebuffer_cfg)=0
A pure virtual member function. Each device must implement this method and check the compatibility of...
virtual void show(Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y)=0
A pure virtual member function. It transfers the pixel buffer to the a part of display screen buffer ...
size_t TFT_panel_width_in_pixel
the physical width of the screen (in pixel)
Definition display_device.h:34
size_t TFT_panel_height_in_pixel
the physical height of the screen (in pixel)
Definition display_device.h:36
GraphicDisplayDevice(size_t screen_width, size_t screen_height)
Construct a new Display Device object.
Definition display_device.cpp:4
PrinterDevice(size_t number_of_char_width, size_t number_of_char_hight)
Construct a new Printer Device object.
Definition display_device.cpp:15
size_t text_buffer_size
the number of characters
Definition display_device.h:84
char * text_buffer
the effective character buffer
Definition display_device.h:86
size_t number_of_line
the number of line
Definition display_device.h:82
virtual void show()
the method that actually print the content of text_buffer on the console
Definition display_device.cpp:29
size_t number_of_column
the size, in number of character of a line
Definition display_device.h:80
data structure used to configure graphic framebuffer
Definition canvas.h:73