|
|
|
@ -2,6 +2,7 @@ |
|
|
|
// Copyright (c) James Jackson-South and contributors.
|
|
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
// </copyright>
|
|
|
|
|
|
|
|
namespace ImageSharp.Processing.Processors |
|
|
|
{ |
|
|
|
using System; |
|
|
|
@ -19,105 +20,113 @@ namespace ImageSharp.Processing.Processors |
|
|
|
/// <summary>
|
|
|
|
/// The North gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschNorth = |
|
|
|
{ |
|
|
|
new float[] { 5, 5, 5 }, |
|
|
|
new float[] { -3, 0, -3 }, |
|
|
|
new float[] { -3, -3, -3 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschNorth = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ 5, 5, 5 }, |
|
|
|
{ -3, 0, -3 }, |
|
|
|
{ -3, -3, -3 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The NorthWest gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschNorthWest = |
|
|
|
{ |
|
|
|
new float[] { 5, 5, -3 }, |
|
|
|
new float[] { 5, 0, -3 }, |
|
|
|
new float[] { -3, -3, -3 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschNorthWest = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ 5, 5, -3 }, |
|
|
|
{ 5, 0, -3 }, |
|
|
|
{ -3, -3, -3 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The West gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschWest = |
|
|
|
{ |
|
|
|
new float[] { 5, -3, -3 }, |
|
|
|
new float[] { 5, 0, -3 }, |
|
|
|
new float[] { 5, -3, -3 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschWest = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ 5, -3, -3 }, |
|
|
|
{ 5, 0, -3 }, |
|
|
|
{ 5, -3, -3 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The SouthWest gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschSouthWest = |
|
|
|
{ |
|
|
|
new float[] { -3, -3, -3 }, |
|
|
|
new float[] { 5, 0, -3 }, |
|
|
|
new float[] { 5, 5, -3 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschSouthWest = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ -3, -3, -3 }, |
|
|
|
{ 5, 0, -3 }, |
|
|
|
{ 5, 5, -3 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The South gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschSouth = |
|
|
|
{ |
|
|
|
new float[] { -3, -3, -3 }, |
|
|
|
new float[] { -3, 0, -3 }, |
|
|
|
new float[] { 5, 5, 5 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschSouth = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ -3, -3, -3 }, |
|
|
|
{ -3, 0, -3 }, |
|
|
|
{ 5, 5, 5 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The SouthEast gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschSouthEast = |
|
|
|
{ |
|
|
|
new float[] { -3, -3, -3 }, |
|
|
|
new float[] { -3, 0, 5 }, |
|
|
|
new float[] { -3, 5, 5 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschSouthEast = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ -3, -3, -3 }, |
|
|
|
{ -3, 0, 5 }, |
|
|
|
{ -3, 5, 5 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The East gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschEast = |
|
|
|
{ |
|
|
|
new float[] { -3, -3, 5 }, |
|
|
|
new float[] { -3, 0, 5 }, |
|
|
|
new float[] { -3, -3, 5 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschEast = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ -3, -3, 5 }, |
|
|
|
{ -3, 0, 5 }, |
|
|
|
{ -3, -3, 5 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The NorthEast gradient operator
|
|
|
|
/// </summary>
|
|
|
|
private static readonly float[][] KirschNorthEast = |
|
|
|
{ |
|
|
|
new float[] { -3, 5, 5 }, |
|
|
|
new float[] { -3, 0, 5 }, |
|
|
|
new float[] { -3, -3, -3 } |
|
|
|
}; |
|
|
|
private static readonly Fast2DArray<float> KirschNorthEast = |
|
|
|
new Fast2DArray<float>(new float[,] |
|
|
|
{ |
|
|
|
{ -3, 5, 5 }, |
|
|
|
{ -3, 0, 5 }, |
|
|
|
{ -3, -3, -3 } |
|
|
|
}); |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] North => KirschNorth; |
|
|
|
public override Fast2DArray<float> North => KirschNorth; |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] NorthWest => KirschNorthWest; |
|
|
|
public override Fast2DArray<float> NorthWest => KirschNorthWest; |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] West => KirschWest; |
|
|
|
public override Fast2DArray<float> West => KirschWest; |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] SouthWest => KirschSouthWest; |
|
|
|
public override Fast2DArray<float> SouthWest => KirschSouthWest; |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] South => KirschSouth; |
|
|
|
public override Fast2DArray<float> South => KirschSouth; |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] SouthEast => KirschSouthEast; |
|
|
|
public override Fast2DArray<float> SouthEast => KirschSouthEast; |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] East => KirschEast; |
|
|
|
public override Fast2DArray<float> East => KirschEast; |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float[][] NorthEast => KirschNorthEast; |
|
|
|
public override Fast2DArray<float> NorthEast => KirschNorthEast; |
|
|
|
} |
|
|
|
} |