|
tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
|
Immutable vector path — a sequence of lines, quadratics, and cubics. More...
#include <tiny_skia/Path.h>
Public Member Functions | |
| Rect | bounds () const |
| Axis-aligned bounding box (control-point bounds). | |
| std::optional< Path > | transform (const Transform &ts) const |
| Returns a transformed copy. Nullopt if the transform produces non-finite values. | |
| std::optional< Rect > | computeTightBounds () const |
| Computes tight bounds by finding curve extrema (more precise than bounds()). | |
| PathBuilder | clear () |
| Clears the path and returns a PathBuilder reusing the allocations. | |
| std::optional< Path > | stroke (const Stroke &stroke, float resScale) const |
| Generates a filled path representing the stroke outline. | |
| std::optional< Path > | dash (const StrokeDash &dash, float resScale) const |
| Applies a dash pattern, returning a new dashed path. | |
Static Public Member Functions | |
| static Path | fromRect (const Rect &rect) |
| Creates a rectangular path. | |
| static std::optional< Path > | fromCircle (float cx, float cy, float r) |
| Creates a circular path. Returns nullopt for non-positive radius. | |
Build with PathBuilder or use the static factories (fromRect, fromCircle). Paths are immutable once constructed; use Path::clear() to recycle into a new PathBuilder.