// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
namespace SixLabors.ImageSharp.Processing.Processors.Drawing
{
///
/// Defines a processor to fill an with the given
/// using blending defined by the given .
///
public class FillProcessor : IImageProcessor
{
///
/// Initializes a new instance of the class.
///
/// The defining how to blend the brush pixels over the image pixels.
/// The brush to use for filling.
public FillProcessor(GraphicsOptions options, IBrush brush)
{
this.Brush = brush;
this.Options = options;
}
///
/// Gets the used for filling the destination image.
///
public IBrush Brush { get; }
///
/// Gets the defining how to blend the brush pixels over the image pixels.
///
public GraphicsOptions Options { get; }
///
public IImageProcessor CreatePixelSpecificProcessor(Image source, Rectangle sourceRectangle)
where TPixel : struct, IPixel
{
return new FillProcessor(this, source, sourceRectangle);
}
}
}