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
IntegerRectangles
Gets the integer rectangles for an integer region clip.
public IReadOnlyList<Rectangle> IntegerRectangles { get; }
Property Value
IntersectionRule
Gets the fill rule used when this clip is represented as path geometry.
public IntersectionRule IntersectionRule { get; }
Property Value
Kind
Gets the clip primitive kind.
public DrawingClipKind Kind { get; }
Property Value
Operation
Gets the operation used to combine this descriptor with the existing clip.
public ClipOperation Operation { get; }
Property Value
PathScale
Gets the path-space scale represented by this descriptor.
public Vector2 PathScale { get; }
Property Value
PathTransform
Gets the transform that maps scaled path geometry into descriptor coordinates.
public Matrix4x4 PathTransform { get; }
Property Value
Paths
Gets the path operands for a path clip.
public IReadOnlyList<IPath> Paths { get; }
Property Value
Rectangle
Gets the rectangle for a rectangle clip.
public RectangleF Rectangle { get; }
Property Value
Rectangles
Gets the floating-point rectangles for a region clip.
public IReadOnlyList<RectangleF> Rectangles { get; }
Property Value
Methods
CreateIntegerRegion(IReadOnlyList<Rectangle>, ClipOperation)
Creates an integer region clip descriptor.
public static DrawingClipDescriptor CreateIntegerRegion(IReadOnlyList<Rectangle> rectangles, ClipOperation operation)
Parameters
rectanglesIReadOnlyList<Rectangle>The region rectangles in canvas-local coordinates.
operationClipOperationThe 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
pathsIReadOnlyList<IPath>The path operands interpreted as one clip region.
operationClipOperationThe operation used to combine the paths with the existing clip.
edgeModeDrawingClipEdgeModeThe 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
rectangleRectangleFThe rectangle in canvas-local coordinates.
operationClipOperationThe operation used to combine the rectangle with the existing clip.
edgeModeDrawingClipEdgeModeThe 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
rectanglesIReadOnlyList<RectangleF>The region rectangles in canvas-local coordinates.
operationClipOperationThe operation used to combine the region with the existing clip.
edgeModeDrawingClipEdgeModeThe 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
pathIPathThe incoming path.
operationClipOperationThe operation used to combine the path with the existing clip.
edgeModeDrawingClipEdgeModeThe 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
destinationOffsetPointThe 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
transformMatrix4x4The 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
matrixMatrix4x4The transform matrix.
Returns
- DrawingClipDescriptor
The transformed descriptor.
Translate(Vector2)
Translates this descriptor.
public DrawingClipDescriptor Translate(Vector2 offset)
Parameters
offsetVector2The translation offset.
Returns
- DrawingClipDescriptor
The translated descriptor.