Skip to main content
Version: 4.16

DebugPrinter

The class DebugPrinter defines the interface for printing debug messages on top of the framebuffer.

Inherited by: LCD16DebugPrinter, LCD1DebugPrinter, LCD24DebugPrinter, LCD2DebugPrinter, LCD32DebugPrinter, LCD4DebugPrinter, LCD8ABGR2222DebugPrinter, LCD8ARGB2222DebugPrinter, LCD8BGRA2222DebugPrinter, LCD8RGBA2222DebugPrinter

Public Functions#

DebugPrinter()
Initializes a new instance of the DebugPrinter class.
virtual voiddraw(const Rect & rect) const =0
Draws the debug string on top of the framebuffer content.
const Rect &getRegion() const
Returns the region where the debug string is displayed.
voidsetColor(colortype fg)
Sets the foreground color of the debug string.
voidsetPosition(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Sets the position onscreen where the debug string will be displayed.
voidsetScale(uint8_t scale)
Sets the font scale of the debug string.
voidsetString(const char * string)
Sets the debug string to be displayed on top of the framebuffer.
virtual ~DebugPrinter()
Finalizes an instance of the DebugPrinter class.

Protected Functions#

uint16_tgetGlyph(uint8_t c) const
Gets a glyph (15 bits) arranged with 3 bits wide, 5 bits high in a single uint16_t value.

Protected Attributes#

colortypedebugForegroundColor
Font color to use when displaying the debug string.
RectdebugRegion
Region onscreen where the debug message is displayed.
uint8_tdebugScale
Font scaling factor to use when displaying the debug string.
const char *debugString
Debug string to be displayed onscreen.

Public Functions Documentation#

DebugPrinter#

Initializes a new instance of the DebugPrinter class.

draw#

getRegion#

const Rect & getRegion()const

Returns the region where the debug string is displayed.

Returns:

Rect The debug string region.

setColor#

Sets the foreground color of the debug string.

Parameters:
fgThe foreground color of the debug string.

setPosition#

void setPosition(uint16_tx ,
uint16_ty ,
uint16_tw ,
uint16_th
)

Sets the position onscreen where the debug string will be displayed.

Parameters:
xThe coordinate of the region where the debug string is displayed.
yThe coordinate of the region where the debug string is displayed.
wThe width of the region where the debug string is displayed.
hThe height of the region where the debug string is displayed.

setScale#

void setScale(uint8_tscale)

Sets the font scale of the debug string.

Parameters:
scaleThe font scale of the debug string.

setString#

void setString(const char *string)

Sets the debug string to be displayed on top of the framebuffer.

Parameters:
stringThe string to be displayed.

~DebugPrinter#

virtual ~DebugPrinter()

Finalizes an instance of the DebugPrinter class.

Protected Functions Documentation#

getGlyph#

uint16_t getGlyph(uint8_tc)

Gets a glyph (15 bits) arranged with 3 bits wide, 5 bits high in a single uint16_t value.

Parameters:
cThe character to get a glyph for.
Returns:

The glyph.

Protected Attributes Documentation#

debugForegroundColor#

colortype debugForegroundColor

Font color to use when displaying the debug string.

debugRegion#

Rect debugRegion

Region onscreen where the debug message is displayed.

debugScale#

uint8_t debugScale

Font scaling factor to use when displaying the debug string.

debugString#

const char * debugString

Debug string to be displayed onscreen.