50度灰 v5.8.2版本的 MD5 值为:9fe3d350fdc75fa1a3ec45509fa0107e
以下内容为反编译后的 d.java 源代码,内容仅作参考
package fr.tvbarthel.lib.blurdialogfragment;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v8.renderscript.Allocation;
import android.support.v8.renderscript.Element;
import android.support.v8.renderscript.RSRuntimeException;
import android.support.v8.renderscript.RenderScript;
import android.support.v8.renderscript.ScriptIntrinsicBlur;
import android.util.Log;
final class d {
private static final String f12062a = "d";
private d() {
}
private static Bitmap a(Bitmap bitmap) {
return bitmap.copy(Bitmap.Config.ARGB_8888, true);
}
public static Bitmap b(Bitmap bitmap, int i, boolean z, Context context) {
if (!z) {
bitmap = bitmap.copy(bitmap.getConfig(), true);
}
if (bitmap.getConfig() == Bitmap.Config.RGB_565) {
bitmap = a(bitmap);
}
try {
RenderScript create = RenderScript.create(context);
Allocation createFromBitmap = Allocation.createFromBitmap(create, bitmap, Allocation.MipmapControl.MIPMAP_NONE, 1);
Allocation createTyped = Allocation.createTyped(create, createFromBitmap.getType());
ScriptIntrinsicBlur create2 = ScriptIntrinsicBlur.create(create, Element.U8_4(create));
create2.setRadius(i);
create2.setInput(createFromBitmap);
create2.forEach(createTyped);
createTyped.copyTo(bitmap);
return bitmap;
} catch (RSRuntimeException unused) {
Log.e(f12062a, "RenderScript known error : https://code.google.com/p/android/issues/detail?id=71347 continue with the FastBlur approach.");
return null;
}
}
}