// Generated API outline. Implementation bodies omitted.
#nullable enable
using G16 = ushort;
using RGBA = uint;
using System.ComponentModel;
using System.Diagnostics;
using nfloat = System.Runtime.InteropServices.NFloat;
namespace Xui.Runtime.Software.Tessellate
{
using System.Collections.Generic;
using Xui.Core.Math2D;
///
/// Represents a full tessellation pipeline result, including intermediate geometric representations.
/// Used for visual debugging, documentation, and rendering filled polygons from vector paths.
///
public partial class PathTesselator
{
///
/// Represents a closed contour — a sequence of connected points forming a polygon loop.
///
public readonly struct ClosedContour
{
///
/// Ordered list of points forming the closed contour path.
///
public readonly IReadOnlyList Points;
///
/// Initializes a new closed contour from a sequence of points.
///
public ClosedContour(IReadOnlyList points);
///
/// Returns the number of points in this contour.
///
public int Count { get; }
///
/// Indexer access to individual points.
///
public Point this[int index] { get; }
public enum WindingDirection
{
Clockwise,
CounterClockwise
}
public WindingDirection Winding { get; }
public Rect Bounds { get; }
public nfloat SignedArea { get; }
}
}
}
namespace Xui.Runtime.Software.Tessellate
{
using System.Collections.Generic;
using Xui.Core.Canvas;
using Xui.Core.Curves2D;
using Xui.Core.Math2D;
///
/// Represents a full tessellation pipeline result, including intermediate geometric representations.
/// Used for visual debugging, documentation, and rendering filled polygons from vector paths.
///
public partial class PathTesselator
{
public class Contouring : IPathBuilder
{
public IReadOnlyList Contours { get; }
public Contouring();
public Contouring(nfloat precision);
public List Result { get; }
public static IReadOnlyList ContourPath(Path2D path, nfloat precision);
public void BeginPath();
public void MoveTo(Point to);
public void LineTo(Point to);
public void CurveTo(Point cp1, Point cp2, Point to);
public void CurveTo(Point control, Point to);
public void Arc(Point center, nfloat radius, nfloat startAngle, nfloat endAngle, Winding winding = Winding.ClockWise);
public void Ellipse(Point center, nfloat rx, nfloat ry, nfloat rotation, nfloat startAngle, nfloat endAngle, Winding winding = Winding.ClockWise);
public void ArcTo(Point cp1, Point cp2, nfloat radius);
public void Rect(Rect rect);
public void RoundRect(Rect rect, nfloat radius);
public void RoundRect(Rect rect, CornerRadius radius);
public void ClosePath();
}
}
}
namespace Xui.Runtime.Software.Tessellate
{
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Xui.Core.Canvas;
using Xui.Core.Math2D;
///
/// Represents a full tessellation pipeline result, including intermediate geometric representations.
/// Used for visual debugging, documentation, and rendering filled polygons from vector paths.
///
public partial class PathTesselator
{
public partial class ScanlineSweep
{
public static List Fill(IReadOnlyList contours, FillRule fillRule);
public static void SweepAndEmitTrapezoids(IReadOnlyList contours, FillRule fillRule, List outputTriangles);
///
/// Extracts all closed, non-intersecting loops from a set of directed edges.
/// Each loop is returned as a ClosedContour.
///
public static List ExtractLoops(List edges);
public readonly struct Edge
{
public readonly Point Start;
public readonly Point End;
public readonly nfloat XAtYMin;
public readonly nfloat SlopeInv;
public readonly nfloat YMin;
public readonly nfloat YMax;
public readonly int Winding;
public Edge(Point a, Point b);
public nfloat XAt(nfloat y);
}
}
}
}
namespace Xui.Runtime.Software.Tessellate
{
using System.Collections.Generic;
using Xui.Core.Canvas;
///
/// Represents a full tessellation pipeline result, including intermediate geometric representations.
/// Used for visual debugging, documentation, and rendering filled polygons from vector paths.
///
public partial class PathTesselator
{
public PathTesselator(IReadOnlyList contours, List polygons);
///
/// Gets the list of closed contours reconstructed from the segments.
/// Each contour represents a loop used in fill evaluation.
///
public IReadOnlyList Contours { get; }
///
/// Gets the final list of filled triangle polygons that represent the tessellated shape.
///
public List Polygons { get; }
///
/// Performs full tessellation of a vector path into filled triangle polygons using a specified fill rule.
/// Intermediate data including segments, contours, and trapezoids is retained for debugging or visualization.
///
/// The vector path to tessellate.
/// The fill rule (EvenOdd or NonZero) to apply during sweep.
/// The curve flattening tolerance. Smaller values yield more segments.
/// A instance containing all stages of the tessellation pipeline.
public static PathTesselator Fill(Path2D path, FillRule fillRule, nfloat flatness);
public static PathTesselator Fill(Path2D path, FillRule fillRule);
}
}
namespace Xui.Runtime.Software.Tessellate
{
using System.Collections.Generic;
using System.Collections;
using Xui.Core.Math2D;
///
/// Represents a triangle polygon used during path tessellation.
///
public readonly struct Polygon : IEnumerable
{
public readonly Point A;
public readonly Point B;
public readonly Point C;
public Polygon(Point a, Point b, Point c);
public IEnumerator GetEnumerator();
}
public readonly struct Trapezoid : IEnumerable
{
public readonly Point A;
public readonly Point B;
public readonly Point C;
public readonly Point D;
public Trapezoid(Point a, Point b, Point c, Point d);
public Polygon Polygon1 { get; }
public Polygon Polygon2 { get; }
public IEnumerator GetEnumerator();
}
}