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

Drawing primitives and the pixel surface concept. More...

Classes

class  canvas
 A drawing view bundling a pixel surface with the drawing primitives. More...
 

Concepts

concept  pixel_surface
 A drawable two-dimensional pixel surface.
 

Functions

template<pixel_surface Surface>
void fill_rect (Surface &surface, size_t x, size_t y, size_t width, size_t height, typename Surface::pixel_type ink) noexcept
 Fills a rectangle with the given ink.
 
template<pixel_surface Surface>
void draw_hline (Surface &surface, size_t x, size_t y, size_t length, typename Surface::pixel_type ink) noexcept
 Draws a horizontal line with the given ink.
 
template<pixel_surface Surface>
void draw_vline (Surface &surface, size_t x, size_t y, size_t length, typename Surface::pixel_type ink) noexcept
 Draws a vertical line with the given ink.
 
template<pixel_surface Surface>
void draw_rect (Surface &surface, size_t x, size_t y, size_t width, size_t height, typename Surface::pixel_type ink) noexcept
 Outlines a rectangle with the given ink.
 
template<pixel_surface Surface>
void draw_line (Surface &surface, size_t x0, size_t y0, size_t x1, size_t y1, typename Surface::pixel_type ink) noexcept
 Draws a straight line between two points with the given ink.
 
template<pixel_surface Surface>
void draw_text (Surface &surface, const font::mono_font &font, size_t x, size_t y, std::string_view text, typename Surface::pixel_type ink, unsigned scale=1) noexcept
 Draws text with the given ink.
 
template<pixel_surface Surface>
requires std::same_as<typename Surface::pixel_type, bool>
void draw_text (Surface &surface, const font::mono_font &font, size_t x, size_t y, std::string_view text) noexcept
 Draws text on a monochrome surface, setting glyph ink pixels.
 
template<pixel_surface Surface, typename Dest , typename DrawFn >
requires banded_renderable<Surface, Dest, DrawFn>
void render_banded (Surface &band, Dest &dest, size_t frame_height, DrawFn &&draw)
 Renders a frame taller than its framebuffer, band by band.
 
template<pixel_surface Surface, typename Dest , typename DrawFn >
requires banded_renderable<Surface, Dest, DrawFn>
result< void > try_render_banded (Surface &band, Dest &dest, size_t frame_height, DrawFn &&draw)
 Renders a frame taller than its framebuffer, band by band.
 

Detailed Description

Drawing primitives and the pixel surface concept.