private static IEdgeDetectorProcessor <TPixel> GetProcessor <TPixel>(EdgeDetectionOperators filter, bool grayscale) where TPixel : struct, IPixel <TPixel> { IEdgeDetectorProcessor <TPixel> processor; switch (filter) { case EdgeDetectionOperators.Kayyali: processor = new KayyaliProcessor <TPixel>(grayscale); break; case EdgeDetectionOperators.Kirsch: processor = new KirschProcessor <TPixel>(grayscale); break; case EdgeDetectionOperators.Laplacian3x3: processor = new Laplacian3x3Processor <TPixel>(grayscale); break; case EdgeDetectionOperators.Laplacian5x5: processor = new Laplacian5x5Processor <TPixel>(grayscale); break; case EdgeDetectionOperators.LaplacianOfGaussian: processor = new LaplacianOfGaussianProcessor <TPixel>(grayscale); break; case EdgeDetectionOperators.Prewitt: processor = new PrewittProcessor <TPixel>(grayscale); break; case EdgeDetectionOperators.RobertsCross: processor = new RobertsCrossProcessor <TPixel>(grayscale); break; case EdgeDetectionOperators.Robinson: processor = new RobinsonProcessor <TPixel>(grayscale); break; case EdgeDetectionOperators.Scharr: processor = new ScharrProcessor <TPixel>(grayscale); break; default: processor = new SobelProcessor <TPixel>(grayscale); break; } return(processor); }
private static IImageProcessor GetProcessor(EdgeDetectionOperators filter, bool grayscale) { IImageProcessor processor; switch (filter) { case EdgeDetectionOperators.Kayyali: processor = new KayyaliProcessor(grayscale); break; case EdgeDetectionOperators.Kirsch: processor = new KirschProcessor(grayscale); break; case EdgeDetectionOperators.Laplacian3x3: processor = new Laplacian3x3Processor(grayscale); break; case EdgeDetectionOperators.Laplacian5x5: processor = new Laplacian5x5Processor(grayscale); break; case EdgeDetectionOperators.LaplacianOfGaussian: processor = new LaplacianOfGaussianProcessor(grayscale); break; case EdgeDetectionOperators.Prewitt: processor = new PrewittProcessor(grayscale); break; case EdgeDetectionOperators.RobertsCross: processor = new RobertsCrossProcessor(grayscale); break; case EdgeDetectionOperators.Robinson: processor = new RobinsonProcessor(grayscale); break; case EdgeDetectionOperators.Scharr: processor = new ScharrProcessor(grayscale); break; default: processor = new SobelProcessor(grayscale); break; } return(processor); }