Struct CompositionCommand
- Namespace
- SixLabors.ImageSharp.Drawing.Processing.Backends
- Assembly
- SixLabors.ImageSharp.Drawing.dll
One normalized fill-path or layer-based composition command queued for backend execution.
public readonly struct CompositionCommand
- Inherited Members
Remarks
This type carries fill-path commands plus inline layer boundaries.
Properties
Brush
Gets the brush used during composition.
public Brush Brush { get; }
Property Value
ClipPaths
Gets the clip paths carried by the command.
public IReadOnlyList<IPath>? ClipPaths { get; }
Property Value
DestinationOffset
Gets the absolute destination offset where the local coverage should be composited.
public Point DestinationOffset { get; }
Property Value
DrawingOptions
Gets the drawing options carried by the command.
public DrawingOptions DrawingOptions { get; }
Property Value
GraphicsOptions
Gets graphics options used for composition or layer compositing.
public GraphicsOptions GraphicsOptions { get; }
Property Value
IsInsideLayer
Gets a value indicating whether the command was recorded inside a layer.
public bool IsInsideLayer { get; }
Property Value
Kind
Gets the command kind.
public CompositionCommandKind Kind { get; }
Property Value
LayerBounds
Gets the absolute bounds of the layer opened by this command.
public Rectangle LayerBounds { get; }
Property Value
Remarks
Only meaningful for BeginLayer and EndLayer.
RasterizerOptions
Gets rasterizer options used to generate coverage.
public RasterizerOptions RasterizerOptions { get; }
Property Value
ShapeOptions
Gets the shape options carried by the command.
public ShapeOptions ShapeOptions { get; }
Property Value
SourcePath
Gets the source path carried by the command.
public IPath SourcePath { get; }
Property Value
TargetBounds
Gets the absolute bounds of the logical target for this command.
public Rectangle TargetBounds { get; }
Property Value
Transform
Gets the command transform.
public Matrix4x4 Transform { get; }
Property Value
Methods
Create(IPath, Brush, DrawingOptions, in RasterizerOptions, Rectangle, Point, IReadOnlyList<IPath>?, bool)
Creates a fill-path composition command.
public static CompositionCommand Create(IPath path, Brush brush, DrawingOptions drawingOptions, in RasterizerOptions rasterizerOptions, Rectangle targetBounds, Point destinationOffset, IReadOnlyList<IPath>? clipPaths, bool isInsideLayer)
Parameters
pathIPathPath in target-local coordinates.
brushBrushBrush used during composition.
drawingOptionsDrawingOptionsDrawing options (graphics, shape, transform) used during composition.
rasterizerOptionsRasterizerOptionsRasterizer options used to generate coverage.
targetBoundsRectangleThe absolute bounds of the logical target for this command.
destinationOffsetPointAbsolute destination offset where coverage is composited.
clipPathsIReadOnlyList<IPath>Optional clip paths supplied with the command.
isInsideLayerboolTrue if the command was recorded inside a layer.
Returns
- CompositionCommand
The composition command.
CreateBeginLayer(Rectangle, GraphicsOptions)
Creates a begin-layer composition command. IsInsideLayer is false on the BeginLayer marker itself; the flag is only meaningful for fills/strokes that follow it.
public static CompositionCommand CreateBeginLayer(Rectangle layerBounds, GraphicsOptions graphicsOptions)
Parameters
layerBoundsRectangleThe absolute bounds of the layer.
graphicsOptionsGraphicsOptionsThe compositing options used when the layer closes.
Returns
- CompositionCommand
The begin-layer command.
CreateEndLayer(Rectangle, GraphicsOptions)
Creates an end-layer composition command. IsInsideLayer is false on the EndLayer marker itself; the flag is only meaningful for fills/strokes that preceded it.
public static CompositionCommand CreateEndLayer(Rectangle layerBounds, GraphicsOptions graphicsOptions)
Parameters
layerBoundsRectangleThe absolute bounds of the layer being closed.
graphicsOptionsGraphicsOptionsThe compositing options used by the layer.
Returns
- CompositionCommand
The end-layer command.