Beispiel #1
0
        // TODO: Move this to an appropriate extension method if possible.
        internal void ApplyToFrame <TPixel>(ImageFrame <TPixel> frame, Rectangle sourceRectangle, Configuration configuration)
            where TPixel : struct, IPixel <TPixel>
        {
            var processorImpl = new EdgeDetector2DProcessor <TPixel>(SobelKernels.SobelX, SobelKernels.SobelY, this.Grayscale);

            processorImpl.Apply(frame, sourceRectangle, configuration);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="EdgeDetector2DProcessor{TPixel}"/> class.
 /// </summary>
 /// <param name="configuration">The configuration which allows altering default behaviour or extending the library.</param>
 /// <param name="definition">The <see cref="EdgeDetector2DProcessor"/> defining the processor parameters.</param>
 /// <param name="source">The source <see cref="Image{TPixel}"/> for the current processor instance.</param>
 /// <param name="sourceRectangle">The source area to process for the current processor instance.</param>
 public EdgeDetector2DProcessor(
     Configuration configuration,
     EdgeDetector2DProcessor definition,
     Image <TPixel> source,
     Rectangle sourceRectangle)
     : base(configuration, source, sourceRectangle)
 {
     this.kernelX   = definition.Kernel.KernelX;
     this.kernelY   = definition.Kernel.KernelY;
     this.grayscale = definition.Grayscale;
 }