//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;
///
/// The Roberts Cross 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 RobertsCrossProcessor : EdgeDetector2DProcessor
where TColor : struct, IPackedPixel, IEquatable
{
///
/// The horizontal gradient operator.
///
private static readonly float[][] RobertsCrossX =
{
new float[] { 1, 0 },
new float[] { 0, -1 }
};
///
/// The vertical gradient operator.
///
private static readonly float[][] RobertsCrossY =
{
new float[] { 0, 1 },
new float[] { -1, 0 }
};
///
public override float[][] KernelX => RobertsCrossX;
///
public override float[][] KernelY => RobertsCrossY;
}
}