//
// 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 Gaussian blur to the image.
///
/// The pixel format.
/// The image this method extends.
/// The 'sigma' value representing the weight of the blur.
/// The .
public static Image GaussianBlur(this Image source, float sigma = 3f)
where TColor : struct, IPackedPixel, IEquatable
{
return GaussianBlur(source, sigma, source.Bounds);
}
///
/// Applies a Gaussian blur to the image.
///
/// The pixel format.
/// The image this method extends.
/// The 'sigma' value representing the weight of the blur.
///
/// The structure that specifies the portion of the image object to alter.
///
/// The .
public static Image GaussianBlur(this Image source, float sigma, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Apply(rectangle, new GaussianBlurProcessor(sigma));
}
}
}