Struct DrawingClipState
- Namespace
- SixLabors.ImageSharp.Drawing.Processing
- Assembly
- SixLabors.ImageSharp.Drawing.dll
Represents an ordered set of exact clip primitives carried by a drawing command.
public readonly struct DrawingClipState
- Inherited Members
Properties
Count
Gets the number of clip descriptors in stack order.
public int Count { get; }
Property Value
Empty
Gets an empty clip state.
public static DrawingClipState Empty { get; }
Property Value
HasClips
Gets a value indicating whether this state carries any clips.
public bool HasClips { get; }
Property Value
Methods
Append(DrawingClipDescriptor)
Appends one clip descriptor.
public DrawingClipState Append(DrawingClipDescriptor descriptor)
Parameters
descriptorDrawingClipDescriptorThe descriptor to append.
Returns
- DrawingClipState
The updated clip state.
Append(DrawingClipState)
Appends all descriptors from another state.
public DrawingClipState Append(DrawingClipState state)
Parameters
stateDrawingClipStateThe clip state to append.
Returns
- DrawingClipState
The updated clip state.
FromPaths(IReadOnlyList<IPath>, ClipOperation, DrawingClipEdgeMode)
Creates a clip state from path operands.
public static DrawingClipState FromPaths(IReadOnlyList<IPath> paths, ClipOperation operation, DrawingClipEdgeMode edgeMode)
Parameters
pathsIReadOnlyList<IPath>The clip paths.
operationClipOperationThe operation used to combine the paths with the existing clip.
edgeModeDrawingClipEdgeModeThe clip edge mode.
Returns
- DrawingClipState
The normalized clip state.
GetDescriptor(int)
Gets one descriptor by stack order.
public DrawingClipDescriptor GetDescriptor(int index)
Parameters
indexintThe descriptor index.
Returns
- DrawingClipDescriptor
The descriptor at the requested index.
Transform(Matrix4x4)
Transforms this clip state.
public DrawingClipState Transform(Matrix4x4 matrix)
Parameters
matrixMatrix4x4The transform matrix.
Returns
- DrawingClipState
The transformed clip state.
Translate(Vector2)
Translates this clip state.
public DrawingClipState Translate(Vector2 offset)
Parameters
offsetVector2The translation offset.
Returns
- DrawingClipState
The translated clip state.
TryGetConservativeBounds(Point, out Rectangle)
Gets conservative integer bounds for intersection descriptors in absolute target coordinates.
public bool TryGetConservativeBounds(Point destinationOffset, out Rectangle bounds)
Parameters
destinationOffsetPointThe absolute destination offset for the owning command.
boundsRectangleThe conservative bounds.
Returns
TryGetTargetBoundsClip(Point, out Rectangle)
Gets bounds for a single pixel-aligned clip that can be represented entirely by target bounds.
public bool TryGetTargetBoundsClip(Point destinationOffset, out Rectangle bounds)
Parameters
destinationOffsetPointThe absolute destination offset for the owning canvas state.
boundsRectangleThe exact integer clip bounds.