LineCommand cmd1{{10,10}, {100,100}, Color::Black, DotPixel::Pixel1x1, LineStyle::Solid};
auto cmd2 = LineBuilder().from({10,10}).to({100,100}).build();
display.draw(cmd2);
std::vector<LineCommand> lines;
lines.push_back(LineBuilder().from(a).to(b).build());
lines.push_back(LineBuilder().from(c).to(d).build());
for (const auto& cmd : lines) {
display.draw(cmd);
}
#pragma once
#include <cstdint>
#include <string>
#include <string_view>
struct LineCommand {
};
struct RectangleCommand {
};
struct CircleCommand {
};
struct PointCommand {
};
};
struct TextCommand {
TextCommand(Point pos,
double dec, std::uint8_t places,
const Font *f,
Color fg =
Color::Black,
};
}
Bitmap font rendering for e-paper displays.
DrawFill
Definition types.hpp:151
@ Empty
Draw outline only (border with no fill)
TextContent
Content type for text rendering.
Definition commands.hpp:240
@ String
Direct string content (text field used as-is)
@ Decimal
Decimal number (decimal field formatted with decimal_places precision)
@ Number
Integer number (number field converted to text via sprintf)
DotPixel
Definition types.hpp:92
@ Pixel1x1
Single pixel (finest resolution)
Color
Definition types.hpp:32
@ White
White (or lightest gray in grayscale modes)
@ Black
Black (or darkest gray in grayscale modes)
LineStyle
Definition types.hpp:120
@ Solid
Continuous solid line.
Color color
Circle color.
Definition commands.hpp:177
DotPixel border_width
Border width.
Definition commands.hpp:178
DrawFill fill
Fill mode (empty/full)
Definition commands.hpp:179
std::size_t radius
Circle radius in pixels.
Definition commands.hpp:176
Point center
Center point.
Definition commands.hpp:175
Point from
Starting point.
Definition commands.hpp:85
DotPixel width
Line width.
Definition commands.hpp:88
LineStyle style
Line style (solid/dotted)
Definition commands.hpp:89
Point to
Ending point.
Definition commands.hpp:86
Color color
Line color.
Definition commands.hpp:87
Color color
Point color.
Definition commands.hpp:220
Point position
Point position.
Definition commands.hpp:219
DotPixel pixel_size
Point size.
Definition commands.hpp:221
DrawFill fill
Fill mode (empty/full)
Definition commands.hpp:134
Color color
Rectangle color.
Definition commands.hpp:132
Point top_left
Top-left corner.
Definition commands.hpp:130
Point bottom_right
Bottom-right corner.
Definition commands.hpp:131
DotPixel border_width
Border width.
Definition commands.hpp:133
Color background
Background color.
Definition commands.hpp:286
TextContent content_type
Content type for internal use.
Definition commands.hpp:287
const Font * font
Font to use.
Definition commands.hpp:284
double decimal
Decimal value (for Decimal type)
Definition commands.hpp:289
std::int32_t number
Number value (for Number type)
Definition commands.hpp:288
Point position
Text position.
Definition commands.hpp:282
Color foreground
Foreground (text) color.
Definition commands.hpp:285
std::string text
Text content (or converted number)
Definition commands.hpp:283
std::uint8_t decimal_places
Decimal places (for Decimal type)
Definition commands.hpp:290