VectSharp  2.2.1
A light library for C# vector graphics
VectSharp.Filters.ConvolutionFilter Class Reference

Represents a filter that applies a matrix convolution to the image. More...

Inheritance diagram for VectSharp.Filters.ConvolutionFilter:

Public Member Functions

 ConvolutionFilter (double[,] kernel, double scale, bool preserveAlpha=true, double normalisation=1, double bias=0)
 Creates a new ConvolutionFilter with the specified parameters. More...
 
virtual RasterImage Filter (RasterImage image, double scale)
 Applies the filter to a RasterImage.
 

Properties

Point TopLeftMargin [get]
 
Point BottomRightMargin [get]
 
virtual double[,] Kernel [get]
 The kernel of the ConvolutionFilter. The dimensions of this matrix should all be odd numbers. The larger the kernel, the worse the performance. More...
 
virtual double Normalisation = 1 [get]
 The normalisation value that is applies to the kernel. More...
 
virtual double Bias = 0 [get]
 The bias value that is added to every colour component when the filter is applied. More...
 
virtual double Scale [get]
 The scale relating the size of the kernel to graphics units. More...
 
virtual bool PreserveAlpha = true [get]
 If this is true, the alpha value of the input pixels is preserved. Otherwise, the alpha channel is subject to the same convolution process as the other colour components. More...
 
- Properties inherited from VectSharp.Filters.IFilter
Point TopLeftMargin [get]
 Determines how much the area of the filter's subject should be expanded on the top-left to accommodate the results of the filter. More...
 
Point BottomRightMargin [get]
 Determines how much the area of the filter's subject should be expanded on the bottom-right to accommodate the results of the filter. More...
 

Detailed Description

Represents a filter that applies a matrix convolution to the image.

Definition at line 26 of file ConvolutionFilter.cs.

Constructor & Destructor Documentation

◆ ConvolutionFilter()

VectSharp.Filters.ConvolutionFilter.ConvolutionFilter ( double  kernel[,],
double  scale,
bool  preserveAlpha = true,
double  normalisation = 1,
double  bias = 0 
)

Creates a new ConvolutionFilter with the specified parameters.

Parameters
kernelThe kernel of the ConvolutionFilter. The dimensions of this matrix should all be odd numbers. The larger the kernel, the worse the performance.
scaleThe scale relating the size of the kernel to graphics units.
preserveAlphaIf this is true, the alpha value of the input pixels is preserved. Otherwise, the alpha channel is subject to the same convolution process as the other colour components.
normalisationThe normalisation value that is applies to the kernel.
biasThe bias value that is added to every colour component when the filter is applied.
Exceptions
ArgumentExceptionThis exception is thrown when the kernel dimensions are not odd numbers.

Definition at line 67 of file ConvolutionFilter.cs.

Property Documentation

◆ Bias

virtual double VectSharp.Filters.ConvolutionFilter.Bias = 0
get

The bias value that is added to every colour component when the filter is applied.

Definition at line 46 of file ConvolutionFilter.cs.

◆ Kernel

virtual double [,] VectSharp.Filters.ConvolutionFilter.Kernel
get

The kernel of the ConvolutionFilter. The dimensions of this matrix should all be odd numbers. The larger the kernel, the worse the performance.

Definition at line 36 of file ConvolutionFilter.cs.

◆ Normalisation

virtual double VectSharp.Filters.ConvolutionFilter.Normalisation = 1
get

The normalisation value that is applies to the kernel.

Definition at line 41 of file ConvolutionFilter.cs.

◆ PreserveAlpha

virtual bool VectSharp.Filters.ConvolutionFilter.PreserveAlpha = true
get

If this is true, the alpha value of the input pixels is preserved. Otherwise, the alpha channel is subject to the same convolution process as the other colour components.

Definition at line 56 of file ConvolutionFilter.cs.

◆ Scale

virtual double VectSharp.Filters.ConvolutionFilter.Scale
get

The scale relating the size of the kernel to graphics units.

Definition at line 51 of file ConvolutionFilter.cs.


The documentation for this class was generated from the following file: