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