Image Filter art --- Wave filter, image filter --- wave
Wave Filter the water Filter simulates the effect of water waves by means of coordinate transformation, so that the image presents a special effect of water waves. This filter has an adjustable parameter: the distortion of water waves. The Code is as follows: // Wave Filter ///// Source image. /// The degree of wave, 0-100. /// The result image. private Bitmap WaveFilterProcess (Bitmap srcBitmap, int degree) {Bitmap a = new Bitmap (srcBitmap); int w =. width; int h =. height; degree = degree * 32/100; degree = Math. max (0, Math. min (32, degree); Bitmap dst = new Bitmap (w, h); System. drawing. imaging. bitmapData srcData =. lockBits (new Rectangle (0, 0, w, h), System. drawing. imaging. imageLockMode. readWrite, System. drawing. imaging. pixelFormat. format32bppArgb); System. drawing. imaging. bitmapData dstData = dst. lockBits (new Rectangle (0, 0, w, h), System. drawing. imaging. imageLockMode. readWrite, System. drawing. imaging. pixelFormat. format32bppArgb); unsafe {byte * pIn = (byte *) srcData. scan0.ToPointer (); byte * pOut = (byte *) dstData. scan0.ToPointer (); byte * p = null; int stride = srcData. stride-w * 4; int newX = 0, newY = 0; double PI2 = Math. PI * 2.0; for (int y = 0; y :
Source image
Water Filter
Finally put a complete C # version of the program Demo: http://www.zealpixel.com/thread-59-1-1.html
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.