Table of Contents

Class DrawingClipDescriptor

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

Represents one clip primitive carried by a drawing command.

public sealed class DrawingClipDescriptor
Inheritance
DrawingClipDescriptor
Inherited Members

Properties

EdgeMode

Gets the edge mode used by rectangle and region clips.

public DrawingClipEdgeMode EdgeMode { get; }

Property Value

DrawingClipEdgeMode

IntegerRectangles

Gets the integer rectangles for an integer region clip.

public IReadOnlyList<Rectangle> IntegerRectangles { get; }

Property Value

IReadOnlyList<Rectangle>

IntersectionRule

Gets the fill rule used when this clip is represented as path geometry.

public IntersectionRule IntersectionRule { get; }

Property Value

IntersectionRule

Kind

Gets the clip primitive kind.

public DrawingClipKind Kind { get; }

Property Value

DrawingClipKind

Operation

Gets the operation used to combine this descriptor with the existing clip.

public ClipOperation Operation { get; }

Property Value

ClipOperation

PathScale

Gets the path-space scale represented by this descriptor.

public Vector2 PathScale { get; }

Property Value

Vector2

PathTransform

Gets the transform that maps scaled path geometry into descriptor coordinates.

public Matrix4x4 PathTransform { get; }

Property Value

Matrix4x4

Paths

Gets the path operands for a path clip.

public IReadOnlyList<IPath> Paths { get; }

Property Value

IReadOnlyList<IPath>

Rectangle

Gets the rectangle for a rectangle clip.

public RectangleF Rectangle { get; }

Property Value

RectangleF

Rectangles

Gets the floating-point rectangles for a region clip.

public IReadOnlyList<RectangleF> Rectangles { get; }

Property Value

IReadOnlyList<RectangleF>

Methods

CreateIntegerRegion(IReadOnlyList<Rectangle>, ClipOperation)

Creates an integer region clip descriptor.

public static DrawingClipDescriptor CreateIntegerRegion(IReadOnlyList<Rectangle> rectangles, ClipOperation operation)

Parameters

rectangles IReadOnlyList<Rectangle>

The region rectangles in canvas-local coordinates.

operation ClipOperation

The operation used to combine the region with the existing clip.

Returns

DrawingClipDescriptor

The descriptor.

CreatePath(IReadOnlyList<IPath>, ClipOperation, DrawingClipEdgeMode)

Creates a path clip descriptor.

public static DrawingClipDescriptor CreatePath(IReadOnlyList<IPath> paths, ClipOperation operation, DrawingClipEdgeMode edgeMode)

Parameters

paths IReadOnlyList<IPath>

The path operands interpreted as one clip region.

operation ClipOperation

The operation used to combine the paths with the existing clip.

edgeMode DrawingClipEdgeMode

The clip edge mode.

Returns

DrawingClipDescriptor

The descriptor.

CreateRectangle(RectangleF, ClipOperation, DrawingClipEdgeMode)

Creates a rectangle clip descriptor.

public static DrawingClipDescriptor CreateRectangle(RectangleF rectangle, ClipOperation operation, DrawingClipEdgeMode edgeMode)

Parameters

rectangle RectangleF

The rectangle in canvas-local coordinates.

operation ClipOperation

The operation used to combine the rectangle with the existing clip.

edgeMode DrawingClipEdgeMode

The clip edge mode.

Returns

DrawingClipDescriptor

The descriptor.

CreateRegion(IReadOnlyList<RectangleF>, ClipOperation, DrawingClipEdgeMode)

Creates a floating-point region clip descriptor.

public static DrawingClipDescriptor CreateRegion(IReadOnlyList<RectangleF> rectangles, ClipOperation operation, DrawingClipEdgeMode edgeMode)

Parameters

rectangles IReadOnlyList<RectangleF>

The region rectangles in canvas-local coordinates.

operation ClipOperation

The operation used to combine the region with the existing clip.

edgeMode DrawingClipEdgeMode

The clip edge mode.

Returns

DrawingClipDescriptor

The descriptor.

FromPath(IPath, ClipOperation, DrawingClipEdgeMode)

Converts one incoming path to a clip descriptor.

public static DrawingClipDescriptor FromPath(IPath path, ClipOperation operation, DrawingClipEdgeMode edgeMode)

Parameters

path IPath

The incoming path.

operation ClipOperation

The operation used to combine the path with the existing clip.

edgeMode DrawingClipEdgeMode

The clip edge mode.

Returns

DrawingClipDescriptor

The descriptor.

GetConservativeBounds(Point)

Gets conservative integer bounds for this descriptor in absolute target coordinates.

public Rectangle GetConservativeBounds(Point destinationOffset)

Parameters

destinationOffset Point

The absolute destination offset for the owning command.

Returns

Rectangle

The conservative bounds.

ToLinearGeometry(out Matrix4x4)

Converts a path clip descriptor to linear geometry.

public LinearGeometry ToLinearGeometry(out Matrix4x4 transform)

Parameters

transform Matrix4x4

The transform that maps the returned geometry into descriptor coordinates.

Returns

LinearGeometry

The scaled linear geometry for the path clip.

Exceptions

InvalidOperationException

Thrown when this descriptor is not a path clip.

ToPath()

Converts this descriptor to path geometry.

public IPath ToPath()

Returns

IPath

A path describing the descriptor area.

Transform(Matrix4x4)

Transforms this descriptor.

public DrawingClipDescriptor Transform(Matrix4x4 matrix)

Parameters

matrix Matrix4x4

The transform matrix.

Returns

DrawingClipDescriptor

The transformed descriptor.

Translate(Vector2)

Translates this descriptor.

public DrawingClipDescriptor Translate(Vector2 offset)

Parameters

offset Vector2

The translation offset.

Returns

DrawingClipDescriptor

The translated descriptor.