Table of Contents

Class ConvolutionProcessor

Namespace
SixLabors.ImageSharp.Processing.Processors.Convolution
Assembly
SixLabors.ImageSharp.dll

Defines a processor that uses a 2 dimensional matrix to perform convolution against an image.

public class ConvolutionProcessor : IImageProcessor
Inheritance
ConvolutionProcessor
Implements
Inherited Members

Constructors

ConvolutionProcessor(in DenseMatrix<float>, bool, BorderWrappingMode, BorderWrappingMode)

Initializes a new instance of the ConvolutionProcessor class.

public ConvolutionProcessor(in DenseMatrix<float> kernelXY, bool preserveAlpha, BorderWrappingMode borderWrapModeX, BorderWrappingMode borderWrapModeY)

Parameters

kernelXY DenseMatrix<float>

The 2d gradient operator.

preserveAlpha bool

Whether the convolution filter is applied to alpha as well as the color channels.

borderWrapModeX BorderWrappingMode

The BorderWrappingMode to use when mapping the pixels outside of the border, in X direction.

borderWrapModeY BorderWrappingMode

The BorderWrappingMode to use when mapping the pixels outside of the border, in Y direction.

Properties

BorderWrapModeX

Gets the BorderWrappingMode to use when mapping the pixels outside of the border, in X direction.

public BorderWrappingMode BorderWrapModeX { get; }

Property Value

BorderWrappingMode

BorderWrapModeY

Gets the BorderWrappingMode to use when mapping the pixels outside of the border, in Y direction.

public BorderWrappingMode BorderWrapModeY { get; }

Property Value

BorderWrappingMode

KernelXY

Gets the 2d convolution kernel.

public DenseMatrix<float> KernelXY { get; }

Property Value

DenseMatrix<float>

PreserveAlpha

Gets a value indicating whether the convolution filter is applied to alpha as well as the color channels.

public bool PreserveAlpha { get; }

Property Value

bool

Methods

CreatePixelSpecificProcessor<TPixel>(Configuration, Image<TPixel>, Rectangle)

Creates a pixel specific IImageProcessor<TPixel> that is capable of executing the processing algorithm on an Image<TPixel>.

public IImageProcessor<TPixel> CreatePixelSpecificProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle) where TPixel : unmanaged, IPixel<TPixel>

Parameters

configuration Configuration

The configuration which allows altering default behaviour or extending the library.

source Image<TPixel>

The source image. Cannot be null.

sourceRectangle Rectangle

The Rectangle structure that specifies the portion of the image object to draw.

Returns

IImageProcessor<TPixel>

The IImageProcessor<TPixel>

Type Parameters

TPixel

The pixel type.