Example usage for android.renderscript RSRuntimeException printStackTrace

List of usage examples for android.renderscript RSRuntimeException printStackTrace

Introduction

In this page you can find the example usage for android.renderscript RSRuntimeException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:Main.java

/**
 * Create bitmap with blur effect./*  ww  w.j  a  v a  2 s  .c o m*/
 *
 * @param context
 *            application context
 * @param bitmap
 *            PNG bitmap to convert
 * @param radius
 *            the radius of the blur. Supported range 0 < radius <= 25
 * @return bitmap that has been added blur effect
 */
public static Bitmap createBlurBitmap(Context context, Bitmap bitmap, int radius) {
    try {
        if (radius <= 25) {
            return addBlurEffect(context, bitmap, radius);
        } else {
            Bitmap blurred = bitmap;
            int pass = radius / 8;
            for (int idx = 0; idx < pass; idx++) {
                blurred = addBlurEffect(context, blurred, 8);
            }
            return blurred;
        }
    } catch (RSRuntimeException rsex) {
        rsex.printStackTrace();
        return bitmap;
    }
}