// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.PixelFormats;
using System;
using System.Numerics;
namespace SixLabors.ImageSharp.Drawing.Processing {
///
/// Represents a logical configuration of a brush which can be used to source pixel colors.
///
///
/// A brush creates a that performs the logic for retrieving
/// pixel values for specific locations.
///
public abstract class Brush : IEquatable
{
///
/// Creates the prepared execution object for this brush.
///
/// The pixel type.
/// The configuration instance to use when performing operations.
/// The graphic options.
/// The canvas width for the current render pass.
/// The region the brush will be applied to.
///
/// The for this brush.
///
///
/// The when being applied to things like shapes would usually be the
/// bounding box of the shape not necessarily the bounds of the whole image.
///
public abstract BrushRenderer CreateRenderer(
Configuration configuration,
GraphicsOptions options,
int canvasWidth,
RectangleF region)
where TPixel : unmanaged, IPixel;
///
/// Returns a new brush with its defining geometry transformed by the given matrix.
///
/// The transformation matrix to apply.
/// A transformed brush, or this if the brush has no spatial parameters.
public virtual Brush Transform(Matrix4x4 matrix) => this;
///
public abstract bool Equals(Brush? other);
///
public override bool Equals(object? obj) => this.Equals(obj as Brush);
///
public abstract override int GetHashCode();
}
}