Skip to main content

DebugPrinter

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

Inherited by: LCD16DebugPrinter, LCD1DebugPrinter, LCD24DebugPrinter, LCD2DebugPrinter, LCD32DebugPrinter, LCD4DebugPrinter, LCD8DebugPrinterBase

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(int16_t x, int16_t y, int16_t w, int16_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 on screen 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 on screen.

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(int16_tx ,
int16_ty ,
int16_tw ,
int16_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 on screen 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 on screen.