ImageGear21.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class : Convolve Method |
'Declaration Public Shared Sub Convolve( _ ByVal page As ImGearRasterPage, _ ByVal matrix(,) As Integer, _ ByVal normalizer As Double, _ ByVal resultMode As ImGearConvolutionResults, _ ByVal addResultToOriginalPixels As Boolean, _ ByVal channels As ImGearChannelRange _ )
'Usage Dim page As ImGearRasterPage Dim matrix() As Integer Dim normalizer As Double Dim resultMode As ImGearConvolutionResults Dim addResultToOriginalPixels As Boolean Dim channels As ImGearChannelRange ImGearRasterProcessing.Convolve(page, matrix, normalizer, resultMode, addResultToOriginalPixels, channels)
public static void Convolve( ImGearRasterPage page, int[,] matrix, double normalizer, ImGearConvolutionResults resultMode, bool addResultToOriginalPixels, ImGearChannelRange channels )
public: static void Convolve( ImGearRasterPage* page, int[,]* matrix, double normalizer, ImGearConvolutionResults resultMode, bool addResultToOriginalPixels, ImGearChannelRange channels )
public: static void Convolve( ImGearRasterPage^ page, array<int>^ matrix, double normalizer, ImGearConvolutionResults resultMode, bool addResultToOriginalPixels, ImGearChannelRange channels )
Can be applied only to the raster pages with standard (non Run-Ends) DIB.
// Convolve an image according to a matrix and normalizer. // Convolution matrix: int[,] matrix = new int[,] { {-1,1,1}, {-1,0,1}, {-1,-1,1} }; // normalizer to be used as denominator for the matrix. const double normalizer = 6; // Channel range to convolve on. ImGearChannelRange igChannelRange = new ImGearChannelRange(0, igRasterPage.DIB.ChannelCount); // Apply the convolution, in this case it has an emboss effect. ImGearRasterProcessing.Convolve(igRasterPage, matrix, normalizer, ImGearConvolutionResults.RAW, true, igChannelRange);
' Convolve an image according to a matrix and normalizer. ' Convolution matrix: Dim matrix As Integer(,) = New Integer(,) { _ {-1, 1, 1}, _ {-1, 0, 1}, _ {-1, -1, 1}} ' normalizer to be used as denominator for the matrix. Dim normalizer As Double = 6 ' Channel range to convolve on. Dim igChannelRange As New ImGearChannelRange(0, igRasterPage.DIB.ChannelCount) ' Apply the convolution, in this case it has an emboss effect. ImGearRasterProcessing.Convolve(igRasterPage, matrix, normalizer, _ ImGearConvolutionResults.RAW, True, igChannelRange)