Skip to content

Instantly share code, notes, and snippets.

@wangyung
Created December 8, 2015 14:36
Show Gist options
  • Save wangyung/d9f1d8a26137f6229ed1 to your computer and use it in GitHub Desktop.
Save wangyung/d9f1d8a26137f6229ed1 to your computer and use it in GitHub Desktop.
Renderscript for blur
RenderScript rs = RenderScript.create(theActivity);
ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(mRS, Element.U8_4(rs));;
Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap);
Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap);
theIntrinsic.setRadius(25.f);
theIntrinsic.setInput(tmpIn);
theIntrinsic.forEach(tmpOut);
tmpOut.copyTo(outputBitmap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment