|
AeonGUI
A portable video game graphic user interface library.
|
Cairo-backed Canvas implementation. More...
#include <aeongui/CairoCanvas.hpp>
Public Member Functions | |
| CairoCanvas () | |
| Default constructor. Creates an empty canvas. | |
| CairoCanvas (uint32_t aWidth, uint32_t aHeight) | |
| Construct a canvas with the given viewport size. | |
| ~CairoCanvas () final | |
| Destructor. Releases Cairo resources. | |
| void | ResizeViewport (uint32_t aWidth, uint32_t aHeight) final |
| Resize the rendering viewport. | |
| const uint8_t * | GetPixels () const final |
| Get a pointer to the raw pixel data. | |
| size_t | GetWidth () const final |
| Get the width of the canvas in pixels. | |
| size_t | GetHeight () const final |
| Get the height of the canvas in pixels. | |
| size_t | GetStride () const final |
| Get the stride (bytes per row) of the pixel buffer. | |
| void | Clear () final |
| Clear the canvas to transparent. | |
| void | Draw (const Path &aPath) final |
| Draw a path using the current fill and stroke settings. | |
| 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) final |
| Draw a raster image. | |
| void | DrawText (const std::string &aText, double aX, double aY, const std::string &aFontFamily, double aFontSize, int aFontWeight, int aFontStyle) final |
| double | MeasureText (const std::string &aText, const std::string &aFontFamily, double aFontSize, int aFontWeight, int aFontStyle) const final |
| void | SetFillColor (const ColorAttr &aColor) final |
| Set the fill color. | |
| const ColorAttr & | GetFillColor () const final |
| Get the current fill color. | |
| void | SetStrokeColor (const ColorAttr &aColor) final |
| Set the stroke color. | |
| const ColorAttr & | GetStrokeColor () const final |
| Get the current stroke color. | |
| void | SetStrokeWidth (double aWidth) final |
| Set the stroke width. | |
| double | GetStrokeWidth () const final |
| Get the current stroke width. | |
| void | SetStrokeOpacity (double aWidth) final |
| Set the stroke opacity. | |
| double | GetStrokeOpacity () const final |
| Get the current stroke opacity. | |
| void | SetFillOpacity (double aWidth) final |
| Set the fill opacity. | |
| double | GetFillOpacity () const final |
| Get the current fill opacity. | |
| void | SetOpacity (double aWidth) final |
| Set the global opacity. | |
| double | GetOpacity () const final |
| Get the current global opacity. | |
| void | SetViewBox (const ViewBox &aViewBox, const PreserveAspectRatio &aPreserveAspectRatio) final |
| Set the SVG viewBox and preserveAspectRatio. | |
| void | SetTransform (const Matrix2x3 &aMatrix) final |
| Replace the current transformation matrix. | |
| void | Transform (const Matrix2x3 &aMatrix) final |
| Pre-multiply the current transformation matrix. | |
| void * | GetNativeSurface () const final |
| Get the native rendering surface handle. | |
| Public Member Functions inherited from AeonGUI::Canvas | |
| virtual | ~Canvas ()=0 |
| Virtual destructor. | |
Cairo-backed Canvas implementation.
Provides software rasterization of paths, images, and text using the Cairo 2D graphics library.
| AeonGUI::CairoCanvas::CairoCanvas | ( | uint32_t | aWidth, |
| uint32_t | aHeight ) |
Construct a canvas with the given viewport size.
| aWidth | Initial width in pixels. |
| aHeight | Initial height in pixels. |
|
finalvirtual |
Clear the canvas to transparent.
Implements AeonGUI::Canvas.
|
finalvirtual |
Draw a path using the current fill and stroke settings.
| aPath | The path to draw. |
Implements AeonGUI::Canvas.
|
finalvirtual |
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]. |
Implements AeonGUI::Canvas.
|
finalvirtual |
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. |
Implements AeonGUI::Canvas.
|
finalvirtual |
|
finalvirtual |
|
finalvirtual |
|
finalvirtual |
Get the native rendering surface handle.
Implements AeonGUI::Canvas.
|
finalvirtual |
|
finalvirtual |
Get a pointer to the raw pixel data.
Implements AeonGUI::Canvas.
|
finalvirtual |
Get the stride (bytes per row) of the pixel buffer.
Implements AeonGUI::Canvas.
|
finalvirtual |
Get the current stroke color.
Implements AeonGUI::Canvas.
|
finalvirtual |
|
finalvirtual |
|
finalvirtual |
|
finalvirtual |
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). |
Implements AeonGUI::Canvas.
|
finalvirtual |
Resize the rendering viewport.
| aWidth | New width in pixels. |
| aHeight | New height in pixels. |
Implements AeonGUI::Canvas.
|
finalvirtual |
|
finalvirtual |
Set the fill opacity.
| aWidth | Opacity value in the range [0.0, 1.0]. |
Implements AeonGUI::Canvas.
|
finalvirtual |
Set the global opacity.
| aWidth | Opacity value in the range [0.0, 1.0]. |
Implements AeonGUI::Canvas.
|
finalvirtual |
|
finalvirtual |
Set the stroke opacity.
| aWidth | Opacity value in the range [0.0, 1.0]. |
Implements AeonGUI::Canvas.
|
finalvirtual |
|
finalvirtual |
Replace the current transformation matrix.
| aMatrix | The new 2x3 transformation matrix. |
Implements AeonGUI::Canvas.
|
finalvirtual |
Set the SVG viewBox and preserveAspectRatio.
| aViewBox | The viewBox rectangle. |
| aPreserveAspectRatio | How to align and scale. |
Implements AeonGUI::Canvas.
|
finalvirtual |
Pre-multiply the current transformation matrix.
| aMatrix | The matrix to concatenate. |
Implements AeonGUI::Canvas.