package s1;

import android.graphics.Bitmap;
import s1.v0;

/* loaded from: classes.dex */
public abstract class i {
    public static final u0 a(int i10, int i11, int i12, boolean z10, t1.c cVar) {
        d(i12);
        return new h(s.b(i10, i11, i12, z10, cVar));
    }

    public static final Bitmap b(u0 u0Var) {
        if (u0Var instanceof h) {
            return ((h) u0Var).c();
        }
        throw new UnsupportedOperationException("Unable to obtain android.graphics.Bitmap");
    }

    public static final u0 c(Bitmap bitmap) {
        return new h(bitmap);
    }

    public static final Bitmap.Config d(int i10) {
        v0.a aVar = v0.f35367b;
        return v0.i(i10, aVar.b()) ? Bitmap.Config.ARGB_8888 : v0.i(i10, aVar.a()) ? Bitmap.Config.ALPHA_8 : v0.i(i10, aVar.e()) ? Bitmap.Config.RGB_565 : v0.i(i10, aVar.c()) ? Bitmap.Config.RGBA_F16 : v0.i(i10, aVar.d()) ? Bitmap.Config.HARDWARE : Bitmap.Config.ARGB_8888;
    }

    public static final int e(Bitmap.Config config) {
        return config == Bitmap.Config.ALPHA_8 ? v0.f35367b.a() : config == Bitmap.Config.RGB_565 ? v0.f35367b.e() : config == Bitmap.Config.ARGB_4444 ? v0.f35367b.b() : config == Bitmap.Config.RGBA_F16 ? v0.f35367b.c() : config == Bitmap.Config.HARDWARE ? v0.f35367b.d() : v0.f35367b.b();
    }
}
