Back to project page LiveBlurListView.
The source code is released under:
Apache License
If you think the Android project LiveBlurListView listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.koalcat.view; /* w w w. j a v a2 s. c om*/ import android.content.Context; import android.graphics.Bitmap; import android.renderscript.Allocation; import android.renderscript.RenderScript; public abstract class RSRender implements BaseRender { protected RenderScript rs; public RSRender(Context context) { rs = RenderScript.create(context); } @Override public void blur(float radius, Bitmap in, Bitmap out) { Allocation tmpIn = Allocation.createFromBitmap(rs, in); Allocation tmpOut = Allocation.createFromBitmap(rs, out); blur(radius, tmpIn, tmpOut); tmpOut.copyTo(out); tmpIn.destroy(); tmpOut.destroy(); } public abstract void blur(float radius, Allocation tmpIn, Allocation tmpOut); @Override public void destroy() { if (rs != null) rs.destroy(); } }