idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::gfx::pixel_surface Concept Reference

A drawable two-dimensional pixel surface. More...

Concept definition

template<typename S>
concept idfxx::gfx::pixel_surface = requires(S& s, const S& cs, size_t x, size_t y, typename S::pixel_type pixel) {
typename S::pixel_type;
{ s.set_pixel(x, y, pixel) } noexcept;
{ cs.width() } -> std::convertible_to<size_t>;
{ cs.height() } -> std::convertible_to<size_t>;
}
A drawable two-dimensional pixel surface.
Definition gfx.hpp:71

Detailed Description

A drawable two-dimensional pixel surface.

A pixel surface names its pixel value type (pixel_type), reports its dimensions, and accepts pixel writes at (x, y) coordinates with (0, 0) the top-left corner. Writes outside [0, width()) x [0, height()) must be ignored; drawing functions rely on this for clipping.

idfxx::lcd::mono_framebuffer (pixel_type = bool) and idfxx::lcd::rgb565_framebuffer (pixel_type = idfxx::lcd::rgb565) both satisfy this concept.

Template Parameters
SThe surface type.

Definition at line 71 of file gfx.hpp.