mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 8e6ac4bf4ee07615c7bb707aedc12afccd1647af Former-commit-id: 40db8d0882d4974b675fd0cd7531eabb7c701210 Former-commit-id: 99fdd9fb8851e2e23510f3682f671acf06620a31af/merge-core
7 changed files with 151 additions and 18 deletions
@ -0,0 +1,23 @@ |
|||
// <copyright file="NearestNeighborResampler.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageProcessor.Samplers |
|||
{ |
|||
/// <summary>
|
|||
/// The function implements the nearest neighbour algorithm. This uses an unscaled filter
|
|||
/// which will select the closest pixel to the new pixels position.
|
|||
/// </summary>
|
|||
public class NearestNeighborResampler : IResampler |
|||
{ |
|||
/// <inheritdoc/>
|
|||
public float Radius => 1; |
|||
|
|||
/// <inheritdoc/>
|
|||
public float GetValue(float x) |
|||
{ |
|||
return x; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue