#pragma once #include #include #include #include #include namespace ui { /** * @brief A drawable surface. */ struct Canvas { int width; int height; int stride; u8* ptr; static Canvas create(u8* ptr, int width, int height); Result subcanvas(Point begin, int width, int height, bool clamp); Rect rect() { return Rect { .begin = { 0, 0 }, .width = width, .height = height }; } void fill(Color color); }; };