title: RenderScript Intrinsics Gaussian blur
body: <p>How do I properly use the RenderScript Intrinsics.</p>
  
  <p>as shown <a href="http://android-developers.blogspot.com/2013/08/renderscript-intrinsics.html" rel="nofollow noreferrer">http://android-developers.blogspot.com/2013/08/renderscript-intrinsics.html</a></p>
  
  <pre><code>//Assuming my original Bitmap is "bm"
  Bitmap outputBitmap = Bitmap.createBitmap(bm.getHeight(),
  bm.getWidth(), Config.ARGB_8888);
  
  RenderScript rs = RenderScript.create(getApplicationContext());
  ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur
  .create(rs, Element.U8_4(rs));
  Allocation tmpIn = Allocation.createFromBitmap(rs, bm);
  Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap);
  theIntrinsic.setRadius(25.f);
  theIntrinsic.setInput(tmpIn);
  theIntrinsic.forEach(tmpOut);
  tmpOut.copyTo(outputBitmap);
  bm.recycle();
  rs.destroy
  </code></pre>
  
  <p>I get some black areas of the outputBitmap on initial layout, but which get filled in after the user scrolls the Scroller of the HorizontalScrollView, making the drawable "refresh" itself.</p>
  
  <p>I get this error too (if it helps):</p>
  
  <pre><code>09-01 05:54:11.246: E/RenderScript(11423): rsAssert failed: !mElements.size(), in frameworks/rs/rsElement.cpp at 375
  </code></pre>
  
  <p>any suggestions regarding proper use of the RS will help.</p>
  
  <p><img src="https://i.stack.imgur.com/YJzCm.png" alt="enter image description here"></p>