tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
Loading...
Searching...
No Matches
tiny_skia::Path Class Reference

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< Pathtransform (const Transform &ts) const
 Returns a transformed copy. Nullopt if the transform produces non-finite values.
 
std::optional< RectcomputeTightBounds () 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< Pathstroke (const Stroke &stroke, float resScale) const
 Generates a filled path representing the stroke outline.
 
std::optional< Pathdash (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< PathfromCircle (float cx, float cy, float r)
 Creates a circular path. Returns nullopt for non-positive radius.
 

Detailed Description

Build with PathBuilder or use the static factories (fromRect, fromCircle). Paths are immutable once constructed; use Path::clear() to recycle into a new PathBuilder.


The documentation for this class was generated from the following file: