14#include <egt/detail/meta.h>
15#include <egt/geometry.h>
53 PixelFormat format = PixelFormat::argb8888)
noexcept;
64 PixelFormat format = PixelFormat::argb8888)
noexcept;
Manages a unique drawing surface and context.
Definition canvas.h:41
void zero()
Fill the surface with zero (including for transparency channel if applicable).
void reallocate(const SizeF &size, PixelFormat format=PixelFormat::argb8888)
Reallocate the canvas to a different size.
void copy(const shared_cairo_surface_t &surface, const RectF &rect)
void reallocate(const Size &size, PixelFormat format=PixelFormat::argb8888)
Reallocate the canvas to a different size.
Canvas(const shared_cairo_surface_t &surface, PixelFormat format) noexcept
Construct a canvas with an already existing surface, and specify the format of the surface the canvas...
shared_cairo_t m_cr
The context of the canvas.
Definition canvas.h:147
void copy(const shared_cairo_surface_t &surface)
Create a copy of a surface.
Canvas(const SizeF &size, PixelFormat format=PixelFormat::argb8888) noexcept
Construct a canvas with the specified format and size.
EGT_NODISCARD Size size() const
Get the size of the surface.
EGT_NODISCARD PixelFormat format() const
Get the format of the surface.
EGT_NODISCARD shared_cairo_surface_t surface() const
Get the surface for the Canvas.
Definition canvas.h:94
EGT_NODISCARD shared_cairo_t context() const
Get the context for the Canvas.
Definition canvas.h:89
Canvas(const Size &size, PixelFormat format=PixelFormat::argb8888) noexcept
Construct a canvas with the specified format and size.
Canvas(const shared_cairo_surface_t &surface) noexcept
Construct a canvas with an already existing surface.
shared_cairo_surface_t m_surface
The surface of the canvas.
Definition canvas.h:142
A rectangle with a point and a size.
Definition geometry.h:595
std::shared_ptr< cairo_surface_t > shared_cairo_surface_t
Shared pointer for a cairo surface.
Definition types.h:29
std::shared_ptr< cairo_t > shared_cairo_t
Shared pointer for a cairo context.
Definition types.h:35
PixelFormat
Supported pixel formats.
Definition types.h:94
EGT framework namespace.
Definition animation.h:24