mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 00082be425529e9216e445e9da255dfad11894c0 Former-commit-id: 9c3b0b3308eb443edf3365f62ba8f4c5c51305fb Former-commit-id: b42ef3cfe4ff9cdc94aeb465f456adf46b0451d0af/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