// Copyright (c) Six Labors. // Licensed under the Six Labors Split License. using System.Collections.Generic; namespace SixLabors.ImageSharp.Drawing.Processing { /// /// Immutable drawing state snapshot used by . /// internal sealed class DrawingCanvasState { /// /// Initializes a new instance of the class. /// /// Drawing options for this state. /// Clip paths for this state. /// Absolute target bounds used for commands recorded in this state. /// Absolute destination offset for paths recorded in local canvas coordinates. public DrawingCanvasState( DrawingOptions options, IReadOnlyList clipPaths, Rectangle targetBounds, Point destinationOffset) { this.Options = options; this.ClipPaths = clipPaths; this.TargetBounds = targetBounds; this.DestinationOffset = destinationOffset; } /// /// Gets drawing options associated with this state. /// /// /// This is the original reference supplied to the state. /// It is not deep-cloned. /// public DrawingOptions Options { get; } /// /// Gets clip paths associated with this state. /// public IReadOnlyList ClipPaths { get; } /// /// Gets the absolute target bounds used for commands recorded in this state. /// public Rectangle TargetBounds { get; } /// /// Gets the absolute destination offset for paths recorded in local canvas coordinates. /// public Point DestinationOffset { get; } /// /// Gets a value indicating whether this state represents a compositing layer. /// public bool IsLayer { get; init; } /// /// Gets the layer compositing options when this state represents a compositing layer. /// public GraphicsOptions? LayerOptions { get; init; } } }