discord-jadx/app/src/main/java/c/c/a/a0/o.java

100 lines
2.8 KiB
Java

package c.c.a.a0;
import android.graphics.Color;
import android.graphics.PointF;
import androidx.annotation.ColorInt;
import c.c.a.a0.h0.c;
import c.d.b.a.a;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/* compiled from: JsonUtils */
public class o {
public static final c.a a = c.a.a("x", "y");
@ColorInt
public static int a(c cVar) throws IOException {
cVar.a();
int p = (int) (cVar.p() * 255.0d);
int p2 = (int) (cVar.p() * 255.0d);
int p3 = (int) (cVar.p() * 255.0d);
while (cVar.e()) {
cVar.C();
}
cVar.c();
return Color.argb(255, p, p2, p3);
}
public static PointF b(c cVar, float f) throws IOException {
int ordinal = cVar.w().ordinal();
if (ordinal == 0) {
cVar.a();
float p = (float) cVar.p();
float p2 = (float) cVar.p();
while (cVar.w() != c.b.END_ARRAY) {
cVar.C();
}
cVar.c();
return new PointF(p * f, p2 * f);
} else if (ordinal == 2) {
cVar.b();
float f2 = 0.0f;
float f3 = 0.0f;
while (cVar.e()) {
int z2 = cVar.z(a);
if (z2 == 0) {
f2 = d(cVar);
} else if (z2 != 1) {
cVar.B();
cVar.C();
} else {
f3 = d(cVar);
}
}
cVar.d();
return new PointF(f2 * f, f3 * f);
} else if (ordinal == 6) {
float p3 = (float) cVar.p();
float p4 = (float) cVar.p();
while (cVar.e()) {
cVar.C();
}
return new PointF(p3 * f, p4 * f);
} else {
StringBuilder K = a.K("Unknown point starts with ");
K.append(cVar.w());
throw new IllegalArgumentException(K.toString());
}
}
public static List<PointF> c(c cVar, float f) throws IOException {
ArrayList arrayList = new ArrayList();
cVar.a();
while (cVar.w() == c.b.BEGIN_ARRAY) {
cVar.a();
arrayList.add(b(cVar, f));
cVar.c();
}
cVar.c();
return arrayList;
}
public static float d(c cVar) throws IOException {
c.b w = cVar.w();
int ordinal = w.ordinal();
if (ordinal == 0) {
cVar.a();
float p = (float) cVar.p();
while (cVar.e()) {
cVar.C();
}
cVar.c();
return p;
} else if (ordinal == 6) {
return (float) cVar.p();
} else {
throw new IllegalArgumentException("Unknown value for token of type " + w);
}
}
}