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 | Static Public Member Functions | List of all members
epaper::MonoFramebuffer Class Reference

#include <framebuffer.hpp>

Public Member Functions

 MonoFramebuffer (std::size_t width, std::size_t height, DisplayMode mode)
 Construct a mono framebuffer.
 
auto width () const -> std::size_t
 Get framebuffer width in pixels.
 
auto height () const -> std::size_t
 Get framebuffer height in pixels.
 
auto mode () const -> DisplayMode
 Get display mode represented by this framebuffer.
 
auto data () const -> std::span< const std::byte >
 Get raw buffer as a byte span.
 
auto get_planes () const -> std::vector< std::span< const std::byte > >
 Get plane spans (single plane for mono).
 
auto set_pixel (std::size_t x, std::size_t y, Color color, Orientation orientation) -> void
 Set a pixel with orientation transform.
 
auto get_pixel (std::size_t x, std::size_t y, Orientation orientation) const -> Color
 Get a pixel color with orientation transform.
 
auto clear (Color color) -> void
 Clear the framebuffer to a color.
 

Static Public Member Functions

static constexpr auto supports_mode (DisplayMode mode) noexcept -> bool
 Check if the mode is compatible with mono framebuffer.
 

Constructor & Destructor Documentation

◆ MonoFramebuffer()

epaper::MonoFramebuffer::MonoFramebuffer ( std::size_t  width,
std::size_t  height,
DisplayMode  mode 
)

Construct a mono framebuffer.

Parameters
widthFramebuffer width in pixels
heightFramebuffer height in pixels
modeDisplay mode (must be single-plane)
Here is the call graph for this function:

Member Function Documentation

◆ clear()

auto epaper::MonoFramebuffer::clear ( Color  color) -> void

Clear the framebuffer to a color.

Parameters
colorFill color
Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.
Here is the caller graph for this function:

◆ data()

auto epaper::MonoFramebuffer::data ( ) const -> std::span<const std::byte>

Get raw buffer as a byte span.

Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.

◆ get_pixel()

auto epaper::MonoFramebuffer::get_pixel ( std::size_t  x,
std::size_t  y,
Orientation  orientation 
) const -> Color

Get a pixel color with orientation transform.

Parameters
xX coordinate (logical)
yY coordinate (logical)
orientationDisplay orientation
Returns
Color at position
Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.
Here is the call graph for this function:

◆ get_planes()

auto epaper::MonoFramebuffer::get_planes ( ) const -> std::vector<std::span<const std::byte>>

Get plane spans (single plane for mono).

Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.

◆ height()

auto epaper::MonoFramebuffer::height ( ) const -> std::size_t

Get framebuffer height in pixels.

Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.

◆ mode()

auto epaper::MonoFramebuffer::mode ( ) const -> DisplayMode

Get display mode represented by this framebuffer.

Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.
Here is the caller graph for this function:

◆ set_pixel()

auto epaper::MonoFramebuffer::set_pixel ( std::size_t  x,
std::size_t  y,
Color  color,
Orientation  orientation 
) -> void

Set a pixel with orientation transform.

Parameters
xX coordinate (logical)
yY coordinate (logical)
colorColor to set
orientationDisplay orientation
Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.
Here is the call graph for this function:

◆ supports_mode()

static constexpr auto epaper::MonoFramebuffer::supports_mode ( DisplayMode  mode) -> bool
inlinestaticconstexprnoexcept

Check if the mode is compatible with mono framebuffer.

Parameters
modeDisplay mode
Returns
true if the mode is single-plane
Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.
Here is the call graph for this function:

◆ width()

auto epaper::MonoFramebuffer::width ( ) const -> std::size_t

Get framebuffer width in pixels.

Examples
/mnt/nas/libepaper/include/epaper/core/framebuffer.hpp.

The documentation for this class was generated from the following files: