package o;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
import java.nio.ByteBuffer;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Od, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0366Od implements InterfaceC0386Ox {
    public final /* synthetic */ int a;
    public final NU b;
    public final Object c;

    public /* synthetic */ C0366Od(Object obj, NU nu, int i) {
        this.a = i;
        this.c = obj;
        this.b = nu;
    }

    @Override // o.InterfaceC0386Ox
    public final Object a(InterfaceC0220Im interfaceC0220Im) {
        int i = this.a;
        Object obj = this.c;
        NU nu = this.b;
        switch (i) {
            case 0:
                return new C2664ut(new BitmapDrawable(nu.a.getResources(), (Bitmap) obj), false, 2);
            case 1:
                ByteBuffer byteBuffer = (ByteBuffer) obj;
                try {
                    C0732af c0732af = new C0732af();
                    c0732af.write(byteBuffer);
                    byteBuffer.position(0);
                    Context context = nu.a;
                    return new X90(new U90(c0732af, null), null, 2);
                } catch (Throwable th) {
                    byteBuffer.position(0);
                    throw th;
                }
            default:
                Drawable bitmapDrawable = (Drawable) obj;
                Bitmap.Config[] configArr = AbstractC1345h.a;
                boolean z = (bitmapDrawable instanceof VectorDrawable) || (bitmapDrawable instanceof Wi0);
                if (z) {
                    bitmapDrawable = new BitmapDrawable(nu.a.getResources(), AbstractC0940cn0.n(bitmapDrawable, nu.b, nu.c, nu.d, nu.e));
                }
                return new C2664ut(bitmapDrawable, z, 2);
        }
    }
}
