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
framebuffer_concepts.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <concepts>
5#include <cstddef>
6#include <span>
7#include <vector>
8
9namespace epaper {
10
11// Forward declarations
12enum class DisplayMode : std::uint8_t;
13enum class Color : std::uint8_t;
14enum class Orientation : std::uint8_t;
15
59template <typename T>
61 requires(T fb, const T const_fb, std::size_t x, std::size_t y, Color color, Orientation orientation) {
66 { fb.width() } -> std::same_as<std::size_t>;
67
72 { fb.height() } -> std::same_as<std::size_t>;
73
78 { fb.mode() } -> std::same_as<DisplayMode>;
79
84 { const_fb.data() } -> std::same_as<std::span<const std::byte>>;
85
90 { const_fb.get_planes() } -> std::same_as<std::vector<std::span<const std::byte>>>;
91
99 { fb.set_pixel(x, y, color, orientation) } -> std::same_as<void>;
100
108 { const_fb.get_pixel(x, y, orientation) } -> std::same_as<Color>;
109
114 { fb.clear(color) } -> std::same_as<void>;
115 };
116
117} // namespace epaper
Definition framebuffer_concepts.hpp:60
Definition color.hpp:5
Orientation
Definition types.hpp:66
Color
Definition types.hpp:32
DisplayMode
Definition driver.hpp:46