Table of Contents

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

Brush

ClipPaths

Gets the clip paths carried by the command.

public IReadOnlyList<IPath>? ClipPaths { get; }

Property Value

IReadOnlyList<IPath>

DestinationOffset

Gets the absolute destination offset where the local coverage should be composited.

public Point DestinationOffset { get; }

Property Value

Point

DrawingOptions

Gets the drawing options carried by the command.

public DrawingOptions DrawingOptions { get; }

Property Value

DrawingOptions

GraphicsOptions

Gets graphics options used for composition or layer compositing.

public GraphicsOptions GraphicsOptions { get; }

Property Value

GraphicsOptions

IsInsideLayer

Gets a value indicating whether the command was recorded inside a layer.

public bool IsInsideLayer { get; }

Property Value

bool

Kind

Gets the command kind.

public CompositionCommandKind Kind { get; }

Property Value

CompositionCommandKind

LayerBounds

Gets the absolute bounds of the layer opened by this command.

public Rectangle LayerBounds { get; }

Property Value

Rectangle

Remarks

Only meaningful for BeginLayer and EndLayer.

RasterizerOptions

Gets rasterizer options used to generate coverage.

public RasterizerOptions RasterizerOptions { get; }

Property Value

RasterizerOptions

ShapeOptions

Gets the shape options carried by the command.

public ShapeOptions ShapeOptions { get; }

Property Value

ShapeOptions

SourcePath

Gets the source path carried by the command.

public IPath SourcePath { get; }

Property Value

IPath

TargetBounds

Gets the absolute bounds of the logical target for this command.

public Rectangle TargetBounds { get; }

Property Value

Rectangle

Transform

Gets the command transform.

public Matrix4x4 Transform { get; }

Property Value

Matrix4x4

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

path IPath

Path in target-local coordinates.

brush Brush

Brush used during composition.

drawingOptions DrawingOptions

Drawing options (graphics, shape, transform) used during composition.

rasterizerOptions RasterizerOptions

Rasterizer options used to generate coverage.

targetBounds Rectangle

The absolute bounds of the logical target for this command.

destinationOffset Point

Absolute destination offset where coverage is composited.

clipPaths IReadOnlyList<IPath>

Optional clip paths supplied with the command.

isInsideLayer bool

True 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

layerBounds Rectangle

The absolute bounds of the layer.

graphicsOptions GraphicsOptions

The 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

layerBounds Rectangle

The absolute bounds of the layer being closed.

graphicsOptions GraphicsOptions

The compositing options used by the layer.

Returns

CompositionCommand

The end-layer command.