//
// 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 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 Fast2DArray RobertsCrossX =
new Fast2DArray(new float[,]
{
{ 1, 0 },
{ 0, -1 }
});
///
/// The vertical gradient operator.
///
private static readonly Fast2DArray RobertsCrossY =
new Fast2DArray(new float[,]
{
{ 0, 1 },
{ -1, 0 }
});
///
/// Initializes a new instance of the class.
///
public RobertsCrossProcessor()
: base(RobertsCrossX, RobertsCrossY)
{
}
}
}