Rabbit-R1/switch port/java/sources/com/google/zxing/BinaryBitmap.java
2024-05-21 17:08:36 -04:00

64 lines
1.9 KiB
Java

package com.google.zxing;
import com.google.zxing.common.BitArray;
import com.google.zxing.common.BitMatrix;
/* loaded from: classes3.dex */
public final class BinaryBitmap {
private final Binarizer binarizer;
private BitMatrix matrix;
public BinaryBitmap(Binarizer binarizer) {
if (binarizer == null) {
throw new IllegalArgumentException("Binarizer must be non-null.");
}
this.binarizer = binarizer;
}
public int getWidth() {
return this.binarizer.getWidth();
}
public int getHeight() {
return this.binarizer.getHeight();
}
public BitArray getBlackRow(int i, BitArray bitArray) throws NotFoundException {
return this.binarizer.getBlackRow(i, bitArray);
}
public BitMatrix getBlackMatrix() throws NotFoundException {
if (this.matrix == null) {
this.matrix = this.binarizer.getBlackMatrix();
}
return this.matrix;
}
public boolean isCropSupported() {
return this.binarizer.getLuminanceSource().isCropSupported();
}
public BinaryBitmap crop(int i, int i2, int i3, int i4) {
return new BinaryBitmap(this.binarizer.createBinarizer(this.binarizer.getLuminanceSource().crop(i, i2, i3, i4)));
}
public boolean isRotateSupported() {
return this.binarizer.getLuminanceSource().isRotateSupported();
}
public BinaryBitmap rotateCounterClockwise() {
return new BinaryBitmap(this.binarizer.createBinarizer(this.binarizer.getLuminanceSource().rotateCounterClockwise()));
}
public BinaryBitmap rotateCounterClockwise45() {
return new BinaryBitmap(this.binarizer.createBinarizer(this.binarizer.getLuminanceSource().rotateCounterClockwise45()));
}
public String toString() {
try {
return getBlackMatrix().toString();
} catch (NotFoundException unused) {
return "";
}
}
}