//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp
{
using System;
using Processing;
///
/// Extension methods for the type.
///
public static partial class ImageExtensions
{
///
/// Applies a box blur to the image.
///
/// The pixel format.
/// The image this method extends.
/// The 'radius' value representing the size of the area to sample.
/// The .
public static Image BoxBlur(this Image source, int radius = 7)
where TColor : struct, IPackedPixel, IEquatable
{
return BoxBlur(source, radius, source.Bounds);
}
///
/// Applies a box blur to the image.
///
/// The pixel format.
/// The image this method extends.
/// The 'radius' value representing the size of the area to sample.
///
/// The structure that specifies the portion of the image object to alter.
///
/// The .
public static Image BoxBlur(this Image source, int radius, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Apply(rectangle, new BoxBlurProcessor(radius));
}
}
}