Search Results for

    Show / Hide Table of Contents

    Class ClippingFunctions

    Inheritance
    object
    ClippingFunctions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.Rendering.Skia.Functions
    Assembly: Mapsui.Rendering.Skia.dll
    Syntax
    public static class ClippingFunctions

    Methods

    | Edit this page View Source

    LiangBarskyClip(SKPoint, SKPoint, SKRect, out SKPoint, out SKPoint)

    A Liang-Barsky implementation to detect the intersection between a line and a rect. With this, all lines, that aren't visible on screen could be sorted out. Found at https://gist.github.com/ChickenProp/3194723

    Declaration
    public static ClippingFunctions.Intersection LiangBarskyClip(SKPoint point1, SKPoint point2, SKRect clipRect, out SKPoint intersectionPoint1, out SKPoint intersectionPoint2)
    Parameters
    Type Name Description
    SKPoint point1

    First point of line

    SKPoint point2

    Second point of line

    SKRect clipRect
    SKPoint intersectionPoint1

    First intersection point

    SKPoint intersectionPoint2

    Second intersection point

    Returns
    Type Description
    ClippingFunctions.Intersection
    | Edit this page View Source

    ReducePointsToClipRect(IEnumerable<Coordinate>?, Viewport, SKRect)

    Reduce list of points, so that all are inside of cliptRect See https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm

    Declaration
    public static List<SKPoint> ReducePointsToClipRect(IEnumerable<Coordinate>? points, Viewport viewport, SKRect clipRect)
    Parameters
    Type Name Description
    IEnumerable<Coordinate> points

    List of points to reduce.

    Viewport viewport

    The Viewport that is used for the conversions.

    SKRect clipRect

    Rectangle to clip to. All points outside aren't drawn.

    Returns
    Type Description
    List<SKPoint>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX