package com.mbridge.msdk.newreward.function.h; import android.annotation.TargetApi; import android.graphics.Bitmap; import android.renderscript.Allocation; import android.renderscript.Element; import android.renderscript.RenderScript; import android.renderscript.ScriptIntrinsicBlur; import com.mbridge.msdk.MBridgeConstans; /* loaded from: classes4.dex */ public final class a { /* renamed from: com.mbridge.msdk.newreward.function.h.a$a, reason: collision with other inner class name */ public interface InterfaceC0221a { void blurFailCallBack(); void blurSuccessCallBack(Bitmap bitmap); } public static void a(final Bitmap bitmap, final InterfaceC0221a interfaceC0221a) { try { com.mbridge.msdk.foundation.same.f.a.d().execute(new Runnable() { // from class: com.mbridge.msdk.newreward.function.h.a.1 @Override // java.lang.Runnable public final void run() { if (InterfaceC0221a.this == null) { return; } try { Bitmap b = a.b(bitmap); if (b != null && !b.isRecycled()) { InterfaceC0221a.this.blurSuccessCallBack(b); } else { InterfaceC0221a.this.blurFailCallBack(); } } catch (Exception unused) { InterfaceC0221a.this.blurFailCallBack(); } } }); } catch (Exception e) { if (MBridgeConstans.DEBUG) { e.printStackTrace(); } } } /* JADX INFO: Access modifiers changed from: private */ @TargetApi(17) public static Bitmap b(Bitmap bitmap) { try { Bitmap createBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_4444); RenderScript create = RenderScript.create(com.mbridge.msdk.foundation.controller.c.m().c()); ScriptIntrinsicBlur create2 = ScriptIntrinsicBlur.create(create, Element.U8_4(create)); Allocation createFromBitmap = Allocation.createFromBitmap(create, bitmap); Allocation createFromBitmap2 = Allocation.createFromBitmap(create, createBitmap); create2.setRadius(25.0f); create2.setInput(createFromBitmap); create2.forEach(createFromBitmap2); createFromBitmap2.copyTo(createBitmap); create.destroy(); return createBitmap; } catch (Throwable unused) { return null; } } }