libepaper 2.0.0
A C++23 library for controlling Waveshare e-paper displays on Raspberry Pi, featuring transparent sleep/wake management and a fluent builder API.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
epaper::TextCommand Struct Reference

Command for drawing text. More...

#include <commands.hpp>

Collaboration diagram for epaper::TextCommand:
Collaboration graph
[legend]

Public Member Functions

 TextCommand (Point pos, std::string_view txt, const Font *f, Color fg=Color::Black, Color bg=Color::White) noexcept
 Construct a text command with string content.
 
 TextCommand (Point pos, std::int32_t num, const Font *f, Color fg=Color::Black, Color bg=Color::White) noexcept
 Construct a text command with number content.
 
 TextCommand (Point pos, double dec, std::uint8_t places, const Font *f, Color fg=Color::Black, Color bg=Color::White) noexcept
 Construct a text command with decimal content.
 

Public Attributes

Point position
 Text position.
 
std::string text
 Text content (or converted number)
 
const Fontfont
 Font to use.
 
Color foreground
 Foreground (text) color.
 
Color background
 Background color.
 
TextContent content_type
 Content type for internal use.
 
std::int32_t number
 Number value (for Number type)
 
double decimal
 Decimal value (for Decimal type)
 
std::uint8_t decimal_places
 Decimal places (for Decimal type)
 

Detailed Description

Command for drawing text.

Encapsulates all parameters needed to draw text (string, number, or decimal). Constructed via TextBuilder.

Member Semantics:

Font Requirements:

Text Rendering:

Numeric Formatting:

Warning
Font pointer must remain valid for command lifetime. Do not pass temporary Font objects (use Font::load() and store result).
See also
TextBuilder, Font, Graphics::draw_text()

Constructor & Destructor Documentation

◆ TextCommand() [1/3]

epaper::TextCommand::TextCommand ( Point  pos,
std::string_view  txt,
const Font f,
Color  fg = Color::Black,
Color  bg = Color::White 
)
inlinenoexcept

Construct a text command with string content.

Parameters
posText position
txtText content
fFont to use
fgForeground color (default: Black)
bgBackground color (default: White)

◆ TextCommand() [2/3]

epaper::TextCommand::TextCommand ( Point  pos,
std::int32_t  num,
const Font f,
Color  fg = Color::Black,
Color  bg = Color::White 
)
inlinenoexcept

Construct a text command with number content.

Parameters
posText position
numNumber value
fFont to use
fgForeground color (default: Black)
bgBackground color (default: White)

◆ TextCommand() [3/3]

epaper::TextCommand::TextCommand ( Point  pos,
double  dec,
std::uint8_t  places,
const Font f,
Color  fg = Color::Black,
Color  bg = Color::White 
)
inlinenoexcept

Construct a text command with decimal content.

Parameters
posText position
decDecimal value
placesDecimal places
fFont to use
fgForeground color (default: Black)
bgBackground color (default: White)

Member Data Documentation

◆ background

Color epaper::TextCommand::background

◆ content_type

TextContent epaper::TextCommand::content_type

Content type for internal use.

Examples
/mnt/nas/libepaper/include/epaper/draw/commands.hpp.

◆ decimal

double epaper::TextCommand::decimal

Decimal value (for Decimal type)

Examples
/mnt/nas/libepaper/include/epaper/draw/commands.hpp.

◆ decimal_places

std::uint8_t epaper::TextCommand::decimal_places

Decimal places (for Decimal type)

Examples
/mnt/nas/libepaper/include/epaper/draw/commands.hpp.

◆ font

const Font* epaper::TextCommand::font

◆ foreground

Color epaper::TextCommand::foreground

Foreground (text) color.

Examples
/mnt/nas/libepaper/include/epaper/draw/commands.hpp.

◆ number

std::int32_t epaper::TextCommand::number

Number value (for Number type)

Examples
/mnt/nas/libepaper/include/epaper/draw/commands.hpp.

◆ position

Point epaper::TextCommand::position

◆ text

std::string epaper::TextCommand::text

Text content (or converted number)

Examples
/mnt/nas/libepaper/include/epaper/draw/commands.hpp.

The documentation for this struct was generated from the following file: