Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.google.zxing.qrcode.detector;
|
||||
|
||||
import com.google.zxing.ResultPoint;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AlignmentPattern extends ResultPoint {
|
||||
private final float c;
|
||||
|
||||
AlignmentPattern(float f, float f2, float f3) {
|
||||
super(f, f2);
|
||||
this.c = f3;
|
||||
}
|
||||
|
||||
boolean a(float f, float f2, float f3) {
|
||||
if (Math.abs(f2 - b()) > f || Math.abs(f3 - a()) > f) {
|
||||
return false;
|
||||
}
|
||||
float abs = Math.abs(f - this.c);
|
||||
return abs <= 1.0f || abs <= this.c;
|
||||
}
|
||||
|
||||
AlignmentPattern b(float f, float f2, float f3) {
|
||||
return new AlignmentPattern((a() + f2) / 2.0f, (b() + f) / 2.0f, (this.c + f3) / 2.0f);
|
||||
}
|
||||
}
|
@@ -0,0 +1,268 @@
|
||||
package com.google.zxing.qrcode.detector;
|
||||
|
||||
import com.google.zxing.NotFoundException;
|
||||
import com.google.zxing.ResultPointCallback;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class AlignmentPatternFinder {
|
||||
private final BitMatrix a;
|
||||
private final int c;
|
||||
private final int d;
|
||||
private final int e;
|
||||
private final int f;
|
||||
private final float g;
|
||||
private final ResultPointCallback i;
|
||||
private final List<AlignmentPattern> b = new ArrayList(5);
|
||||
private final int[] h = new int[3];
|
||||
|
||||
AlignmentPatternFinder(BitMatrix bitMatrix, int i, int i2, int i3, int i4, float f, ResultPointCallback resultPointCallback) {
|
||||
this.a = bitMatrix;
|
||||
this.c = i;
|
||||
this.d = i2;
|
||||
this.e = i3;
|
||||
this.f = i4;
|
||||
this.g = f;
|
||||
this.i = resultPointCallback;
|
||||
}
|
||||
|
||||
AlignmentPattern a() throws NotFoundException {
|
||||
AlignmentPattern a;
|
||||
AlignmentPattern a2;
|
||||
int i = this.c;
|
||||
int i2 = this.f;
|
||||
int i3 = this.e + i;
|
||||
int i4 = this.d + (i2 / 2);
|
||||
int[] iArr = new int[3];
|
||||
for (int i5 = 0; i5 < i2; i5++) {
|
||||
int i6 = ((i5 & 1) == 0 ? (i5 + 1) / 2 : -((i5 + 1) / 2)) + i4;
|
||||
iArr[0] = 0;
|
||||
iArr[1] = 0;
|
||||
iArr[2] = 0;
|
||||
int i7 = i;
|
||||
while (i7 < i3 && !this.a.b(i7, i6)) {
|
||||
i7++;
|
||||
}
|
||||
int i8 = 0;
|
||||
while (i7 < i3) {
|
||||
if (!this.a.b(i7, i6)) {
|
||||
if (i8 == 1) {
|
||||
i8++;
|
||||
}
|
||||
iArr[i8] = iArr[i8] + 1;
|
||||
} else if (i8 == 1) {
|
||||
iArr[1] = iArr[1] + 1;
|
||||
} else if (i8 != 2) {
|
||||
i8++;
|
||||
iArr[i8] = iArr[i8] + 1;
|
||||
} else {
|
||||
if (a(iArr) && (a2 = a(iArr, i6, i7)) != null) {
|
||||
return a2;
|
||||
}
|
||||
iArr[0] = iArr[2];
|
||||
iArr[1] = 1;
|
||||
iArr[2] = 0;
|
||||
i8 = 1;
|
||||
}
|
||||
i7++;
|
||||
}
|
||||
if (a(iArr) && (a = a(iArr, i6, i3)) != null) {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
if (this.b.isEmpty()) {
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
return this.b.get(0);
|
||||
}
|
||||
|
||||
private static float a(int[] iArr, int i) {
|
||||
return (i - iArr[2]) - (iArr[1] / 2.0f);
|
||||
}
|
||||
|
||||
private boolean a(int[] iArr) {
|
||||
float f = this.g;
|
||||
float f2 = f / 2.0f;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (Math.abs(f - iArr[i]) >= f2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:34:0x0062, code lost:
|
||||
|
||||
if (r2[1] <= r12) goto L34;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:35:0x0065, code lost:
|
||||
|
||||
if (r10 >= r1) goto L60;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:37:0x006b, code lost:
|
||||
|
||||
if (r0.b(r11, r10) != false) goto L61;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:39:0x006f, code lost:
|
||||
|
||||
if (r2[2] > r12) goto L62;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:40:0x0071, code lost:
|
||||
|
||||
r2[2] = r2[2] + 1;
|
||||
r10 = r10 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:43:0x007b, code lost:
|
||||
|
||||
if (r2[2] <= r12) goto L43;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:44:0x007d, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:46:0x008f, code lost:
|
||||
|
||||
if ((java.lang.Math.abs(((r2[0] + r2[1]) + r2[2]) - r13) * 5) < (r13 * 2)) goto L46;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:47:0x0091, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:49:0x0096, code lost:
|
||||
|
||||
if (a(r2) == false) goto L50;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:51:0x009c, code lost:
|
||||
|
||||
return a(r2, r10);
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private float a(int r10, int r11, int r12, int r13) {
|
||||
/*
|
||||
r9 = this;
|
||||
com.google.zxing.common.BitMatrix r0 = r9.a
|
||||
int r1 = r0.i()
|
||||
int[] r2 = r9.h
|
||||
r3 = 0
|
||||
r2[r3] = r3
|
||||
r4 = 1
|
||||
r2[r4] = r3
|
||||
r5 = 2
|
||||
r2[r5] = r3
|
||||
r6 = r10
|
||||
L12:
|
||||
if (r6 < 0) goto L26
|
||||
boolean r7 = r0.b(r11, r6)
|
||||
if (r7 == 0) goto L26
|
||||
r7 = r2[r4]
|
||||
if (r7 > r12) goto L26
|
||||
r7 = r2[r4]
|
||||
int r7 = r7 + r4
|
||||
r2[r4] = r7
|
||||
int r6 = r6 + (-1)
|
||||
goto L12
|
||||
L26:
|
||||
r7 = 2143289344(0x7fc00000, float:NaN)
|
||||
if (r6 < 0) goto L9d
|
||||
r8 = r2[r4]
|
||||
if (r8 <= r12) goto L30
|
||||
goto L9d
|
||||
L30:
|
||||
if (r6 < 0) goto L44
|
||||
boolean r8 = r0.b(r11, r6)
|
||||
if (r8 != 0) goto L44
|
||||
r8 = r2[r3]
|
||||
if (r8 > r12) goto L44
|
||||
r8 = r2[r3]
|
||||
int r8 = r8 + r4
|
||||
r2[r3] = r8
|
||||
int r6 = r6 + (-1)
|
||||
goto L30
|
||||
L44:
|
||||
r6 = r2[r3]
|
||||
if (r6 <= r12) goto L49
|
||||
return r7
|
||||
L49:
|
||||
int r10 = r10 + r4
|
||||
L4a:
|
||||
if (r10 >= r1) goto L5e
|
||||
boolean r6 = r0.b(r11, r10)
|
||||
if (r6 == 0) goto L5e
|
||||
r6 = r2[r4]
|
||||
if (r6 > r12) goto L5e
|
||||
r6 = r2[r4]
|
||||
int r6 = r6 + r4
|
||||
r2[r4] = r6
|
||||
int r10 = r10 + 1
|
||||
goto L4a
|
||||
L5e:
|
||||
if (r10 == r1) goto L9d
|
||||
r6 = r2[r4]
|
||||
if (r6 <= r12) goto L65
|
||||
goto L9d
|
||||
L65:
|
||||
if (r10 >= r1) goto L79
|
||||
boolean r6 = r0.b(r11, r10)
|
||||
if (r6 != 0) goto L79
|
||||
r6 = r2[r5]
|
||||
if (r6 > r12) goto L79
|
||||
r6 = r2[r5]
|
||||
int r6 = r6 + r4
|
||||
r2[r5] = r6
|
||||
int r10 = r10 + 1
|
||||
goto L65
|
||||
L79:
|
||||
r11 = r2[r5]
|
||||
if (r11 <= r12) goto L7e
|
||||
return r7
|
||||
L7e:
|
||||
r11 = r2[r3]
|
||||
r12 = r2[r4]
|
||||
int r11 = r11 + r12
|
||||
r12 = r2[r5]
|
||||
int r11 = r11 + r12
|
||||
int r11 = r11 - r13
|
||||
int r11 = java.lang.Math.abs(r11)
|
||||
int r11 = r11 * 5
|
||||
int r13 = r13 * 2
|
||||
if (r11 < r13) goto L92
|
||||
return r7
|
||||
L92:
|
||||
boolean r11 = r9.a(r2)
|
||||
if (r11 == 0) goto L9d
|
||||
float r10 = a(r2, r10)
|
||||
return r10
|
||||
L9d:
|
||||
return r7
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.qrcode.detector.AlignmentPatternFinder.a(int, int, int, int):float");
|
||||
}
|
||||
|
||||
private AlignmentPattern a(int[] iArr, int i, int i2) {
|
||||
int i3 = iArr[0] + iArr[1] + iArr[2];
|
||||
float a = a(iArr, i2);
|
||||
float a2 = a(i, (int) a, iArr[1] * 2, i3);
|
||||
if (Float.isNaN(a2)) {
|
||||
return null;
|
||||
}
|
||||
float f = ((iArr[0] + iArr[1]) + iArr[2]) / 3.0f;
|
||||
for (AlignmentPattern alignmentPattern : this.b) {
|
||||
if (alignmentPattern.a(f, a2, a)) {
|
||||
return alignmentPattern.b(a2, a, f);
|
||||
}
|
||||
}
|
||||
AlignmentPattern alignmentPattern2 = new AlignmentPattern(a, a2, f);
|
||||
this.b.add(alignmentPattern2);
|
||||
ResultPointCallback resultPointCallback = this.i;
|
||||
if (resultPointCallback == null) {
|
||||
return null;
|
||||
}
|
||||
resultPointCallback.a(alignmentPattern2);
|
||||
return null;
|
||||
}
|
||||
}
|
226
sources/com/google/zxing/qrcode/detector/Detector.java
Normal file
226
sources/com/google/zxing/qrcode/detector/Detector.java
Normal file
@@ -0,0 +1,226 @@
|
||||
package com.google.zxing.qrcode.detector;
|
||||
|
||||
import com.google.zxing.DecodeHintType;
|
||||
import com.google.zxing.FormatException;
|
||||
import com.google.zxing.NotFoundException;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.ResultPointCallback;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.common.DetectorResult;
|
||||
import com.google.zxing.common.GridSampler;
|
||||
import com.google.zxing.common.PerspectiveTransform;
|
||||
import com.google.zxing.common.detector.MathUtils;
|
||||
import com.google.zxing.qrcode.decoder.Version;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Detector {
|
||||
private final BitMatrix a;
|
||||
private ResultPointCallback b;
|
||||
|
||||
public Detector(BitMatrix bitMatrix) {
|
||||
this.a = bitMatrix;
|
||||
}
|
||||
|
||||
private float b(int i, int i2, int i3, int i4) {
|
||||
int i5;
|
||||
float f;
|
||||
float f2;
|
||||
float a = a(i, i2, i3, i4);
|
||||
int i6 = i - (i3 - i);
|
||||
int i7 = 0;
|
||||
if (i6 < 0) {
|
||||
f = i / (i - i6);
|
||||
i5 = 0;
|
||||
} else if (i6 >= this.a.k()) {
|
||||
f = ((this.a.k() - 1) - i) / (i6 - i);
|
||||
i5 = this.a.k() - 1;
|
||||
} else {
|
||||
i5 = i6;
|
||||
f = 1.0f;
|
||||
}
|
||||
float f3 = i2;
|
||||
int i8 = (int) (f3 - ((i4 - i2) * f));
|
||||
if (i8 < 0) {
|
||||
f2 = f3 / (i2 - i8);
|
||||
} else if (i8 >= this.a.i()) {
|
||||
f2 = ((this.a.i() - 1) - i2) / (i8 - i2);
|
||||
i7 = this.a.i() - 1;
|
||||
} else {
|
||||
i7 = i8;
|
||||
f2 = 1.0f;
|
||||
}
|
||||
return (a + a(i, i2, (int) (i + ((i5 - i) * f2)), i7)) - 1.0f;
|
||||
}
|
||||
|
||||
public final DetectorResult a(Map<DecodeHintType, ?> map) throws NotFoundException, FormatException {
|
||||
this.b = map == null ? null : (ResultPointCallback) map.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
|
||||
return a(new FinderPatternFinder(this.a, this.b).a(map));
|
||||
}
|
||||
|
||||
protected final DetectorResult a(FinderPatternInfo finderPatternInfo) throws NotFoundException, FormatException {
|
||||
FinderPattern b = finderPatternInfo.b();
|
||||
FinderPattern c = finderPatternInfo.c();
|
||||
FinderPattern a = finderPatternInfo.a();
|
||||
float a2 = a(b, c, a);
|
||||
if (a2 >= 1.0f) {
|
||||
int a3 = a(b, c, a, a2);
|
||||
Version b2 = Version.b(a3);
|
||||
int c2 = b2.c() - 7;
|
||||
AlignmentPattern alignmentPattern = null;
|
||||
if (b2.b().length > 0) {
|
||||
float a4 = (c.a() - b.a()) + a.a();
|
||||
float b3 = (c.b() - b.b()) + a.b();
|
||||
float f = 1.0f - (3.0f / c2);
|
||||
int a5 = (int) (b.a() + ((a4 - b.a()) * f));
|
||||
int b4 = (int) (b.b() + (f * (b3 - b.b())));
|
||||
for (int i = 4; i <= 16; i <<= 1) {
|
||||
try {
|
||||
alignmentPattern = a(a2, a5, b4, i);
|
||||
break;
|
||||
} catch (NotFoundException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return new DetectorResult(a(this.a, a(b, c, a, alignmentPattern, a3), a3), alignmentPattern == null ? new ResultPoint[]{a, b, c} : new ResultPoint[]{a, b, c, alignmentPattern});
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
|
||||
private static PerspectiveTransform a(ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3, ResultPoint resultPoint4, int i) {
|
||||
float a;
|
||||
float b;
|
||||
float f;
|
||||
float f2 = i - 3.5f;
|
||||
if (resultPoint4 != null) {
|
||||
a = resultPoint4.a();
|
||||
b = resultPoint4.b();
|
||||
f = f2 - 3.0f;
|
||||
} else {
|
||||
a = (resultPoint2.a() - resultPoint.a()) + resultPoint3.a();
|
||||
b = (resultPoint2.b() - resultPoint.b()) + resultPoint3.b();
|
||||
f = f2;
|
||||
}
|
||||
return PerspectiveTransform.a(3.5f, 3.5f, f2, 3.5f, f, f, 3.5f, f2, resultPoint.a(), resultPoint.b(), resultPoint2.a(), resultPoint2.b(), a, b, resultPoint3.a(), resultPoint3.b());
|
||||
}
|
||||
|
||||
private static BitMatrix a(BitMatrix bitMatrix, PerspectiveTransform perspectiveTransform, int i) throws NotFoundException {
|
||||
return GridSampler.a().a(bitMatrix, i, i, perspectiveTransform);
|
||||
}
|
||||
|
||||
private static int a(ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3, float f) throws NotFoundException {
|
||||
int a = ((MathUtils.a(ResultPoint.a(resultPoint, resultPoint2) / f) + MathUtils.a(ResultPoint.a(resultPoint, resultPoint3) / f)) / 2) + 7;
|
||||
int i = a & 3;
|
||||
if (i == 0) {
|
||||
return a + 1;
|
||||
}
|
||||
if (i == 2) {
|
||||
return a - 1;
|
||||
}
|
||||
if (i != 3) {
|
||||
return a;
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
|
||||
protected final float a(ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3) {
|
||||
return (a(resultPoint, resultPoint2) + a(resultPoint, resultPoint3)) / 2.0f;
|
||||
}
|
||||
|
||||
private float a(ResultPoint resultPoint, ResultPoint resultPoint2) {
|
||||
float b = b((int) resultPoint.a(), (int) resultPoint.b(), (int) resultPoint2.a(), (int) resultPoint2.b());
|
||||
float b2 = b((int) resultPoint2.a(), (int) resultPoint2.b(), (int) resultPoint.a(), (int) resultPoint.b());
|
||||
return Float.isNaN(b) ? b2 / 7.0f : Float.isNaN(b2) ? b / 7.0f : (b + b2) / 14.0f;
|
||||
}
|
||||
|
||||
private float a(int i, int i2, int i3, int i4) {
|
||||
int i5;
|
||||
int i6;
|
||||
int i7;
|
||||
int i8;
|
||||
int i9;
|
||||
Detector detector;
|
||||
boolean z;
|
||||
boolean z2;
|
||||
int i10 = 1;
|
||||
boolean z3 = Math.abs(i4 - i2) > Math.abs(i3 - i);
|
||||
if (z3) {
|
||||
i6 = i;
|
||||
i5 = i2;
|
||||
i8 = i3;
|
||||
i7 = i4;
|
||||
} else {
|
||||
i5 = i;
|
||||
i6 = i2;
|
||||
i7 = i3;
|
||||
i8 = i4;
|
||||
}
|
||||
int abs = Math.abs(i7 - i5);
|
||||
int abs2 = Math.abs(i8 - i6);
|
||||
int i11 = (-abs) / 2;
|
||||
int i12 = i5 < i7 ? 1 : -1;
|
||||
int i13 = i6 < i8 ? 1 : -1;
|
||||
int i14 = i7 + i12;
|
||||
int i15 = i6;
|
||||
int i16 = i11;
|
||||
int i17 = 0;
|
||||
int i18 = i5;
|
||||
while (true) {
|
||||
if (i18 == i14) {
|
||||
i9 = i14;
|
||||
break;
|
||||
}
|
||||
int i19 = z3 ? i15 : i18;
|
||||
int i20 = z3 ? i18 : i15;
|
||||
if (i17 == i10) {
|
||||
detector = this;
|
||||
z = z3;
|
||||
i9 = i14;
|
||||
z2 = true;
|
||||
} else {
|
||||
detector = this;
|
||||
z = z3;
|
||||
i9 = i14;
|
||||
z2 = false;
|
||||
}
|
||||
if (z2 == detector.a.b(i19, i20)) {
|
||||
if (i17 == 2) {
|
||||
return MathUtils.a(i18, i15, i5, i6);
|
||||
}
|
||||
i17++;
|
||||
}
|
||||
i16 += abs2;
|
||||
if (i16 > 0) {
|
||||
if (i15 == i8) {
|
||||
break;
|
||||
}
|
||||
i15 += i13;
|
||||
i16 -= abs;
|
||||
}
|
||||
i18 += i12;
|
||||
i14 = i9;
|
||||
z3 = z;
|
||||
i10 = 1;
|
||||
}
|
||||
if (i17 == 2) {
|
||||
return MathUtils.a(i9, i8, i5, i6);
|
||||
}
|
||||
return Float.NaN;
|
||||
}
|
||||
|
||||
protected final AlignmentPattern a(float f, int i, int i2, float f2) throws NotFoundException {
|
||||
int i3 = (int) (f2 * f);
|
||||
int max = Math.max(0, i - i3);
|
||||
int min = Math.min(this.a.k() - 1, i + i3) - max;
|
||||
float f3 = 3.0f * f;
|
||||
if (min >= f3) {
|
||||
int max2 = Math.max(0, i2 - i3);
|
||||
int min2 = Math.min(this.a.i() - 1, i2 + i3) - max2;
|
||||
if (min2 >= f3) {
|
||||
return new AlignmentPatternFinder(this.a, max, max2, min, min2, f, this.b).a();
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
}
|
43
sources/com/google/zxing/qrcode/detector/FinderPattern.java
Normal file
43
sources/com/google/zxing/qrcode/detector/FinderPattern.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.google.zxing.qrcode.detector;
|
||||
|
||||
import com.google.zxing.ResultPoint;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class FinderPattern extends ResultPoint {
|
||||
private final float c;
|
||||
private final int d;
|
||||
|
||||
FinderPattern(float f, float f2, float f3) {
|
||||
this(f, f2, f3, 1);
|
||||
}
|
||||
|
||||
boolean a(float f, float f2, float f3) {
|
||||
if (Math.abs(f2 - b()) > f || Math.abs(f3 - a()) > f) {
|
||||
return false;
|
||||
}
|
||||
float abs = Math.abs(f - this.c);
|
||||
return abs <= 1.0f || abs <= this.c;
|
||||
}
|
||||
|
||||
FinderPattern b(float f, float f2, float f3) {
|
||||
int i = this.d;
|
||||
int i2 = i + 1;
|
||||
float a = (i * a()) + f2;
|
||||
float f4 = i2;
|
||||
return new FinderPattern(a / f4, ((this.d * b()) + f) / f4, ((this.d * this.c) + f3) / f4, i2);
|
||||
}
|
||||
|
||||
int c() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public float d() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
private FinderPattern(float f, float f2, float f3, int i) {
|
||||
super(f, f2);
|
||||
this.c = f3;
|
||||
this.d = i;
|
||||
}
|
||||
}
|
@@ -0,0 +1,629 @@
|
||||
package com.google.zxing.qrcode.detector;
|
||||
|
||||
import com.google.zxing.DecodeHintType;
|
||||
import com.google.zxing.NotFoundException;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.ResultPointCallback;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FinderPatternFinder {
|
||||
private final BitMatrix a;
|
||||
private boolean c;
|
||||
private final ResultPointCallback e;
|
||||
private final List<FinderPattern> b = new ArrayList();
|
||||
private final int[] d = new int[5];
|
||||
|
||||
private static final class CenterComparator implements Serializable, Comparator<FinderPattern> {
|
||||
private final float a;
|
||||
|
||||
@Override // java.util.Comparator
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public int compare(FinderPattern finderPattern, FinderPattern finderPattern2) {
|
||||
int compare = Integer.compare(finderPattern2.c(), finderPattern.c());
|
||||
return compare == 0 ? Float.compare(Math.abs(finderPattern.d() - this.a), Math.abs(finderPattern2.d() - this.a)) : compare;
|
||||
}
|
||||
|
||||
private CenterComparator(float f) {
|
||||
this.a = f;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class FurthestFromAverageComparator implements Serializable, Comparator<FinderPattern> {
|
||||
private final float a;
|
||||
|
||||
@Override // java.util.Comparator
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public int compare(FinderPattern finderPattern, FinderPattern finderPattern2) {
|
||||
return Float.compare(Math.abs(finderPattern2.d() - this.a), Math.abs(finderPattern.d() - this.a));
|
||||
}
|
||||
|
||||
private FurthestFromAverageComparator(float f) {
|
||||
this.a = f;
|
||||
}
|
||||
}
|
||||
|
||||
public FinderPatternFinder(BitMatrix bitMatrix, ResultPointCallback resultPointCallback) {
|
||||
this.a = bitMatrix;
|
||||
this.e = resultPointCallback;
|
||||
}
|
||||
|
||||
private int[] b() {
|
||||
a(this.d);
|
||||
return this.d;
|
||||
}
|
||||
|
||||
protected static boolean c(int[] iArr) {
|
||||
int i = 0;
|
||||
for (int i2 = 0; i2 < 5; i2++) {
|
||||
int i3 = iArr[i2];
|
||||
if (i3 == 0) {
|
||||
return false;
|
||||
}
|
||||
i += i3;
|
||||
}
|
||||
if (i < 7) {
|
||||
return false;
|
||||
}
|
||||
float f = i / 7.0f;
|
||||
float f2 = f / 2.0f;
|
||||
return Math.abs(f - ((float) iArr[0])) < f2 && Math.abs(f - ((float) iArr[1])) < f2 && Math.abs((f * 3.0f) - ((float) iArr[2])) < 3.0f * f2 && Math.abs(f - ((float) iArr[3])) < f2 && Math.abs(f - ((float) iArr[4])) < f2;
|
||||
}
|
||||
|
||||
protected static boolean d(int[] iArr) {
|
||||
int i = 0;
|
||||
for (int i2 = 0; i2 < 5; i2++) {
|
||||
int i3 = iArr[i2];
|
||||
if (i3 == 0) {
|
||||
return false;
|
||||
}
|
||||
i += i3;
|
||||
}
|
||||
if (i < 7) {
|
||||
return false;
|
||||
}
|
||||
float f = i / 7.0f;
|
||||
float f2 = f / 1.333f;
|
||||
return Math.abs(f - ((float) iArr[0])) < f2 && Math.abs(f - ((float) iArr[1])) < f2 && Math.abs((f * 3.0f) - ((float) iArr[2])) < 3.0f * f2 && Math.abs(f - ((float) iArr[3])) < f2 && Math.abs(f - ((float) iArr[4])) < f2;
|
||||
}
|
||||
|
||||
final FinderPatternInfo a(Map<DecodeHintType, ?> map) throws NotFoundException {
|
||||
boolean z = map != null && map.containsKey(DecodeHintType.TRY_HARDER);
|
||||
int i = this.a.i();
|
||||
int k = this.a.k();
|
||||
int i2 = (i * 3) / 388;
|
||||
if (i2 < 3 || z) {
|
||||
i2 = 3;
|
||||
}
|
||||
int[] iArr = new int[5];
|
||||
int i3 = i2 - 1;
|
||||
int i4 = i2;
|
||||
boolean z2 = false;
|
||||
while (i3 < i && !z2) {
|
||||
a(iArr);
|
||||
boolean z3 = z2;
|
||||
int i5 = i4;
|
||||
int i6 = 0;
|
||||
int i7 = 0;
|
||||
while (i6 < k) {
|
||||
if (this.a.b(i6, i3)) {
|
||||
if ((i7 & 1) == 1) {
|
||||
i7++;
|
||||
}
|
||||
iArr[i7] = iArr[i7] + 1;
|
||||
} else if ((i7 & 1) != 0) {
|
||||
iArr[i7] = iArr[i7] + 1;
|
||||
} else if (i7 == 4) {
|
||||
if (!c(iArr)) {
|
||||
b(iArr);
|
||||
} else if (a(iArr, i3, i6)) {
|
||||
if (this.c) {
|
||||
z3 = c();
|
||||
} else {
|
||||
int a = a();
|
||||
if (a > iArr[2]) {
|
||||
i3 += (a - iArr[2]) - 2;
|
||||
i6 = k - 1;
|
||||
}
|
||||
}
|
||||
a(iArr);
|
||||
i7 = 0;
|
||||
i5 = 2;
|
||||
} else {
|
||||
b(iArr);
|
||||
}
|
||||
i7 = 3;
|
||||
} else {
|
||||
i7++;
|
||||
iArr[i7] = iArr[i7] + 1;
|
||||
}
|
||||
i6++;
|
||||
}
|
||||
if (c(iArr) && a(iArr, i3, k)) {
|
||||
int i8 = iArr[0];
|
||||
if (this.c) {
|
||||
i4 = i8;
|
||||
z2 = c();
|
||||
i3 += i4;
|
||||
} else {
|
||||
i4 = i8;
|
||||
}
|
||||
} else {
|
||||
i4 = i5;
|
||||
}
|
||||
z2 = z3;
|
||||
i3 += i4;
|
||||
}
|
||||
FinderPattern[] d = d();
|
||||
ResultPoint.a(d);
|
||||
return new FinderPatternInfo(d);
|
||||
}
|
||||
|
||||
protected final void b(int[] iArr) {
|
||||
iArr[0] = iArr[2];
|
||||
iArr[1] = iArr[3];
|
||||
iArr[2] = iArr[4];
|
||||
iArr[3] = 1;
|
||||
iArr[4] = 0;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:21:0x003a, code lost:
|
||||
|
||||
if (r2[1] <= r13) goto L21;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:23:0x003f, code lost:
|
||||
|
||||
if (r3 < 0) goto L74;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:25:0x0045, code lost:
|
||||
|
||||
if (r0.b(r12, r3) == false) goto L72;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:27:0x0049, code lost:
|
||||
|
||||
if (r2[0] > r13) goto L73;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:28:0x004b, code lost:
|
||||
|
||||
r2[0] = r2[0] + 1;
|
||||
r3 = r3 - 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:31:0x0055, code lost:
|
||||
|
||||
if (r2[0] <= r13) goto L31;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:32:0x0057, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:33:0x0058, code lost:
|
||||
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:34:0x0059, code lost:
|
||||
|
||||
if (r11 >= r1) goto L75;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:36:0x005f, code lost:
|
||||
|
||||
if (r0.b(r12, r11) == false) goto L76;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:37:0x0061, code lost:
|
||||
|
||||
r2[2] = r2[2] + 1;
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:39:0x0069, code lost:
|
||||
|
||||
if (r11 != r1) goto L38;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:40:0x006b, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:42:0x006d, code lost:
|
||||
|
||||
if (r11 >= r1) goto L79;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:44:0x0073, code lost:
|
||||
|
||||
if (r0.b(r12, r11) != false) goto L77;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:46:0x0077, code lost:
|
||||
|
||||
if (r2[3] >= r13) goto L78;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:47:0x0079, code lost:
|
||||
|
||||
r2[3] = r2[3] + 1;
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:49:0x0081, code lost:
|
||||
|
||||
if (r11 == r1) goto L66;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:51:0x0085, code lost:
|
||||
|
||||
if (r2[3] < r13) goto L49;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:53:0x0089, code lost:
|
||||
|
||||
if (r11 >= r1) goto L81;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:55:0x008f, code lost:
|
||||
|
||||
if (r0.b(r12, r11) == false) goto L82;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:57:0x0093, code lost:
|
||||
|
||||
if (r2[4] >= r13) goto L80;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:58:0x0095, code lost:
|
||||
|
||||
r2[4] = r2[4] + 1;
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:61:0x009f, code lost:
|
||||
|
||||
if (r2[4] < r13) goto L59;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:62:0x00a1, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:64:0x00b9, code lost:
|
||||
|
||||
if ((java.lang.Math.abs(((((r2[0] + r2[1]) + r2[2]) + r2[3]) + r2[4]) - r14) * 5) < (r14 * 2)) goto L62;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:65:0x00bb, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:67:0x00c0, code lost:
|
||||
|
||||
if (c(r2) == false) goto L66;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:69:0x00c6, code lost:
|
||||
|
||||
return a(r2, r11);
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private float b(int r11, int r12, int r13, int r14) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 200
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.qrcode.detector.FinderPatternFinder.b(int, int, int, int):float");
|
||||
}
|
||||
|
||||
private boolean c() {
|
||||
int size = this.b.size();
|
||||
float f = 0.0f;
|
||||
int i = 0;
|
||||
float f2 = 0.0f;
|
||||
for (FinderPattern finderPattern : this.b) {
|
||||
if (finderPattern.c() >= 2) {
|
||||
i++;
|
||||
f2 += finderPattern.d();
|
||||
}
|
||||
}
|
||||
if (i < 3) {
|
||||
return false;
|
||||
}
|
||||
float f3 = f2 / size;
|
||||
Iterator<FinderPattern> it = this.b.iterator();
|
||||
while (it.hasNext()) {
|
||||
f += Math.abs(it.next().d() - f3);
|
||||
}
|
||||
return f <= f2 * 0.05f;
|
||||
}
|
||||
|
||||
private FinderPattern[] d() throws NotFoundException {
|
||||
int size = this.b.size();
|
||||
if (size >= 3) {
|
||||
float f = 0.0f;
|
||||
if (size > 3) {
|
||||
Iterator<FinderPattern> it = this.b.iterator();
|
||||
float f2 = 0.0f;
|
||||
float f3 = 0.0f;
|
||||
while (it.hasNext()) {
|
||||
float d = it.next().d();
|
||||
f2 += d;
|
||||
f3 += d * d;
|
||||
}
|
||||
float f4 = f2 / size;
|
||||
float sqrt = (float) Math.sqrt((f3 / r0) - (f4 * f4));
|
||||
Collections.sort(this.b, new FurthestFromAverageComparator(f4));
|
||||
float max = Math.max(0.2f * f4, sqrt);
|
||||
int i = 0;
|
||||
while (i < this.b.size() && this.b.size() > 3) {
|
||||
if (Math.abs(this.b.get(i).d() - f4) > max) {
|
||||
this.b.remove(i);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (this.b.size() > 3) {
|
||||
Iterator<FinderPattern> it2 = this.b.iterator();
|
||||
while (it2.hasNext()) {
|
||||
f += it2.next().d();
|
||||
}
|
||||
Collections.sort(this.b, new CenterComparator(f / this.b.size()));
|
||||
List<FinderPattern> list = this.b;
|
||||
list.subList(3, list.size()).clear();
|
||||
}
|
||||
return new FinderPattern[]{this.b.get(0), this.b.get(1), this.b.get(2)};
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
|
||||
private static float a(int[] iArr, int i) {
|
||||
return ((i - iArr[4]) - iArr[3]) - (iArr[2] / 2.0f);
|
||||
}
|
||||
|
||||
protected final void a(int[] iArr) {
|
||||
for (int i = 0; i < iArr.length; i++) {
|
||||
iArr[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean a(int i, int i2) {
|
||||
int i3;
|
||||
int i4;
|
||||
int i5;
|
||||
int[] b = b();
|
||||
int i6 = 0;
|
||||
while (i >= i6 && i2 >= i6 && this.a.b(i2 - i6, i - i6)) {
|
||||
b[2] = b[2] + 1;
|
||||
i6++;
|
||||
}
|
||||
if (b[2] == 0) {
|
||||
return false;
|
||||
}
|
||||
while (i >= i6 && i2 >= i6 && !this.a.b(i2 - i6, i - i6)) {
|
||||
b[1] = b[1] + 1;
|
||||
i6++;
|
||||
}
|
||||
if (b[1] == 0) {
|
||||
return false;
|
||||
}
|
||||
while (i >= i6 && i2 >= i6 && this.a.b(i2 - i6, i - i6)) {
|
||||
b[0] = b[0] + 1;
|
||||
i6++;
|
||||
}
|
||||
if (b[0] == 0) {
|
||||
return false;
|
||||
}
|
||||
int i7 = this.a.i();
|
||||
int k = this.a.k();
|
||||
int i8 = 1;
|
||||
while (true) {
|
||||
int i9 = i + i8;
|
||||
if (i9 >= i7 || (i5 = i2 + i8) >= k || !this.a.b(i5, i9)) {
|
||||
break;
|
||||
}
|
||||
b[2] = b[2] + 1;
|
||||
i8++;
|
||||
}
|
||||
while (true) {
|
||||
int i10 = i + i8;
|
||||
if (i10 >= i7 || (i4 = i2 + i8) >= k || this.a.b(i4, i10)) {
|
||||
break;
|
||||
}
|
||||
b[3] = b[3] + 1;
|
||||
i8++;
|
||||
}
|
||||
if (b[3] == 0) {
|
||||
return false;
|
||||
}
|
||||
while (true) {
|
||||
int i11 = i + i8;
|
||||
if (i11 >= i7 || (i3 = i2 + i8) >= k || !this.a.b(i3, i11)) {
|
||||
break;
|
||||
}
|
||||
b[4] = b[4] + 1;
|
||||
i8++;
|
||||
}
|
||||
if (b[4] == 0) {
|
||||
return false;
|
||||
}
|
||||
return d(b);
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:21:0x003a, code lost:
|
||||
|
||||
if (r2[1] <= r13) goto L21;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:23:0x003f, code lost:
|
||||
|
||||
if (r3 < 0) goto L74;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:25:0x0045, code lost:
|
||||
|
||||
if (r0.b(r3, r12) == false) goto L72;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:27:0x0049, code lost:
|
||||
|
||||
if (r2[0] > r13) goto L73;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:28:0x004b, code lost:
|
||||
|
||||
r2[0] = r2[0] + 1;
|
||||
r3 = r3 - 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:31:0x0055, code lost:
|
||||
|
||||
if (r2[0] <= r13) goto L31;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:32:0x0057, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:33:0x0058, code lost:
|
||||
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:34:0x0059, code lost:
|
||||
|
||||
if (r11 >= r1) goto L75;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:36:0x005f, code lost:
|
||||
|
||||
if (r0.b(r11, r12) == false) goto L76;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:37:0x0061, code lost:
|
||||
|
||||
r2[2] = r2[2] + 1;
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:39:0x0069, code lost:
|
||||
|
||||
if (r11 != r1) goto L38;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:40:0x006b, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:42:0x006d, code lost:
|
||||
|
||||
if (r11 >= r1) goto L79;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:44:0x0073, code lost:
|
||||
|
||||
if (r0.b(r11, r12) != false) goto L77;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:46:0x0077, code lost:
|
||||
|
||||
if (r2[3] >= r13) goto L78;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:47:0x0079, code lost:
|
||||
|
||||
r2[3] = r2[3] + 1;
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:49:0x0081, code lost:
|
||||
|
||||
if (r11 == r1) goto L66;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:51:0x0085, code lost:
|
||||
|
||||
if (r2[3] < r13) goto L49;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:53:0x0089, code lost:
|
||||
|
||||
if (r11 >= r1) goto L81;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:55:0x008f, code lost:
|
||||
|
||||
if (r0.b(r11, r12) == false) goto L82;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:57:0x0093, code lost:
|
||||
|
||||
if (r2[4] >= r13) goto L80;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:58:0x0095, code lost:
|
||||
|
||||
r2[4] = r2[4] + 1;
|
||||
r11 = r11 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:61:0x009f, code lost:
|
||||
|
||||
if (r2[4] < r13) goto L59;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:62:0x00a1, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:64:0x00b7, code lost:
|
||||
|
||||
if ((java.lang.Math.abs(((((r2[0] + r2[1]) + r2[2]) + r2[3]) + r2[4]) - r14) * 5) < r14) goto L62;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:65:0x00b9, code lost:
|
||||
|
||||
return Float.NaN;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:67:0x00be, code lost:
|
||||
|
||||
if (c(r2) == false) goto L66;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:69:0x00c4, code lost:
|
||||
|
||||
return a(r2, r11);
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private float a(int r11, int r12, int r13, int r14) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 198
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.qrcode.detector.FinderPatternFinder.a(int, int, int, int):float");
|
||||
}
|
||||
|
||||
protected final boolean a(int[] iArr, int i, int i2) {
|
||||
boolean z = false;
|
||||
int i3 = iArr[0] + iArr[1] + iArr[2] + iArr[3] + iArr[4];
|
||||
int a = (int) a(iArr, i2);
|
||||
float b = b(i, a, iArr[2], i3);
|
||||
if (!Float.isNaN(b)) {
|
||||
int i4 = (int) b;
|
||||
float a2 = a(a, i4, iArr[2], i3);
|
||||
if (!Float.isNaN(a2) && a(i4, (int) a2)) {
|
||||
float f = i3 / 7.0f;
|
||||
int i5 = 0;
|
||||
while (true) {
|
||||
if (i5 >= this.b.size()) {
|
||||
break;
|
||||
}
|
||||
FinderPattern finderPattern = this.b.get(i5);
|
||||
if (finderPattern.a(f, b, a2)) {
|
||||
this.b.set(i5, finderPattern.b(b, a2, f));
|
||||
z = true;
|
||||
break;
|
||||
}
|
||||
i5++;
|
||||
}
|
||||
if (!z) {
|
||||
FinderPattern finderPattern2 = new FinderPattern(a2, b, f);
|
||||
this.b.add(finderPattern2);
|
||||
ResultPointCallback resultPointCallback = this.e;
|
||||
if (resultPointCallback != null) {
|
||||
resultPointCallback.a(finderPattern2);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private int a() {
|
||||
if (this.b.size() <= 1) {
|
||||
return 0;
|
||||
}
|
||||
FinderPattern finderPattern = null;
|
||||
for (FinderPattern finderPattern2 : this.b) {
|
||||
if (finderPattern2.c() >= 2) {
|
||||
if (finderPattern != null) {
|
||||
this.c = true;
|
||||
return ((int) (Math.abs(finderPattern.a() - finderPattern2.a()) - Math.abs(finderPattern.b() - finderPattern2.b()))) / 2;
|
||||
}
|
||||
finderPattern = finderPattern2;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package com.google.zxing.qrcode.detector;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class FinderPatternInfo {
|
||||
private final FinderPattern a;
|
||||
private final FinderPattern b;
|
||||
private final FinderPattern c;
|
||||
|
||||
public FinderPatternInfo(FinderPattern[] finderPatternArr) {
|
||||
this.a = finderPatternArr[0];
|
||||
this.b = finderPatternArr[1];
|
||||
this.c = finderPatternArr[2];
|
||||
}
|
||||
|
||||
public FinderPattern a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public FinderPattern b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public FinderPattern c() {
|
||||
return this.c;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user