|
tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
|
Drawing surface backed by a mutable pixel buffer. More...
#include <tiny_skia/Canvas.h>
Public Member Functions | |
| Canvas (MutablePixmapView view) | |
| Constructs a Canvas from a mutable view. | |
| Canvas (Pixmap &pixmap) | |
| Constructs a Canvas from an owned Pixmap. | |
| void | fillRect (const Rect &rect, const Paint &paint, Transform transform=Transform::identity(), const Mask *mask=nullptr) |
| Fills an axis-aligned rectangle. | |
| void | fillPath (const Path &path, const Paint &paint, FillRule fillRule, Transform transform=Transform::identity(), const Mask *mask=nullptr) |
| Fills a path using the given fill rule. | |
| void | strokePath (const Path &path, const Paint &paint, const Stroke &stroke, Transform transform=Transform::identity(), const Mask *mask=nullptr) |
| Strokes a path with the given stroke settings. | |
| void | drawPixmap (std::int32_t x, std::int32_t y, PixmapView src, const PixmapPaint &paint, Transform transform=Transform::identity(), const Mask *mask=nullptr) |
| Composites a source pixmap onto this canvas at offset (x, y). | |
| void | applyMask (const Mask &mask) |
| Applies a mask to already-drawn content. | |
Canvas wraps a MutablePixmapView (or a Pixmap) and provides the primary drawing API: fillRect, fillPath, strokePath, drawPixmap, and applyMask.