// // 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 Prewitt 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 PrewittProcessor : EdgeDetector2DProcessor where TColor : struct, IPackedPixel, IEquatable { /// /// The horizontal gradient operator. /// private static readonly Fast2DArray PrewittX = new Fast2DArray(new float[,] { { -1, 0, 1 }, { -1, 0, 1 }, { -1, 0, 1 } }); /// /// The vertical gradient operator. /// private static readonly Fast2DArray PrewittY = new Fast2DArray(new float[,] { { 1, 1, 1 }, { 0, 0, 0 }, { -1, -1, -1 } }); /// /// Initializes a new instance of the class. /// public PrewittProcessor() : base(PrewittX, PrewittY) { } } }