private void BoxBlurRGB24(BitmapRGB24 input, BitmapRGB24 output, BitmapRGB32 mask = null) { Contract.Requires(input != null); Contract.Requires(output != null); Contract.Requires(input.Width == output.Width); Contract.Requires(input.Height == output.Height); int radius = this.Radius; int w = input.Width; int h = input.Height; var bmp = output; var pix = bmp.Pixels; float div = (float)Math.Pow((radius * 2 + 1), 2); for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { var tr = 0.0; var tg = 0.0; var tb = 0.0; for (int ky = -radius; ky <= radius; ky++) { for (int kx = -radius; kx <= radius; kx++) { var px = Math.Max(Math.Min(x + kx, w - 1), 0); var py = Math.Max(Math.Min(y + ky, h - 1), 0); var p = input[px, py]; tr += p.Red; tg += p.Green; tb += p.Blue; //div += 1; } } //total.Alpha = 1.0f; bmp[x, y] = new ColorRGB24((byte)(tr / 255.0 * (255.0 / div)), (byte)(tg / 255.0 * (255.0 / div)), (byte)(tb / 255.0 * (255.0 / div))); } } }
private void BoxBlurRGB32(BitmapRGB32 input, BitmapRGB32 output, BitmapRGB32 mask = null) { Contract.Requires(input != null); Contract.Requires(output != null); }
private BitmapRGB32 ApplyEffectRGB32(BitmapRGB32 input) { throw new NotImplementedException(); }