Esempio n. 1
0
 public void ApplySmooth(double weight)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[1,1] = weight;
     matrix.Factor = weight + 8;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }
Esempio n. 2
0
 public void ApplyGaussianBlur(double peakValue)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[0, 0] = peakValue / 4;
     matrix.Matrix[1, 0] = peakValue / 2;
     matrix.Matrix[2, 0] = peakValue / 4;
     matrix.Matrix[0, 1] = peakValue / 2;
     matrix.Matrix[1, 1] = peakValue;
     matrix.Matrix[2, 1] = peakValue / 2;
     matrix.Matrix[0, 2] = peakValue / 4;
     matrix.Matrix[1, 2] = peakValue / 2;
     matrix.Matrix[2, 2] = peakValue / 4;
     matrix.Factor = peakValue * 4;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }
Esempio n. 3
0
 public void ApplySharpen(double weight)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[0, 0] = 0;
     matrix.Matrix[1, 0] = -2;
     matrix.Matrix[2, 0] = 0;
     matrix.Matrix[0, 1] = -2;
     matrix.Matrix[1, 1] = weight;
     matrix.Matrix[2, 1] = -2;
     matrix.Matrix[0, 2] = 0;
     matrix.Matrix[1, 2] = -2;
     matrix.Matrix[2, 2] = 0;
     matrix.Factor = weight - 8;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }
Esempio n. 4
0
 public void ApplyEmboss(double weight)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[0, 0] = -1;
     matrix.Matrix[1, 0] = 0;
     matrix.Matrix[2, 0] = -1;
     matrix.Matrix[0, 1] = 0;
     matrix.Matrix[1, 1] = weight;
     matrix.Matrix[2, 1] = 0;
     matrix.Matrix[0, 2] = -1;
     matrix.Matrix[1, 2] = 0;
     matrix.Matrix[2, 2] = -1;
     matrix.Factor = 4;
     matrix.Offset = 127;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }