//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageProcessorCore
{
///
/// The function implements the Lanczos kernel algorithm as described on
/// Wikipedia
/// with a radius of 8 pixels.
///
public class Lanczos8Resampler : IResampler
{
///
public float Radius => 8;
///
public float GetValue(float x)
{
if (x < 0)
{
x = -x;
}
if (x < 8)
{
return ImageMaths.SinC(x) * ImageMaths.SinC(x / 8f);
}
return 0;
}
}
}