206 color_ = line_style.color;
207 width_ = line_style.width;
208 style_ = line_style.style;
309 top_left_ =
Point{x, y};
332 bottom_right_ =
Point{x, y};
355 top_left_ =
Point{x, y};
369 bottom_right_ =
Point{top_left_.
x + sz.width, top_left_.
y + sz.height};
381 bottom_right_ =
Point{top_left_.
x + w, top_left_.
y + h};
425 color_ = shape_style.color;
426 border_width_ = shape_style.border_width;
427 fill_ = shape_style.fill;
437 return RectangleCommand{top_left_, bottom_right_, color_, border_width_, fill_};
441 Point top_left_{0, 0};
442 Point bottom_right_{0, 0};
519 center_ =
Point{x, y};
574 color_ = shape_style.color;
575 border_width_ = shape_style.border_width;
576 fill_ = shape_style.fill;
586 return CircleCommand{center_, radius_, color_, border_width_, fill_};
591 std::size_t radius_ = 0;
669 position_ =
Point{x, y};
703 Point position_{0, 0};
792 : text_(txt), content_type_(
TextContent::String), number_(0), decimal_(0.0), decimal_places_(0) {}
827 decimal_places_ = places;
851 position_ =
Point{x, y};
895 font_ = text_style.font;
896 foreground_ = text_style.foreground;
897 background_ = text_style.background;
907 switch (content_type_) {
909 return TextCommand{position_, text_, font_, foreground_, background_};
911 return TextCommand{position_, number_, font_, foreground_, background_};
913 return TextCommand{position_, decimal_, decimal_places_, font_, foreground_, background_};
916 return TextCommand{position_, text_, font_, foreground_, background_};
920 Point position_{0, 0};
922 const Font *font_ =
nullptr;
926 std::int32_t number_;
928 std::uint8_t decimal_places_;
Definition builders.hpp:493
auto center(Point pt) noexcept -> CircleBuilder &
Set the center point of the circle.
Definition builders.hpp:506
auto radius(std::size_t r) noexcept -> CircleBuilder &
Set the circle radius.
Definition builders.hpp:529
auto build() const noexcept -> CircleCommand
Build the final CircleCommand.
Definition builders.hpp:585
CircleBuilder() noexcept=default
Default constructor creates a builder with default values.
auto color(Color c) noexcept -> CircleBuilder &
Set the circle color.
Definition builders.hpp:540
auto border_width(DotPixel w) noexcept -> CircleBuilder &
Set the border width.
Definition builders.hpp:551
auto center(std::size_t x, std::size_t y) noexcept -> CircleBuilder &
Set the center point using coordinates.
Definition builders.hpp:518
auto fill(DrawFill f) noexcept -> CircleBuilder &
Set the fill mode.
Definition builders.hpp:562
auto with_style(const ShapeStyleSpec &shape_style) noexcept -> CircleBuilder &
Apply a reusable shape style.
Definition builders.hpp:573
Definition builders.hpp:113
auto width(DotPixel w) noexcept -> LineBuilder &
Set the line width.
Definition builders.hpp:183
auto to(std::size_t x, std::size_t y) noexcept -> LineBuilder &
Set the ending point of the line using coordinates.
Definition builders.hpp:161
auto style(LineStyle s) noexcept -> LineBuilder &
Set the line style.
Definition builders.hpp:194
auto from(std::size_t x, std::size_t y) noexcept -> LineBuilder &
Set the starting point of the line using coordinates.
Definition builders.hpp:138
auto from(Point pt) noexcept -> LineBuilder &
Set the starting point of the line.
Definition builders.hpp:126
auto color(Color c) noexcept -> LineBuilder &
Set the line color.
Definition builders.hpp:172
auto to(Point pt) noexcept -> LineBuilder &
Set the ending point of the line.
Definition builders.hpp:149
auto build() const noexcept -> LineCommand
Build the final LineCommand.
Definition builders.hpp:217
LineBuilder() noexcept=default
Default constructor creates a builder with default values.
auto with_style(const LineStyleSpec &line_style) noexcept -> LineBuilder &
Apply a reusable line style.
Definition builders.hpp:205
Definition builders.hpp:643
auto size(DotPixel s) noexcept -> PointBuilder &
Set the point size.
Definition builders.hpp:690
auto color(Color c) noexcept -> PointBuilder &
Set the point color.
Definition builders.hpp:679
auto at(Point pt) noexcept -> PointBuilder &
Set the position of the point.
Definition builders.hpp:656
auto at(std::size_t x, std::size_t y) noexcept -> PointBuilder &
Set the position using coordinates.
Definition builders.hpp:668
auto build() const noexcept -> PointCommand
Build the final PointCommand.
Definition builders.hpp:700
PointBuilder() noexcept=default
Default constructor creates a builder with default values.
Definition builders.hpp:283
auto at(Point pt) noexcept -> RectangleBuilder &
Set the position (top-left corner) of the rectangle.
Definition builders.hpp:342
auto color(Color c) noexcept -> RectangleBuilder &
Set the rectangle color.
Definition builders.hpp:391
auto size(Size sz) noexcept -> RectangleBuilder &
Set the size of the rectangle.
Definition builders.hpp:368
auto border_width(DotPixel w) noexcept -> RectangleBuilder &
Set the border width.
Definition builders.hpp:402
auto build() const noexcept -> RectangleCommand
Build the final RectangleCommand.
Definition builders.hpp:436
auto top_left(Point pt) noexcept -> RectangleBuilder &
Set the top-left corner of the rectangle.
Definition builders.hpp:296
auto bottom_right(std::size_t x, std::size_t y) noexcept -> RectangleBuilder &
Set the bottom-right corner using coordinates.
Definition builders.hpp:331
auto size(std::size_t w, std::size_t h) noexcept -> RectangleBuilder &
Set the size using width and height.
Definition builders.hpp:380
RectangleBuilder() noexcept=default
Default constructor creates a builder with default values.
auto top_left(std::size_t x, std::size_t y) noexcept -> RectangleBuilder &
Set the top-left corner using coordinates.
Definition builders.hpp:308
auto with_style(const ShapeStyleSpec &shape_style) noexcept -> RectangleBuilder &
Apply a reusable shape style.
Definition builders.hpp:424
auto bottom_right(Point pt) noexcept -> RectangleBuilder &
Set the bottom-right corner of the rectangle.
Definition builders.hpp:319
auto at(std::size_t x, std::size_t y) noexcept -> RectangleBuilder &
Set the position using coordinates.
Definition builders.hpp:354
auto fill(DrawFill f) noexcept -> RectangleBuilder &
Set the fill mode.
Definition builders.hpp:413
Definition builders.hpp:779
auto with_style(const TextStyleSpec &text_style) noexcept -> TextBuilder &
Apply a reusable text style.
Definition builders.hpp:894
auto font(const Font *f) noexcept -> TextBuilder &
Set the font.
Definition builders.hpp:861
auto number(std::int32_t num) noexcept -> TextBuilder &
Set the content to an integer number.
Definition builders.hpp:812
auto background(Color c) noexcept -> TextBuilder &
Set the background color.
Definition builders.hpp:883
auto at(std::size_t x, std::size_t y) noexcept -> TextBuilder &
Set the text position using coordinates.
Definition builders.hpp:850
auto text(std::string_view txt) noexcept -> TextBuilder &
Set the text content.
Definition builders.hpp:800
TextBuilder() noexcept
Default constructor creates a builder with empty text.
Definition builders.hpp:784
auto build() const -> TextCommand
Build the final TextCommand.
Definition builders.hpp:906
auto at(Point pt) noexcept -> TextBuilder &
Set the text position.
Definition builders.hpp:838
TextBuilder(std::string_view txt) noexcept
Construct a text builder with string content.
Definition builders.hpp:791
auto decimal(double dec, std::uint8_t places) noexcept -> TextBuilder &
Set the content to a decimal number.
Definition builders.hpp:825
auto foreground(Color c) noexcept -> TextBuilder &
Set the foreground (text) color.
Definition builders.hpp:872
Immutable command structures for drawing operations.
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.
Command for drawing a circle.
Definition commands.hpp:174
Command for drawing a line between two points.
Definition commands.hpp:84
Command for drawing a point (pixel or multi-pixel dot).
Definition commands.hpp:218
Definition geometry.hpp:37
std::size_t y
Y coordinate (vertical position)
Definition geometry.hpp:39
std::size_t x
X coordinate (horizontal position)
Definition geometry.hpp:38
Command for drawing a rectangle.
Definition commands.hpp:129
Definition geometry.hpp:105
Command for drawing text.
Definition commands.hpp:281
Definition styles.hpp:124
Reusable style specifications for drawing commands.