mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 894501ba723e1643831c3917acb0bd7e064fc75b Former-commit-id: a1bce60477ba5acdf54f4432bdb646bd95326f29 Former-commit-id: c539e6aeab3edf3ebde7658fece6972c321b7362af/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