jimu-decompiled/sources/com/google/zxing/pdf417/decoder/BoundingBox.java
2025-05-13 19:24:51 +02:00

175 lines
5.4 KiB
Java

package com.google.zxing.pdf417.decoder;
import com.google.zxing.NotFoundException;
import com.google.zxing.ResultPoint;
import com.google.zxing.common.BitMatrix;
/* loaded from: classes.dex */
final class BoundingBox {
private final BitMatrix a;
private final ResultPoint b;
private final ResultPoint c;
private final ResultPoint d;
private final ResultPoint e;
private final int f;
private final int g;
private final int h;
private final int i;
BoundingBox(BitMatrix bitMatrix, ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3, ResultPoint resultPoint4) throws NotFoundException {
boolean z = resultPoint == null || resultPoint2 == null;
boolean z2 = resultPoint3 == null || resultPoint4 == null;
if (z && z2) {
throw NotFoundException.getNotFoundInstance();
}
if (z) {
resultPoint = new ResultPoint(0.0f, resultPoint3.b());
resultPoint2 = new ResultPoint(0.0f, resultPoint4.b());
} else if (z2) {
resultPoint3 = new ResultPoint(bitMatrix.k() - 1, resultPoint.b());
resultPoint4 = new ResultPoint(bitMatrix.k() - 1, resultPoint2.b());
}
this.a = bitMatrix;
this.b = resultPoint;
this.c = resultPoint2;
this.d = resultPoint3;
this.e = resultPoint4;
this.f = (int) Math.min(resultPoint.a(), resultPoint2.a());
this.g = (int) Math.max(resultPoint3.a(), resultPoint4.a());
this.h = (int) Math.min(resultPoint.b(), resultPoint3.b());
this.i = (int) Math.max(resultPoint2.b(), resultPoint4.b());
}
static BoundingBox a(BoundingBox boundingBox, BoundingBox boundingBox2) throws NotFoundException {
return boundingBox == null ? boundingBox2 : boundingBox2 == null ? boundingBox : new BoundingBox(boundingBox.a, boundingBox.b, boundingBox.c, boundingBox2.d, boundingBox2.e);
}
ResultPoint b() {
return this.e;
}
int c() {
return this.g;
}
int d() {
return this.i;
}
int e() {
return this.f;
}
int f() {
return this.h;
}
ResultPoint g() {
return this.b;
}
ResultPoint h() {
return this.d;
}
/* JADX WARN: Removed duplicated region for block: B:13:0x002d */
/* JADX WARN: Removed duplicated region for block: B:27:0x005b */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
com.google.zxing.pdf417.decoder.BoundingBox a(int r13, int r14, boolean r15) throws com.google.zxing.NotFoundException {
/*
r12 = this;
com.google.zxing.ResultPoint r0 = r12.b
com.google.zxing.ResultPoint r1 = r12.c
com.google.zxing.ResultPoint r2 = r12.d
com.google.zxing.ResultPoint r3 = r12.e
if (r13 <= 0) goto L29
if (r15 == 0) goto Le
r4 = r0
goto Lf
Le:
r4 = r2
Lf:
float r5 = r4.b()
int r5 = (int) r5
int r5 = r5 - r13
if (r5 >= 0) goto L18
r5 = 0
L18:
com.google.zxing.ResultPoint r13 = new com.google.zxing.ResultPoint
float r4 = r4.a()
float r5 = (float) r5
r13.<init>(r4, r5)
if (r15 == 0) goto L26
r8 = r13
goto L2a
L26:
r10 = r13
r8 = r0
goto L2b
L29:
r8 = r0
L2a:
r10 = r2
L2b:
if (r14 <= 0) goto L5b
if (r15 == 0) goto L32
com.google.zxing.ResultPoint r13 = r12.c
goto L34
L32:
com.google.zxing.ResultPoint r13 = r12.e
L34:
float r0 = r13.b()
int r0 = (int) r0
int r0 = r0 + r14
com.google.zxing.common.BitMatrix r14 = r12.a
int r14 = r14.i()
if (r0 < r14) goto L4a
com.google.zxing.common.BitMatrix r14 = r12.a
int r14 = r14.i()
int r0 = r14 + (-1)
L4a:
com.google.zxing.ResultPoint r14 = new com.google.zxing.ResultPoint
float r13 = r13.a()
float r0 = (float) r0
r14.<init>(r13, r0)
if (r15 == 0) goto L58
r9 = r14
goto L5c
L58:
r11 = r14
r9 = r1
goto L5d
L5b:
r9 = r1
L5c:
r11 = r3
L5d:
com.google.zxing.pdf417.decoder.BoundingBox r13 = new com.google.zxing.pdf417.decoder.BoundingBox
com.google.zxing.common.BitMatrix r7 = r12.a
r6 = r13
r6.<init>(r7, r8, r9, r10, r11)
return r13
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.BoundingBox.a(int, int, boolean):com.google.zxing.pdf417.decoder.BoundingBox");
}
ResultPoint a() {
return this.c;
}
BoundingBox(BoundingBox boundingBox) {
this.a = boundingBox.a;
this.b = boundingBox.g();
this.c = boundingBox.a();
this.d = boundingBox.h();
this.e = boundingBox.b();
this.f = boundingBox.e();
this.g = boundingBox.c();
this.h = boundingBox.f();
this.i = boundingBox.d();
}
}