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 | List of all members
epaper::Display< DriverT, FramebufferT > Class Template Reference

#include <display.hpp>

Public Member Functions

 Display (DriverT driver, DisplayMode mode, Orientation orientation=Orientation::Portrait0, bool auto_sleep=true)
 
 Display (const Display &)=delete
 
auto operator= (const Display &) -> Display &=delete
 
 Display (Display &&) noexcept=default
 
auto operator= (Display &&) noexcept -> Display &=default
 
 ~Display ()=default
 
auto width () const noexcept -> std::size_t
 
auto height () const noexcept -> std::size_t
 
auto effective_width () const noexcept -> std::size_t
 
auto effective_height () const noexcept -> std::size_t
 
auto mode () const noexcept -> DisplayMode
 
auto orientation () const noexcept -> Orientation
 
auto auto_sleep_enabled () const noexcept -> bool
 
auto set_auto_sleep (bool enabled) noexcept -> void
 
auto is_color () const noexcept -> bool
 
auto get_num_planes () const noexcept -> std::size_t
 
auto available_colors () const -> std::vector< Color >
 
auto set_pixel (std::size_t x, std::size_t y, Color color) -> void
 
auto get_pixel (std::size_t x, std::size_t y) const -> Color
 
auto clear (Color color=Color::White) -> void
 
auto line () -> LineBuilder
 
auto rectangle () -> RectangleBuilder
 
auto circle () -> CircleBuilder
 
auto point () -> PointBuilder
 
auto text (std::string_view content="") -> TextBuilder
 
auto draw (const LineCommand &cmd) -> void
 
auto draw (const RectangleCommand &cmd) -> void
 
auto draw (const CircleCommand &cmd) -> void
 
auto draw (const PointCommand &cmd) -> void
 
auto draw (const TextCommand &cmd) -> void
 
auto draw_bitmap (std::size_t x, std::size_t y, std::span< const std::uint8_t > data, std::size_t w, std::size_t h, std::size_t target_w=0, std::size_t target_h=0) -> void
 
auto draw_bitmap (std::size_t x, std::size_t y, std::span< const Color > data, std::size_t w, std::size_t h, std::size_t target_w=0, std::size_t target_h=0) -> void
 
template<typename T >
auto draw_bitmap (std::size_t x, std::size_t y, const std::vector< T > &data, std::size_t w, std::size_t h, std::size_t target_w=0, std::size_t target_h=0) -> void
 
auto draw_bitmap_from_file (std::size_t x, std::size_t y, std::string_view file_path, std::size_t target_width=0, std::size_t target_height=0) -> std::expected< void, Error >
 
auto save_framebuffer_to_png (std::string_view filename) const -> std::expected< void, Error >
 
auto refresh () -> std::expected< void, Error >
 Refresh the display by transferring framebuffer to hardware.
 
auto sleep () -> std::expected< void, Error >
 
auto wake () -> std::expected< void, Error >
 
auto power_off () -> std::expected< void, Error >
 
auto power_on () -> std::expected< void, Error >
 
auto supports_wake () const noexcept -> bool
 
auto supports_power_control () const noexcept -> bool
 
auto driver () -> DriverT &
 
auto driver () const -> const DriverT &
 
auto framebuffer () -> FramebufferT &
 
auto framebuffer () const -> const FramebufferT &
 

Constructor & Destructor Documentation

◆ Display() [1/3]

template<Driver DriverT, FramebufferLike FramebufferT>
epaper::Display< DriverT, FramebufferT >::Display ( DriverT  driver,
DisplayMode  mode,
Orientation  orientation = Orientation::Portrait0,
bool  auto_sleep = true 
)
inline

◆ Display() [2/3]

template<Driver DriverT, FramebufferLike FramebufferT>
epaper::Display< DriverT, FramebufferT >::Display ( const Display< DriverT, FramebufferT > &  )
delete

◆ Display() [3/3]

template<Driver DriverT, FramebufferLike FramebufferT>
epaper::Display< DriverT, FramebufferT >::Display ( Display< DriverT, FramebufferT > &&  )
defaultnoexcept

◆ ~Display()

template<Driver DriverT, FramebufferLike FramebufferT>
epaper::Display< DriverT, FramebufferT >::~Display ( )
default

Member Function Documentation

◆ auto_sleep_enabled()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::auto_sleep_enabled ( ) const -> bool
inlinenoexcept

◆ available_colors()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::available_colors ( ) const -> std::vector<Color>
inline
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:

◆ circle()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::circle ( ) -> CircleBuilder
inline

◆ clear()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::clear ( Color  color = Color::White) -> void
inline

◆ draw() [1/5]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw ( const CircleCommand cmd) -> void
inline
Here is the call graph for this function:

◆ draw() [2/5]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw ( const LineCommand cmd) -> void
inline
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:

◆ draw() [3/5]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw ( const PointCommand cmd) -> void
inline

◆ draw() [4/5]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw ( const RectangleCommand cmd) -> void
inline
Here is the call graph for this function:

◆ draw() [5/5]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw ( const TextCommand cmd) -> void
inline
Here is the call graph for this function:

◆ draw_bitmap() [1/3]

template<Driver DriverT, FramebufferLike FramebufferT>
template<typename T >
auto epaper::Display< DriverT, FramebufferT >::draw_bitmap ( std::size_t  x,
std::size_t  y,
const std::vector< T > &  data,
std::size_t  w,
std::size_t  h,
std::size_t  target_w = 0,
std::size_t  target_h = 0 
) -> void
inline
Here is the call graph for this function:

◆ draw_bitmap() [2/3]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw_bitmap ( std::size_t  x,
std::size_t  y,
std::span< const Color data,
std::size_t  w,
std::size_t  h,
std::size_t  target_w = 0,
std::size_t  target_h = 0 
) -> void
inline
Here is the call graph for this function:

◆ draw_bitmap() [3/3]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw_bitmap ( std::size_t  x,
std::size_t  y,
std::span< const std::uint8_t >  data,
std::size_t  w,
std::size_t  h,
std::size_t  target_w = 0,
std::size_t  target_h = 0 
) -> void
inline
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_bitmap_from_file()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::draw_bitmap_from_file ( std::size_t  x,
std::size_t  y,
std::string_view  file_path,
std::size_t  target_width = 0,
std::size_t  target_height = 0 
) -> std::expected<void, Error>
inline
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:

◆ driver() [1/2]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::driver ( ) -> DriverT &
inline

◆ driver() [2/2]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::driver ( ) const -> const DriverT &
inline

◆ effective_height()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::effective_height ( ) const -> std::size_t
inlinenoexcept
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:

◆ effective_width()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::effective_width ( ) const -> std::size_t
inlinenoexcept
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:

◆ framebuffer() [1/2]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::framebuffer ( ) -> FramebufferT &
inline

◆ framebuffer() [2/2]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::framebuffer ( ) const -> const FramebufferT &
inline

◆ get_num_planes()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::get_num_planes ( ) const -> std::size_t
inlinenoexcept
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_pixel()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::get_pixel ( std::size_t  x,
std::size_t  y 
) const -> Color
inline

◆ height()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::height ( ) const -> std::size_t
inlinenoexcept
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the caller graph for this function:

◆ is_color()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::is_color ( ) const -> bool
inlinenoexcept
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ line()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::line ( ) -> LineBuilder
inline

◆ mode()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::mode ( ) const -> DisplayMode
inlinenoexcept
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the caller graph for this function:

◆ operator=() [1/2]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::operator= ( const Display< DriverT, FramebufferT > &  ) -> Display &=delete
delete

◆ operator=() [2/2]

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::operator= ( Display< DriverT, FramebufferT > &&  ) -> Display &=default
defaultnoexcept

◆ orientation()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::orientation ( ) const -> Orientation
inlinenoexcept

◆ point()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::point ( ) -> PointBuilder
inline

◆ power_off()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::power_off ( ) -> std::expected<void, Error>
inline

◆ power_on()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::power_on ( ) -> std::expected<void, Error>
inline

◆ rectangle()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::rectangle ( ) -> RectangleBuilder
inline

◆ refresh()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::refresh ( ) -> std::expected<void, Error>
inline

Refresh the display by transferring framebuffer to hardware.

Executes the following sequence:

  1. Wake driver from sleep (if auto_sleep_enabled)
  2. Transfer framebuffer data via SPI
  3. Trigger display update (hardware-specific timing)
  4. Return to sleep mode (if auto_sleep_enabled)
Returns
void on success, Error on failure (transfer/timeout/driver errors)
Note
This operation blocks until the display refresh completes. Refresh time varies by driver and mode (typically 1-15 seconds).
Precondition
Display must be initialized via create_display()
Postcondition
Framebuffer contents are visible on physical display
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:

◆ save_framebuffer_to_png()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::save_framebuffer_to_png ( std::string_view  filename) const -> std::expected<void, Error>
inline
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the call graph for this function:

◆ set_auto_sleep()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::set_auto_sleep ( bool  enabled) -> void
inlinenoexcept

◆ set_pixel()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::set_pixel ( std::size_t  x,
std::size_t  y,
Color  color 
) -> void
inline
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the caller graph for this function:

◆ sleep()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::sleep ( ) -> std::expected<void, Error>
inline

◆ supports_power_control()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::supports_power_control ( ) const -> bool
inlinenoexcept

◆ supports_wake()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::supports_wake ( ) const -> bool
inlinenoexcept

◆ text()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::text ( std::string_view  content = "") -> TextBuilder
inline

◆ wake()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::wake ( ) -> std::expected<void, Error>
inline

◆ width()

template<Driver DriverT, FramebufferLike FramebufferT>
auto epaper::Display< DriverT, FramebufferT >::width ( ) const -> std::size_t
inlinenoexcept
Examples
/mnt/nas/libepaper/include/epaper/core/display.hpp.
Here is the caller graph for this function:

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