package cm;

import android.graphics.Rect;
import android.util.Log;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;

/* loaded from: classes3.dex */
public class l extends q {

    /* renamed from: b, reason: collision with root package name */
    private static final String f12098b = "l";

    @Override // cm.q
    protected float c(bm.q qVar, bm.q qVar2) {
        if (qVar.f7013p <= 0 || qVar.f7014q <= 0) {
            return BitmapDescriptorFactory.HUE_RED;
        }
        bm.q g10 = qVar.g(qVar2);
        float f10 = (g10.f7013p * 1.0f) / qVar.f7013p;
        if (f10 > 1.0f) {
            f10 = (float) Math.pow(1.0f / f10, 1.1d);
        }
        float f11 = ((g10.f7013p * 1.0f) / qVar2.f7013p) + ((g10.f7014q * 1.0f) / qVar2.f7014q);
        return f10 * ((1.0f / f11) / f11);
    }

    @Override // cm.q
    public Rect d(bm.q qVar, bm.q qVar2) {
        bm.q g10 = qVar.g(qVar2);
        Log.i(f12098b, "Preview: " + qVar + "; Scaled: " + g10 + "; Want: " + qVar2);
        int i10 = (g10.f7013p - qVar2.f7013p) / 2;
        int i11 = (g10.f7014q - qVar2.f7014q) / 2;
        return new Rect(-i10, -i11, g10.f7013p - i10, g10.f7014q - i11);
    }
}
