//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Processing.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
///
/// The Scharr operator filter.
///
///
/// The pixel format.
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class ScharrProcessor : EdgeDetector2DProcessor
where TColor : struct, IPackedPixel, IEquatable
{
///
/// The horizontal gradient operator.
///
private static readonly float[][] ScharrX = new float[3][]
{
new float[] { -3, 0, 3 },
new float[] { -10, 0, 10 },
new float[] { -3, 0, 3 }
};
///
/// The vertical gradient operator.
///
private static readonly float[][] ScharrY = new float[3][]
{
new float[] { 3, 10, 3 },
new float[] { 0, 0, 0 },
new float[] { -3, -10, -3 }
};
///
public override float[][] KernelX => ScharrX;
///
public override float[][] KernelY => ScharrY;
}
}