Rabbit-R1/android (non root)/java/sources/com/google/zxing/pdf417/decoder/BoundingBox.java
2024-05-21 17:08:36 -04:00

186 lines
6.7 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: classes3.dex */
final class BoundingBox {
private final ResultPoint bottomLeft;
private final ResultPoint bottomRight;
private final BitMatrix image;
private final int maxX;
private final int maxY;
private final int minX;
private final int minY;
private final ResultPoint topLeft;
private final ResultPoint topRight;
/* JADX INFO: Access modifiers changed from: package-private */
public ResultPoint getBottomLeft() {
return this.bottomLeft;
}
/* JADX INFO: Access modifiers changed from: package-private */
public ResultPoint getBottomRight() {
return this.bottomRight;
}
/* JADX INFO: Access modifiers changed from: package-private */
public int getMaxX() {
return this.maxX;
}
/* JADX INFO: Access modifiers changed from: package-private */
public int getMaxY() {
return this.maxY;
}
/* JADX INFO: Access modifiers changed from: package-private */
public int getMinX() {
return this.minX;
}
/* JADX INFO: Access modifiers changed from: package-private */
public int getMinY() {
return this.minY;
}
/* JADX INFO: Access modifiers changed from: package-private */
public ResultPoint getTopLeft() {
return this.topLeft;
}
/* JADX INFO: Access modifiers changed from: package-private */
public ResultPoint getTopRight() {
return this.topRight;
}
/* JADX INFO: Access modifiers changed from: package-private */
public 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.getY());
resultPoint2 = new ResultPoint(0.0f, resultPoint4.getY());
} else if (z2) {
resultPoint3 = new ResultPoint(bitMatrix.getWidth() - 1, resultPoint.getY());
resultPoint4 = new ResultPoint(bitMatrix.getWidth() - 1, resultPoint2.getY());
}
this.image = bitMatrix;
this.topLeft = resultPoint;
this.bottomLeft = resultPoint2;
this.topRight = resultPoint3;
this.bottomRight = resultPoint4;
this.minX = (int) Math.min(resultPoint.getX(), resultPoint2.getX());
this.maxX = (int) Math.max(resultPoint3.getX(), resultPoint4.getX());
this.minY = (int) Math.min(resultPoint.getY(), resultPoint3.getY());
this.maxY = (int) Math.max(resultPoint2.getY(), resultPoint4.getY());
}
/* JADX INFO: Access modifiers changed from: package-private */
public BoundingBox(BoundingBox boundingBox) {
this.image = boundingBox.image;
this.topLeft = boundingBox.topLeft;
this.bottomLeft = boundingBox.bottomLeft;
this.topRight = boundingBox.topRight;
this.bottomRight = boundingBox.bottomRight;
this.minX = boundingBox.minX;
this.maxX = boundingBox.maxX;
this.minY = boundingBox.minY;
this.maxY = boundingBox.maxY;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static BoundingBox merge(BoundingBox boundingBox, BoundingBox boundingBox2) throws NotFoundException {
return boundingBox == null ? boundingBox2 : boundingBox2 == null ? boundingBox : new BoundingBox(boundingBox.image, boundingBox.topLeft, boundingBox.bottomLeft, boundingBox2.topRight, boundingBox2.bottomRight);
}
/* JADX INFO: Access modifiers changed from: package-private */
/* 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 add '--show-bad-code' argument
*/
public com.google.zxing.pdf417.decoder.BoundingBox addMissingRows(int r13, int r14, boolean r15) throws com.google.zxing.NotFoundException {
/*
r12 = this;
com.google.zxing.ResultPoint r0 = r12.topLeft
com.google.zxing.ResultPoint r1 = r12.bottomLeft
com.google.zxing.ResultPoint r2 = r12.topRight
com.google.zxing.ResultPoint r3 = r12.bottomRight
if (r13 <= 0) goto L29
if (r15 == 0) goto Le
r4 = r0
goto Lf
Le:
r4 = r2
Lf:
float r5 = r4.getY()
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.getX()
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.bottomLeft
goto L34
L32:
com.google.zxing.ResultPoint r13 = r12.bottomRight
L34:
float r0 = r13.getY()
int r0 = (int) r0
int r0 = r0 + r14
com.google.zxing.common.BitMatrix r14 = r12.image
int r14 = r14.getHeight()
if (r0 < r14) goto L4a
com.google.zxing.common.BitMatrix r14 = r12.image
int r14 = r14.getHeight()
int r0 = r14 + (-1)
L4a:
com.google.zxing.ResultPoint r14 = new com.google.zxing.ResultPoint
float r13 = r13.getX()
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.image
r6 = r13
r6.<init>(r7, r8, r9, r10, r11)
return r13
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.BoundingBox.addMissingRows(int, int, boolean):com.google.zxing.pdf417.decoder.BoundingBox");
}
}