16#ifndef AEONGUI_CANVAS_H
17#define AEONGUI_CANVAS_H
24#include "aeongui/DrawType.hpp"
25#include "aeongui/Color.hpp"
26#include "aeongui/Attribute.hpp"
27#include "aeongui/Matrix2x3.hpp"
28#include "aeongui/TextLayout.hpp"
135 double aOpacity ) = 0;
145 virtual void DrawText (
const std::string& aText,
double aX,
double aY,
146 const std::string& aFontFamily,
double aFontSize,
147 int aFontWeight,
int aFontStyle ) = 0;
157 const std::string& aFontFamily,
double aFontSize,
158 int aFontWeight,
int aFontStyle )
const = 0;
Abstract 2D rendering surface.
Definition Canvas.hpp:39
virtual double GetOpacity() const =0
Get the current global opacity.
virtual size_t GetStride() const =0
Get the stride (bytes per row) of the pixel buffer.
virtual const uint8_t * GetPixels() const =0
Get a pointer to the raw pixel data.
virtual const ColorAttr & GetFillColor() const =0
Get the current fill color.
virtual void SetStrokeColor(const ColorAttr &aColor)=0
Set the stroke color.
virtual void SetOpacity(double aWidth)=0
Set the global opacity.
virtual void Draw(const Path &aPath)=0
Draw a path using the current fill and stroke settings.
virtual double GetFillOpacity() const =0
Get the current fill opacity.
virtual ~Canvas()=0
Virtual destructor.
virtual void Transform(const Matrix2x3 &aMatrix)=0
Pre-multiply the current transformation matrix.
virtual void * GetNativeSurface() const =0
Get the native rendering surface handle.
virtual size_t GetWidth() const =0
Get the width of the canvas in pixels.
virtual double GetStrokeOpacity() const =0
Get the current stroke opacity.
virtual double GetStrokeWidth() const =0
Get the current stroke width.
virtual void SetStrokeWidth(double aWidth)=0
Set the stroke width.
virtual void ResizeViewport(uint32_t aWidth, uint32_t aHeight)=0
Resize the rendering viewport.
virtual size_t GetHeight() const =0
Get the height of the canvas in pixels.
virtual void SetViewBox(const ViewBox &aViewBox, const PreserveAspectRatio &aPreserveAspectRatio)=0
Set the SVG viewBox and preserveAspectRatio.
virtual void SetFillOpacity(double aWidth)=0
Set the fill opacity.
virtual void Clear()=0
Clear the canvas to transparent.
virtual void SetFillColor(const ColorAttr &aColor)=0
Set the fill color.
virtual void DrawImage(const uint8_t *aPixels, size_t aImageWidth, size_t aImageHeight, size_t aImageStride, double aX, double aY, double aWidth, double aHeight, double aOpacity)=0
Draw a raster image.
virtual const ColorAttr & GetStrokeColor() const =0
Get the current stroke color.
virtual void DrawText(const std::string &aText, double aX, double aY, const std::string &aFontFamily, double aFontSize, int aFontWeight, int aFontStyle)=0
virtual void SetStrokeOpacity(double aWidth)=0
Set the stroke opacity.
virtual void SetTransform(const Matrix2x3 &aMatrix)=0
Replace the current transformation matrix.
virtual double MeasureText(const std::string &aText, const std::string &aFontFamily, double aFontSize, int aFontWeight, int aFontStyle) const =0
2x3 affine transformation matrix.
Definition Matrix2x3.hpp:37
Abstract base class for renderable path data.
Definition Path.hpp:32
SVG preserveAspectRatio attribute.
Definition Attribute.hpp:44
SVG viewBox attribute value.
Definition Attribute.hpp:31