/// <summary> /// Apply filter. /// </summary> /// <param name="bmData">Bitmap data</param> public void Apply(BitmapData bmData) { Bitmap Max = (Bitmap)BitmapFormat.Bitmap(bmData).Clone(); Bitmap Min = (Bitmap)Max.Clone(); di.Apply(Max); er.Apply(Min); BitmapData bmMax = BitmapFormat.Lock32bpp(Max); BitmapData bmMin = BitmapFormat.Lock32bpp(Min); if (smoothing) { gb.Apply(bmMax); } gb.Apply(bmMin); Apply(bmData, bmMax, bmMin); BitmapFormat.Unlock(Max, bmMax); BitmapFormat.Unlock(Min, bmMin); Max.Dispose(); Min.Dispose(); return; }
/// <summary> /// Apply filter. /// </summary> /// <param name="bmData">Bitmap data</param> /// <param name="bmSrc">Bitmap data</param> public unsafe void Apply(BitmapData bmData, BitmapData bmSrc) { // rebuild? if (rebuild == true) { this.Rebuild(); } this.rebuild = false; // box blur gb.Apply(bmSrc); // filter switch (space) { case Imaging.Space.HSB: ApplyHSB(bmData, bmSrc); break; case Imaging.Space.HSL: ApplyHSL(bmData, bmSrc); break; case Imaging.Space.YCbCr: ApplyYCbCr(bmData, bmSrc); break; case Imaging.Space.RGB: ApplyRGB(bmData, bmSrc); break; default: ApplyGrayscale(bmData, bmSrc); break; } return; }
/// <summary> /// Apply filter. /// </summary> /// <param name="bmData">Bitmap data</param> /// <param name="bmSrc">Bitmap data</param> public void Apply(BitmapData bmData, BitmapData bmSrc) { gb.Apply(bmSrc); flatfield(bmData, bmSrc); return; }