mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 9ddf97eb0300834d945db627e4c500e67fbf1fb7 Former-commit-id: c9a893530a085724596af1054492d125dc0355ea Former-commit-id: 3266f3ce095fd3f865d0e540e6096f794de70c4faf/merge-core
6 changed files with 45 additions and 6 deletions
@ -0,0 +1,33 @@ |
|||
// <copyright file="Lanczos3Resampler.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 Lanczos kernel algorithm as described on
|
|||
/// <see href="https://en.wikipedia.org/wiki/Lanczos_resampling#Algorithm">Wikipedia</see>
|
|||
/// </summary>
|
|||
public class Lanczos8Resampler : IResampler |
|||
{ |
|||
/// <inheritdoc/>
|
|||
public double Radius => 8; |
|||
|
|||
/// <inheritdoc/>
|
|||
public double GetValue(double x) |
|||
{ |
|||
if (x < 0) |
|||
{ |
|||
x = -x; |
|||
} |
|||
|
|||
if (x < 8) |
|||
{ |
|||
return ImageMaths.SinC(x) * ImageMaths.SinC(x / 8f); |
|||
} |
|||
|
|||
return 0; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:716448da88152225767c024aac498f5b7562b6e8391907cefc9d03dba40050fd |
|||
size 53435 |
|||
Loading…
Reference in new issue