Edit

SKImageFilter.CreateMatrixConvolution Method

Definition

Overloads

CreateMatrixConvolution(SKSizeI, ReadOnlySpan<Single>, Single, Single, SKPointI, SKShaderTileMode, Boolean)

Creates an image filter that applies a matrix convolution.

public static SkiaSharp.SKImageFilter CreateMatrixConvolution(SkiaSharp.SKSizeI kernelSize, ReadOnlySpan<float> kernel, float gain, float bias, SkiaSharp.SKPointI kernelOffset, SkiaSharp.SKShaderTileMode tileMode, bool convolveAlpha);

Parameters

kernelSize
SKSizeI

The size of the convolution kernel.

kernel
ReadOnlySpan<Single>

The convolution kernel values.

gain
Single

The gain factor applied to each pixel.

bias
Single

The bias added to each pixel after applying the kernel.

kernelOffset
SKPointI

The offset within the kernel for the source pixel.

tileMode
SKShaderTileMode

The tile mode for edge handling.

convolveAlpha
Boolean

Whether to also convolve the alpha channel.

Returns

Returns the new SKImageFilter, or null on error.

Applies to

CreateMatrixConvolution(SKSizeI, ReadOnlySpan<Single>, Single, Single, SKPointI, SKShaderTileMode, Boolean, SKImageFilter)

Creates an image filter that applies a matrix convolution.

public static SkiaSharp.SKImageFilter CreateMatrixConvolution(SkiaSharp.SKSizeI kernelSize, ReadOnlySpan<float> kernel, float gain, float bias, SkiaSharp.SKPointI kernelOffset, SkiaSharp.SKShaderTileMode tileMode, bool convolveAlpha, SkiaSharp.SKImageFilter? input);

Parameters

kernelSize
SKSizeI

The size of the convolution kernel.

kernel
ReadOnlySpan<Single>

The convolution kernel values.

gain
Single

The gain factor applied to each pixel.

bias
Single

The bias added to each pixel after applying the kernel.

kernelOffset
SKPointI

The offset within the kernel for the source pixel.

tileMode
SKShaderTileMode

The tile mode for edge handling.

convolveAlpha
Boolean

Whether to also convolve the alpha channel.

input
SKImageFilter

The input filter to use, or null to use the source bitmap.

Returns

Returns the new SKImageFilter, or null on error.

Applies to

CreateMatrixConvolution(SKSizeI, ReadOnlySpan<Single>, Single, Single, SKPointI, SKShaderTileMode, Boolean, SKImageFilter, SKRect)

Creates an image filter that applies a matrix convolution.

public static SkiaSharp.SKImageFilter CreateMatrixConvolution(SkiaSharp.SKSizeI kernelSize, ReadOnlySpan<float> kernel, float gain, float bias, SkiaSharp.SKPointI kernelOffset, SkiaSharp.SKShaderTileMode tileMode, bool convolveAlpha, SkiaSharp.SKImageFilter? input, SkiaSharp.SKRect cropRect);

Parameters

kernelSize
SKSizeI

The size of the convolution kernel.

kernel
ReadOnlySpan<Single>

The convolution kernel values.

gain
Single

The gain factor applied to each pixel.

bias
Single

The bias added to each pixel after applying the kernel.

kernelOffset
SKPointI

The offset within the kernel for the source pixel.

tileMode
SKShaderTileMode

The tile mode for edge handling.

convolveAlpha
Boolean

Whether to also convolve the alpha channel.

input
SKImageFilter

The input filter to use, or null to use the source bitmap.

cropRect
SKRect

The rectangle to which the output processing will be limited.

Returns

Returns the new SKImageFilter, or null on error.

Applies to