mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
764 B
26 lines
764 B
// <copyright file="MitchellResampler.cs" company="James South">
|
|
// Copyright © James South and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
// </copyright>
|
|
|
|
namespace ImageProcessor.Samplers
|
|
{
|
|
/// <summary>
|
|
/// The function implements the mitchell algorithm as described on
|
|
/// <see href="https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter">Wikipedia</see>
|
|
/// </summary>
|
|
public class MitchellNetravaliResampler : IResampler
|
|
{
|
|
/// <inheritdoc/>
|
|
public double Radius => 2;
|
|
|
|
/// <inheritdoc/>
|
|
public double GetValue(double x)
|
|
{
|
|
const double B = 1 / 3d;
|
|
const double C = 1 / 3d;
|
|
|
|
return ImageMaths.GetBcValue(x, B, C);
|
|
}
|
|
}
|
|
}
|
|
|