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
/mnt/nas/libepaper/include/epaper/draw/styles.hpp

Reusable style specification for line drawing.

Reusable style specification for line drawing.Encapsulates color, width, and style for drawing lines. Can be applied to LineBuilder via with_style().

LineStyleSpec thick_black{Color::Black, DotPixel::Pixel3x3, LineStyle::Solid};
display.draw(display.line().from({10, 10}).to({100, 10}).with_style(thick_black).build());
#pragma once
namespace epaper {
struct LineStyleSpec {
constexpr LineStyleSpec(Color c, DotPixel w = DotPixel::Pixel1x1, LineStyle s = LineStyle::Solid) noexcept
: color(c), width(w), style(s) {}
};
struct ShapeStyleSpec {
constexpr ShapeStyleSpec(Color c, DotPixel w = DotPixel::Pixel1x1, DrawFill f = DrawFill::Empty) noexcept
: color(c), border_width(w), fill(f) {}
};
struct TextStyleSpec {
const Font *font;
constexpr TextStyleSpec(const Font *f, Color fg, Color bg) noexcept : font(f), foreground(fg), background(bg) {}
};
} // namespace epaper
Bitmap font rendering for e-paper displays.
Definition color.hpp:5
DrawFill
Definition types.hpp:151
@ Empty
Draw outline only (border with no fill)
DotPixel
Definition types.hpp:92
@ Pixel1x1
Single pixel (finest resolution)
Color
Definition types.hpp:32
LineStyle
Definition types.hpp:120
@ Solid
Continuous solid line.
DotPixel width
Line width.
Definition styles.hpp:70
Color color
Line color.
Definition styles.hpp:69
LineStyle style
Line style (solid/dotted)
Definition styles.hpp:71
Color color
Shape color.
Definition styles.hpp:97
DotPixel border_width
Border width.
Definition styles.hpp:98
DrawFill fill
Fill mode (empty/full)
Definition styles.hpp:99
Color background
Background color.
Definition styles.hpp:127
Color foreground
Foreground (text) color.
Definition styles.hpp:126
const Font * font
Font to use for rendering.
Definition styles.hpp:125