24 using surface_ptr = std::unique_ptr<cairo_surface_t, void(*)(cairo_surface_t*)>;
25 using context_ptr = std::unique_ptr<cairo_t, void(*)(cairo_t*)>;
28 constexpr cairo_format_t
format = CAIRO_FORMAT_ARGB32;
32 const auto& [width, height] =
size;
33 const int stride = cairo_format_stride_for_width(
format, width);
36 cairo_image_surface_create_for_data(buffer,
format, width, height, stride),
SDL_Surface * get() const
std::unique_ptr< cairo_surface_t, void(*)(cairo_surface_t *)> surface_ptr
context_ptr create_context(const surface_ptr &surf)
constexpr cairo_format_t format
Color format for cairo surfaces.
std::unique_ptr< cairo_t, void(*)(cairo_t *)> context_ptr
surface_ptr create_surface(uint8_t *buffer, const point &size)
std::size_t size(std::string_view str)
Length in characters of a UTF-8 string.