mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-05 11:59:30 +01:00
280 lines
15 KiB
Java
280 lines
15 KiB
Java
package androidx.graphics.shapes;
|
|
|
|
import androidx.collection.FloatFloatPair;
|
|
import com.amazon.alexa.redesign.view.container.CardStudioAgentSpaceMetrics;
|
|
import java.util.Arrays;
|
|
import kotlin.Metadata;
|
|
import kotlin.Pair;
|
|
import kotlin.TuplesKt;
|
|
import kotlin.collections.ArraysKt___ArraysJvmKt;
|
|
import kotlin.jvm.JvmStatic;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import okio.Buffer$$ExternalSyntheticBUOutline0;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
import rx.Single$$ExternalSyntheticBUOutline0;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000V\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0014\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0013\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0016\u0018\u0000 ?2\u00020\u0001:\u0001?B7\b\u0010\u0012\n\u0010\u0002\u001a\u00060\u0003j\u0002`\u0004\u0012\n\u0010\u0005\u001a\u00060\u0003j\u0002`\u0004\u0012\n\u0010\u0006\u001a\u00060\u0003j\u0002`\u0004\u0012\n\u0010\u0007\u001a\u00060\u0003j\u0002`\u0004¢\u0006\u0002\u0010\bB\u0011\b\u0000\u0012\b\b\u0002\u0010\t\u001a\u00020\n¢\u0006\u0002\u0010\u000bJ!\u0010 \u001a\u00020!2\b\b\u0002\u0010\"\u001a\u00020\n2\b\b\u0002\u0010#\u001a\u00020$H\u0000¢\u0006\u0002\b%J\u0011\u0010&\u001a\u00020\u00002\u0006\u0010'\u001a\u00020\rH\u0086\u0002J\u0011\u0010&\u001a\u00020\u00002\u0006\u0010'\u001a\u00020(H\u0086\u0002J\u0013\u0010)\u001a\u00020$2\b\u0010*\u001a\u0004\u0018\u00010\u0001H\u0096\u0002J\b\u0010+\u001a\u00020(H\u0016J\u0011\u0010,\u001a\u00020\u00002\u0006\u0010-\u001a\u00020\u0000H\u0086\u0002J!\u0010.\u001a\u00060\u0003j\u0002`\u00042\u0006\u0010/\u001a\u00020\rH\u0000ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b0\u00101J\u0006\u00102\u001a\u00020\u0000J\u001a\u00103\u001a\u000e\u0012\u0004\u0012\u00020\u0000\u0012\u0004\u0012\u00020\u0000042\u0006\u0010/\u001a\u00020\rJ\u0011\u00105\u001a\u00020\u00002\u0006\u0010'\u001a\u00020\rH\u0086\u0002J\u0011\u00105\u001a\u00020\u00002\u0006\u0010'\u001a\u00020(H\u0086\u0002J\b\u00106\u001a\u000207H\u0016J\u000e\u00108\u001a\u00020\u00002\u0006\u00109\u001a\u00020:J\u0010\u0010;\u001a\u00020$2\u0006\u0010<\u001a\u00020\rH\u0002J\r\u0010=\u001a\u00020$H\u0000¢\u0006\u0002\b>R\u0011\u0010\f\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000fR\u0011\u0010\u0010\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u000fR\u0011\u0010\u0012\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u0013\u0010\u000fR\u0011\u0010\u0014\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u0015\u0010\u000fR\u0011\u0010\u0016\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u0017\u0010\u000fR\u0011\u0010\u0018\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u0019\u0010\u000fR\u0011\u0010\u001a\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u001b\u0010\u000fR\u0011\u0010\u001c\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u001d\u0010\u000fR\u0014\u0010\t\u001a\u00020\nX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u001e\u0010\u001f\u0082\u0002\u000b\n\u0002\b!\n\u0005\b¡\u001e0\u0001¨\u0006@"}, d2 = {"Landroidx/graphics/shapes/Cubic;", "", "anchor0", "Landroidx/collection/FloatFloatPair;", "Landroidx/graphics/shapes/Point;", "control0", "control1", "anchor1", "(JJJJLkotlin/jvm/internal/DefaultConstructorMarker;)V", "points", "", "([F)V", "anchor0X", "", "getAnchor0X", "()F", "anchor0Y", "getAnchor0Y", "anchor1X", "getAnchor1X", "anchor1Y", "getAnchor1Y", "control0X", "getControl0X", "control0Y", "getControl0Y", "control1X", "getControl1X", "control1Y", "getControl1Y", "getPoints$graphics_shapes_release", "()[F", "calculateBounds", "", "bounds", "approximate", "", "calculateBounds$graphics_shapes_release", "div", "x", "", "equals", CardStudioAgentSpaceMetrics.DimensionValue.SCHEME_OTHER, "hashCode", "plus", "o", "pointOnCurve", "t", "pointOnCurve-OOQOV4g$graphics_shapes_release", "(F)J", "reverse", "split", "Lkotlin/Pair;", "times", "toString", "", "transformed", "f", "Landroidx/graphics/shapes/PointTransformer;", "zeroIsh", "value", "zeroLength", "zeroLength$graphics_shapes_release", "Companion", "graphics-shapes_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nCubic.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Cubic.kt\nandroidx/graphics/shapes/Cubic\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,448:1\n1#2:449\n*E\n"})
|
|
/* loaded from: classes14.dex */
|
|
public class Cubic {
|
|
|
|
/* renamed from: Companion, reason: from kotlin metadata */
|
|
@NotNull
|
|
public static final Companion INSTANCE = new Companion(null);
|
|
|
|
@NotNull
|
|
private final float[] points;
|
|
|
|
private Cubic(long j, long j2, long j3, long j4) {
|
|
this(new float[]{PointKt.m7746getXDnnuFBc(j), PointKt.m7747getYDnnuFBc(j), PointKt.m7746getXDnnuFBc(j2), PointKt.m7747getYDnnuFBc(j2), PointKt.m7746getXDnnuFBc(j3), PointKt.m7747getYDnnuFBc(j3), PointKt.m7746getXDnnuFBc(j4), PointKt.m7747getYDnnuFBc(j4)});
|
|
}
|
|
|
|
public static /* synthetic */ void calculateBounds$graphics_shapes_release$default(Cubic cubic, float[] fArr, boolean z, int i, Object obj) {
|
|
if (obj != null) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: calculateBounds");
|
|
return;
|
|
}
|
|
if ((i & 1) != 0) {
|
|
fArr = new float[4];
|
|
}
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
cubic.calculateBounds$graphics_shapes_release(fArr, z);
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public static final Cubic circularArc(float f, float f2, float f3, float f4, float f5, float f6) {
|
|
return INSTANCE.circularArc(f, f2, f3, f4, f5, f6);
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public static final Cubic straightLine(float f, float f2, float f3, float f4) {
|
|
return INSTANCE.straightLine(f, f2, f3, f4);
|
|
}
|
|
|
|
private final boolean zeroIsh(float value) {
|
|
return Math.abs(value) < 1.0E-4f;
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:37:0x01c0, code lost:
|
|
|
|
if (r0 > r8) goto L63;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:38:0x01c2, code lost:
|
|
|
|
r8 = r0;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:63:0x0211, code lost:
|
|
|
|
if (r0 > r8) goto L63;
|
|
*/
|
|
/* JADX WARN: Removed duplicated region for block: B:27:0x019d */
|
|
/* JADX WARN: Removed duplicated region for block: B:43:0x01c4 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final void calculateBounds$graphics_shapes_release(@org.jetbrains.annotations.NotNull float[] r22, boolean r23) {
|
|
/*
|
|
Method dump skipped, instructions count: 542
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.graphics.shapes.Cubic.calculateBounds$graphics_shapes_release(float[], boolean):void");
|
|
}
|
|
|
|
@NotNull
|
|
public final Cubic div(float x) {
|
|
return times(1.0f / x);
|
|
}
|
|
|
|
public boolean equals(@Nullable Object other) {
|
|
if (this == other) {
|
|
return true;
|
|
}
|
|
if (other instanceof Cubic) {
|
|
return Arrays.equals(this.points, ((Cubic) other).points);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final float getAnchor0X() {
|
|
return this.points[0];
|
|
}
|
|
|
|
public final float getAnchor0Y() {
|
|
return this.points[1];
|
|
}
|
|
|
|
public final float getAnchor1X() {
|
|
return this.points[6];
|
|
}
|
|
|
|
public final float getAnchor1Y() {
|
|
return this.points[7];
|
|
}
|
|
|
|
public final float getControl0X() {
|
|
return this.points[2];
|
|
}
|
|
|
|
public final float getControl0Y() {
|
|
return this.points[3];
|
|
}
|
|
|
|
public final float getControl1X() {
|
|
return this.points[4];
|
|
}
|
|
|
|
public final float getControl1Y() {
|
|
return this.points[5];
|
|
}
|
|
|
|
@NotNull
|
|
/* renamed from: getPoints$graphics_shapes_release, reason: from getter */
|
|
public final float[] getPoints() {
|
|
return this.points;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Arrays.hashCode(this.points);
|
|
}
|
|
|
|
@NotNull
|
|
public final Cubic plus(@NotNull Cubic o) {
|
|
o.getClass();
|
|
float[] fArr = new float[8];
|
|
for (int i = 0; i < 8; i++) {
|
|
fArr[i] = this.points[i] + o.points[i];
|
|
}
|
|
return new Cubic(fArr);
|
|
}
|
|
|
|
/* renamed from: pointOnCurve-OOQOV4g$graphics_shapes_release, reason: not valid java name */
|
|
public final long m7734pointOnCurveOOQOV4g$graphics_shapes_release(float t) {
|
|
float f = 1 - t;
|
|
float f2 = f * f * f;
|
|
float f3 = 3 * t;
|
|
float f4 = f3 * f * f;
|
|
float f5 = f3 * t * f;
|
|
float f6 = t * t * t;
|
|
return FloatFloatPair.m195constructorimpl((getAnchor1X() * f6) + (getControl1X() * f5) + (getControl0X() * f4) + (getAnchor0X() * f2), (getAnchor1Y() * f6) + (getControl1Y() * f5) + (getControl0Y() * f4) + (getAnchor0Y() * f2));
|
|
}
|
|
|
|
@NotNull
|
|
public final Cubic reverse() {
|
|
return CubicKt.Cubic(getAnchor1X(), getAnchor1Y(), getControl1X(), getControl1Y(), getControl0X(), getControl0Y(), getAnchor0X(), getAnchor0Y());
|
|
}
|
|
|
|
@NotNull
|
|
public final Pair<Cubic, Cubic> split(float t) {
|
|
float f = 1 - t;
|
|
long m7734pointOnCurveOOQOV4g$graphics_shapes_release = m7734pointOnCurveOOQOV4g$graphics_shapes_release(t);
|
|
float f2 = f * f;
|
|
float f3 = 2 * f * t;
|
|
float f4 = t * t;
|
|
return TuplesKt.to(CubicKt.Cubic(getAnchor0X(), getAnchor0Y(), (getAnchor0X() * f) + (getControl0X() * t), (getAnchor0Y() * f) + (getControl0Y() * t), (getControl1X() * f4) + (getControl0X() * f3) + (getAnchor0X() * f2), (getControl1Y() * f4) + (getControl0Y() * f3) + (getAnchor0Y() * f2), PointKt.m7746getXDnnuFBc(m7734pointOnCurveOOQOV4g$graphics_shapes_release), PointKt.m7747getYDnnuFBc(m7734pointOnCurveOOQOV4g$graphics_shapes_release)), CubicKt.Cubic(PointKt.m7746getXDnnuFBc(m7734pointOnCurveOOQOV4g$graphics_shapes_release), PointKt.m7747getYDnnuFBc(m7734pointOnCurveOOQOV4g$graphics_shapes_release), (getAnchor1X() * f4) + (getControl1X() * f3) + (getControl0X() * f2), (getAnchor1Y() * f4) + (getControl1Y() * f3) + (getControl0Y() * f2), (getAnchor1X() * t) + (getControl1X() * f), (getAnchor1Y() * t) + (getControl1Y() * f), getAnchor1X(), getAnchor1Y()));
|
|
}
|
|
|
|
@NotNull
|
|
public final Cubic times(float x) {
|
|
float[] fArr = new float[8];
|
|
for (int i = 0; i < 8; i++) {
|
|
fArr[i] = this.points[i] * x;
|
|
}
|
|
return new Cubic(fArr);
|
|
}
|
|
|
|
@NotNull
|
|
public String toString() {
|
|
return "anchor0: (" + getAnchor0X() + ", " + getAnchor0Y() + ") control0: (" + getControl0X() + ", " + getControl0Y() + "), control1: (" + getControl1X() + ", " + getControl1Y() + "), anchor1: (" + getAnchor1X() + ", " + getAnchor1Y() + ')';
|
|
}
|
|
|
|
@NotNull
|
|
public final Cubic transformed(@NotNull PointTransformer f) {
|
|
f.getClass();
|
|
MutableCubic mutableCubic = new MutableCubic();
|
|
ArraysKt___ArraysJvmKt.copyInto$default(this.points, mutableCubic.getPoints(), 0, 0, 0, 14, (Object) null);
|
|
mutableCubic.transform(f);
|
|
return mutableCubic;
|
|
}
|
|
|
|
public final boolean zeroLength$graphics_shapes_release() {
|
|
return Math.abs(getAnchor0X() - getAnchor1X()) < 1.0E-4f && Math.abs(getAnchor0Y() - getAnchor1Y()) < 1.0E-4f;
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0007\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J8\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\u00062\u0006\u0010\n\u001a\u00020\u00062\u0006\u0010\u000b\u001a\u00020\u0006H\u0007J(\u0010\f\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\u00062\u0006\u0010\n\u001a\u00020\u00062\u0006\u0010\u000b\u001a\u00020\u0006H\u0007¨\u0006\r"}, d2 = {"Landroidx/graphics/shapes/Cubic$Companion;", "", "()V", "circularArc", "Landroidx/graphics/shapes/Cubic;", "centerX", "", "centerY", "x0", "y0", "x1", "y1", "straightLine", "graphics-shapes_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public final Cubic circularArc(float centerX, float centerY, float x0, float y0, float x1, float y1) {
|
|
float f = x0 - centerX;
|
|
float f2 = y0 - centerY;
|
|
long directionVector = Utils.directionVector(f, f2);
|
|
float f3 = x1 - centerX;
|
|
float f4 = y1 - centerY;
|
|
long directionVector2 = Utils.directionVector(f3, f4);
|
|
long m7767rotate90DnnuFBc = Utils.m7767rotate90DnnuFBc(directionVector);
|
|
long m7767rotate90DnnuFBc2 = Utils.m7767rotate90DnnuFBc(directionVector2);
|
|
boolean z = PointKt.m7741dotProduct5P9i7ZU(m7767rotate90DnnuFBc, f3, f4) >= 0.0f;
|
|
float m7742dotProductybeJwSQ = PointKt.m7742dotProductybeJwSQ(directionVector, directionVector2);
|
|
if (m7742dotProductybeJwSQ > 0.999f) {
|
|
return straightLine(x0, y0, x1, y1);
|
|
}
|
|
float sqrt = (((((float) Math.sqrt(2 * r9)) - ((float) Math.sqrt(r5 - (m7742dotProductybeJwSQ * m7742dotProductybeJwSQ)))) * ((Utils.distance(f, f2) * 4.0f) / 3.0f)) / (1 - m7742dotProductybeJwSQ)) * (z ? 1.0f : -1.0f);
|
|
return CubicKt.Cubic(x0, y0, (PointKt.m7746getXDnnuFBc(m7767rotate90DnnuFBc) * sqrt) + x0, (PointKt.m7747getYDnnuFBc(m7767rotate90DnnuFBc) * sqrt) + y0, x1 - (PointKt.m7746getXDnnuFBc(m7767rotate90DnnuFBc2) * sqrt), y1 - (PointKt.m7747getYDnnuFBc(m7767rotate90DnnuFBc2) * sqrt), x1, y1);
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public final Cubic straightLine(float x0, float y0, float x1, float y1) {
|
|
return CubicKt.Cubic(x0, y0, Utils.interpolate(x0, x1, 0.33333334f), Utils.interpolate(y0, y1, 0.33333334f), Utils.interpolate(x0, x1, 0.6666667f), Utils.interpolate(y0, y1, 0.6666667f), x1, y1);
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
public final Cubic div(int x) {
|
|
return div(x);
|
|
}
|
|
|
|
@NotNull
|
|
public final Cubic times(int x) {
|
|
return times(x);
|
|
}
|
|
|
|
public /* synthetic */ Cubic(long j, long j2, long j3, long j4, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(j, j2, j3, j4);
|
|
}
|
|
|
|
public Cubic(@NotNull float[] fArr) {
|
|
fArr.getClass();
|
|
this.points = fArr;
|
|
if (fArr.length == 8) {
|
|
return;
|
|
}
|
|
Single$$ExternalSyntheticBUOutline0.m$3("Points array size should be 8");
|
|
throw null;
|
|
}
|
|
|
|
public /* synthetic */ Cubic(float[] fArr, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? new float[8] : fArr);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public Cubic() {
|
|
this(null, 1, 0 == true ? 1 : 0);
|
|
}
|
|
}
|