|
AeonGUI
A portable video game graphic user interface library.
|
Abstract 2D rendering surface. More...
#include <aeongui/Canvas.hpp>
Public Member Functions | |
| virtual void | ResizeViewport (uint32_t aWidth, uint32_t aHeight)=0 |
| Resize the rendering viewport. | |
| virtual const uint8_t * | GetPixels () const =0 |
| Get a pointer to the raw pixel data. | |
| virtual size_t | GetWidth () const =0 |
| Get the width of the canvas in pixels. | |
| virtual size_t | GetHeight () const =0 |
| Get the height of the canvas in pixels. | |
| virtual size_t | GetStride () const =0 |
| Get the stride (bytes per row) of the pixel buffer. | |
| virtual void | Clear ()=0 |
| Clear the canvas to transparent. | |
| virtual void | SetFillColor (const ColorAttr &aColor)=0 |
| Set the fill color. | |
| virtual const ColorAttr & | GetFillColor () const =0 |
| Get the current fill color. | |
| virtual void | SetStrokeColor (const ColorAttr &aColor)=0 |
| Set the stroke color. | |
| virtual const ColorAttr & | GetStrokeColor () const =0 |
| Get the current stroke color. | |
| virtual void | SetStrokeWidth (double aWidth)=0 |
| Set the stroke width. | |
| virtual double | GetStrokeWidth () const =0 |
| Get the current stroke width. | |
| virtual void | SetStrokeOpacity (double aWidth)=0 |
| Set the stroke opacity. | |
| virtual double | GetStrokeOpacity () const =0 |
| Get the current stroke opacity. | |
| virtual void | SetFillOpacity (double aWidth)=0 |
| Set the fill opacity. | |
| virtual double | GetFillOpacity () const =0 |
| Get the current fill opacity. | |
| virtual void | SetOpacity (double aWidth)=0 |
| Set the global opacity. | |
| virtual double | GetOpacity () const =0 |
| Get the current global opacity. | |
| virtual void | Draw (const Path &aPath)=0 |
| Draw a path using the current fill and stroke settings. | |
| 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 void | DrawText (const std::string &aText, double aX, double aY, const std::string &aFontFamily, double aFontSize, int aFontWeight, int aFontStyle)=0 |
| virtual double | MeasureText (const std::string &aText, const std::string &aFontFamily, double aFontSize, int aFontWeight, int aFontStyle) const =0 |
| virtual void | SetViewBox (const ViewBox &aViewBox, const PreserveAspectRatio &aPreserveAspectRatio)=0 |
| Set the SVG viewBox and preserveAspectRatio. | |
| virtual void | SetTransform (const Matrix2x3 &aMatrix)=0 |
| Replace the current transformation matrix. | |
| 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 | ~Canvas ()=0 |
| Virtual destructor. | |
Abstract 2D rendering surface.
Provides a pure virtual interface for drawing paths, images, and text onto a pixel buffer. Concrete implementations (e.g. CairoCanvas) supply the actual rendering back-end.
|
pure virtual |
Clear the canvas to transparent.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Draw a path using the current fill and stroke settings.
| aPath | The path to draw. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Draw a raster image.
| aPixels | Pointer to source BGRA pixel data. |
| aImageWidth | Width of the source image in pixels. |
| aImageHeight | Height of the source image in pixels. |
| aImageStride | Stride of the source image in bytes. |
| aX | Destination X coordinate. |
| aY | Destination Y coordinate. |
| aWidth | Destination width in user units. |
| aHeight | Destination height in user units. |
| aOpacity | Opacity for the image [0.0, 1.0]. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Draw text at the given position using the specified font description and size.
| aText | The UTF-8 text string to render. |
| aX | The x coordinate for the text start position. |
| aY | The y coordinate for the text baseline. |
| aFontFamily | Font family name (e.g. "sans-serif"). |
| aFontSize | Font size in CSS pixels. |
| aFontWeight | CSS font weight (400 = normal, 700 = bold). |
| aFontStyle | 0 = normal, 1 = italic, 2 = oblique. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Get the current fill color.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
|
pure virtual |
Get the height of the canvas in pixels.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Get the native rendering surface handle.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
|
pure virtual |
Get a pointer to the raw pixel data.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Get the stride (bytes per row) of the pixel buffer.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Get the current stroke color.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
|
pure virtual |
Get the current stroke width.
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
|
pure virtual |
Measure the width of text with the given font parameters.
| aText | The UTF-8 text string to measure. |
| aFontFamily | Font family name. |
| aFontSize | Font size in CSS pixels. |
| aFontWeight | CSS font weight. |
| aFontStyle | Font style (0=normal, 1=italic, 2=oblique). |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Resize the rendering viewport.
| aWidth | New width in pixels. |
| aHeight | New height in pixels. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
|
pure virtual |
Set the fill opacity.
| aWidth | Opacity value in the range [0.0, 1.0]. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Set the global opacity.
| aWidth | Opacity value in the range [0.0, 1.0]. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Set the stroke color.
| aColor | The stroke color to set. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Set the stroke opacity.
| aWidth | Opacity value in the range [0.0, 1.0]. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Set the stroke width.
| aWidth | The stroke width in user units. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Replace the current transformation matrix.
| aMatrix | The new 2x3 transformation matrix. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Set the SVG viewBox and preserveAspectRatio.
| aViewBox | The viewBox rectangle. |
| aPreserveAspectRatio | How to align and scale. |
Implemented in AeonGUI::CairoCanvas.
|
pure virtual |
Pre-multiply the current transformation matrix.
| aMatrix | The matrix to concatenate. |
Implemented in AeonGUI::CairoCanvas.