package t1;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import s1.i0;

/* loaded from: classes.dex */
public final class m extends c {

    /* renamed from: e, reason: collision with root package name */
    public static final a f36040e = new a(null);

    /* renamed from: f, reason: collision with root package name */
    private static final float[] f36041f;

    /* renamed from: g, reason: collision with root package name */
    private static final float[] f36042g;

    /* renamed from: h, reason: collision with root package name */
    private static final float[] f36043h;

    /* renamed from: i, reason: collision with root package name */
    private static final float[] f36044i;

    /* loaded from: classes.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    static {
        float[] b10 = t1.a.f35979b.a().b();
        k kVar = k.f36028a;
        float[] l10 = d.l(new float[]{0.818933f, 0.032984544f, 0.0482003f, 0.36186674f, 0.9293119f, 0.26436627f, -0.12885971f, 0.03614564f, 0.6338517f}, d.e(b10, kVar.b().c(), kVar.e().c()));
        f36041f = l10;
        float[] fArr = {0.21045426f, 1.9779985f, 0.025904037f, 0.7936178f, -2.4285922f, 0.78277177f, -0.004072047f, 0.4505937f, -0.80867577f};
        f36042g = fArr;
        f36043h = d.k(l10);
        f36044i = d.k(fArr);
    }

    public m(String str, int i10) {
        super(str, b.f35984a.a(), i10, null);
    }

    @Override // t1.c
    public float c(int i10) {
        return i10 == 0 ? 1.0f : 0.5f;
    }

    @Override // t1.c
    public float d(int i10) {
        if (i10 == 0) {
            return BitmapDescriptorFactory.HUE_RED;
        }
        return -0.5f;
    }

    @Override // t1.c
    public long h(float f10, float f11, float f12) {
        if (f10 < BitmapDescriptorFactory.HUE_RED) {
            f10 = 0.0f;
        }
        if (f10 > 1.0f) {
            f10 = 1.0f;
        }
        if (f11 < -0.5f) {
            f11 = -0.5f;
        }
        if (f11 > 0.5f) {
            f11 = 0.5f;
        }
        if (f12 < -0.5f) {
            f12 = -0.5f;
        }
        float f13 = f12 <= 0.5f ? f12 : 0.5f;
        float[] fArr = f36044i;
        float f14 = (fArr[0] * f10) + (fArr[3] * f11) + (fArr[6] * f13);
        float f15 = (fArr[1] * f10) + (fArr[4] * f11) + (fArr[7] * f13);
        float f16 = (fArr[2] * f10) + (fArr[5] * f11) + (fArr[8] * f13);
        float f17 = f14 * f14 * f14;
        float f18 = f15 * f15 * f15;
        float f19 = f16 * f16 * f16;
        float[] fArr2 = f36043h;
        return (Float.floatToRawIntBits(((fArr2[0] * f17) + (fArr2[3] * f18)) + (fArr2[6] * f19)) << 32) | (Float.floatToRawIntBits((fArr2[1] * f17) + (fArr2[4] * f18) + (fArr2[7] * f19)) & 4294967295L);
    }

    @Override // t1.c
    public float i(float f10, float f11, float f12) {
        if (f10 < BitmapDescriptorFactory.HUE_RED) {
            f10 = 0.0f;
        }
        if (f10 > 1.0f) {
            f10 = 1.0f;
        }
        if (f11 < -0.5f) {
            f11 = -0.5f;
        }
        if (f11 > 0.5f) {
            f11 = 0.5f;
        }
        if (f12 < -0.5f) {
            f12 = -0.5f;
        }
        float f13 = f12 <= 0.5f ? f12 : 0.5f;
        float[] fArr = f36044i;
        float f14 = (fArr[0] * f10) + (fArr[3] * f11) + (fArr[6] * f13);
        float f15 = (fArr[1] * f10) + (fArr[4] * f11) + (fArr[7] * f13);
        float f16 = (fArr[2] * f10) + (fArr[5] * f11) + (fArr[8] * f13);
        float f17 = f14 * f14 * f14;
        float f18 = f15 * f15 * f15;
        float[] fArr2 = f36043h;
        return (fArr2[2] * f17) + (fArr2[5] * f18) + (fArr2[8] * f16 * f16 * f16);
    }

    @Override // t1.c
    public long j(float f10, float f11, float f12, float f13, c cVar) {
        float[] fArr = f36041f;
        float f14 = (fArr[0] * f10) + (fArr[3] * f11) + (fArr[6] * f12);
        float f15 = (fArr[1] * f10) + (fArr[4] * f11) + (fArr[7] * f12);
        float f16 = (fArr[2] * f10) + (fArr[5] * f11) + (fArr[8] * f12);
        float a10 = e3.b.a(f14);
        float a11 = e3.b.a(f15);
        float a12 = e3.b.a(f16);
        float[] fArr2 = f36042g;
        return i0.a((fArr2[0] * a10) + (fArr2[3] * a11) + (fArr2[6] * a12), (fArr2[1] * a10) + (fArr2[4] * a11) + (fArr2[7] * a12), (fArr2[2] * a10) + (fArr2[5] * a11) + (fArr2[8] * a12), f13, cVar);
    }
}
