// // 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, IPixel { /// /// The horizontal gradient operator. /// private static readonly Fast2DArray ScharrX = new float[,] { { -3, 0, 3 }, { -10, 0, 10 }, { -3, 0, 3 } }; /// /// The vertical gradient operator. /// private static readonly Fast2DArray ScharrY = new float[,] { { 3, 10, 3 }, { 0, 0, 0 }, { -3, -10, -3 } }; /// /// Initializes a new instance of the class. /// public ScharrProcessor() : base(ScharrX, ScharrY) { } } }