private Bitmap FilterProcess(Bitmap a)
{
Bitmap srcBitmap = new Bitmap(a);
int w = srcBitmap.Width;
int h = srcBitmap.Height;
System.Drawing.Imaging.BitmapData srcData = srcBitmap.LockBits(new Rectangle(0, 0, w, h), System.Drawing.Imaging.ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
byte* pSrc = (byte*)srcData.Scan0;
int offset = srcData.Stride - w * 4;
int r, g, b;
for (int j = 0; j < h; j++)
{
for (int i = 0; i < w; i++)
{
b = pSrc[0];
g = pSrc[1];
r = pSrc[2];
pSrc[2] = (byte)(r * r / 255);
pSrc[1] = (byte)(g * g / 255);
pSrc[0] = (byte)(b * b / 255);
pSrc += 4;
}
pSrc += offset;
}
srcBitmap.UnlockBits(srcData);
return srcBitmap;
}