Android Open Source - LiveBlurListView R S Render






From Project

Back to project page LiveBlurListView.

License

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.

Java Source Code

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();
  }
}




Java Source Code List

com.koalcat.blurdemo.AppInfo.java
com.koalcat.blurdemo.ApplicationsAdapter.java
com.koalcat.blurdemo.BlurActivity.java
com.koalcat.blurdemo.FastBitmapDrawable.java
com.koalcat.blurdemo.HanziToPinyin.java
com.koalcat.blurdemo.IndexCursor.java
com.koalcat.blurdemo.Utilities.java
com.koalcat.view.BaseRender.java
com.koalcat.view.BlurRSRender.java
com.koalcat.view.Blur.java
com.koalcat.view.GLRender.java
com.koalcat.view.JNIRender.java
com.koalcat.view.LiveBlurListView.java
com.koalcat.view.LiveBlurViewGroup.java
com.koalcat.view.RSRender.java
com.koalcat.view.ScriptIntrinsicBlurRender.java