Table of Contents

Class CubicBezierLineSegment

Namespace
SixLabors.ImageSharp.Drawing
Assembly
SixLabors.ImageSharp.Drawing.dll

Represents a line segment that contains a list of control points that will be rendered as a cubic bezier curve.

public sealed class CubicBezierLineSegment : ILineSegment
Inheritance
CubicBezierLineSegment
Implements
Inherited Members

Constructors

CubicBezierLineSegment(PointF, PointF, PointF, PointF)

Initializes a new instance of the CubicBezierLineSegment class.

public CubicBezierLineSegment(PointF start, PointF controlPoint1, PointF controlPoint2, PointF end)

Parameters

start PointF

The start point of the curve.

controlPoint1 PointF

The first control point.

controlPoint2 PointF

The second control point.

end PointF

The end point of the curve.

CubicBezierLineSegment(PointF, PointF, PointF, PointF, params PointF[])

Initializes a new instance of the CubicBezierLineSegment class.

public CubicBezierLineSegment(PointF start, PointF controlPoint1, PointF controlPoint2, PointF end, params PointF[] additionalPoints)

Parameters

start PointF

The start point of the curve.

controlPoint1 PointF

The first control point.

controlPoint2 PointF

The second control point.

end PointF

The end point of the curve.

additionalPoints PointF[]

Additional points appended after end; each group of three (two control points and an end point) defines a further cubic span.

CubicBezierLineSegment(PointF[])

Initializes a new instance of the CubicBezierLineSegment class.

public CubicBezierLineSegment(PointF[] points)

Parameters

points PointF[]

The control points. The length must be a multiple of 3 plus 1 (4, 7, 10...).

Properties

Bounds

Gets the bounds of the linearized segment output.

public RectangleF Bounds { get; }

Property Value

RectangleF

ControlPoints

Gets the control points.

public IReadOnlyList<PointF> ControlPoints { get; }

Property Value

IReadOnlyList<PointF>

EndPoint

Gets the end point.

public PointF EndPoint { get; }

Property Value

PointF

The end point.

StartPoint

Gets the start point.

public PointF StartPoint { get; }

Property Value

PointF

Methods

CopyTo(Span<PointF>, bool, Vector2)

Writes the segment's linearized points to destination, baked at the supplied device-space scale.

public void CopyTo(Span<PointF> destination, bool skipFirstPoint, Vector2 scale)

Parameters

destination Span<PointF>

The destination point span.

skipFirstPoint bool

Whether to skip the first emitted point.

scale Vector2

The X/Y scale at which curves are flattened. Pass One for local-space output.

GetControlPoints()

Gets the control points of this curve.

public ReadOnlyMemory<PointF> GetControlPoints()

Returns

ReadOnlyMemory<PointF>

The control points of this curve.

LinearVertexCount(Vector2)

Returns the number of linear vertices emitted by this segment when flattened under the supplied device-space scale.

public int LinearVertexCount(Vector2 scale)

Parameters

scale Vector2

The X/Y scale at which curves are flattened. Pass One for local-space counts.

Returns

int

The number of linear vertices this segment emits.

Transform(Matrix4x4)

Transforms this line segment using the specified matrix.

public CubicBezierLineSegment Transform(Matrix4x4 matrix)

Parameters

matrix Matrix4x4

The matrix.

Returns

CubicBezierLineSegment

A line segment with the matrix applied to it.

See Also