81 lines
3.5 KiB
Java
81 lines
3.5 KiB
Java
|
package com.kofax.mobile.sdk.l;
|
||
|
|
||
|
import android.util.Pair;
|
||
|
import com.kofax.kmc.ken.engines.DocumentDetector;
|
||
|
import com.kofax.kmc.ken.engines.data.DetectionResult;
|
||
|
import com.kofax.kmc.ken.engines.data.DocumentDetectionResult;
|
||
|
import com.kofax.kmc.ken.engines.data.DocumentDetectionSettings;
|
||
|
import com.kofax.kmc.kui.uicontrols.PreviewFrameEvent;
|
||
|
import com.kofax.mobile.sdk.k.o;
|
||
|
import o.InterfaceC13391fZD;
|
||
|
|
||
|
/* loaded from: classes3.dex */
|
||
|
public class f extends c<DocumentDetector, DocumentDetectionSettings> {
|
||
|
@Override // com.kofax.mobile.sdk.l.c, com.kofax.mobile.sdk._internal.capture.c
|
||
|
public /* bridge */ /* synthetic */ void a(com.kofax.mobile.sdk._internal.capture.a aVar) {
|
||
|
super.a(aVar);
|
||
|
}
|
||
|
|
||
|
@InterfaceC13391fZD
|
||
|
public f(DocumentDetector documentDetector) {
|
||
|
super(documentDetector, new DocumentDetectionSettings());
|
||
|
}
|
||
|
|
||
|
@Override // com.kofax.mobile.sdk._internal.capture.c
|
||
|
public com.kofax.mobile.sdk._internal.capture.d a(PreviewFrameEvent previewFrameEvent) {
|
||
|
try {
|
||
|
Pair<DetectionResult, Integer> c = c(previewFrameEvent);
|
||
|
return m.a((DetectionResult) c.first, previewFrameEvent, ((Integer) c.second).intValue());
|
||
|
} catch (IllegalArgumentException e) {
|
||
|
com.kofax.mobile.sdk._internal.k.e("Detection failed", new RuntimeException(e));
|
||
|
return m.e(previewFrameEvent);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private Pair<DetectionResult, Integer> c(PreviewFrameEvent previewFrameEvent) {
|
||
|
try {
|
||
|
return d(previewFrameEvent);
|
||
|
} catch (IllegalArgumentException e) {
|
||
|
com.kofax.mobile.sdk._internal.k.e("Detection failed", new RuntimeException(e));
|
||
|
return new Pair<>(null, Integer.valueOf(previewFrameEvent.getRotation()));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
private Pair<DetectionResult, Integer> d(PreviewFrameEvent previewFrameEvent) {
|
||
|
DocumentDetectionResult detect;
|
||
|
int rotation;
|
||
|
if (lG()) {
|
||
|
detect = ((DocumentDetector) this.GV).detect((DocumentDetectionSettings) this.GW, previewFrameEvent.getBitmapLandscape());
|
||
|
rotation = previewFrameEvent.getRotation() - previewFrameEvent.getRotationLandscape();
|
||
|
} else {
|
||
|
detect = ((DocumentDetector) this.GV).detect((DocumentDetectionSettings) this.GW, previewFrameEvent.getData(), previewFrameEvent.getWidth(), previewFrameEvent.getHeight());
|
||
|
rotation = previewFrameEvent.getRotation();
|
||
|
}
|
||
|
return new Pair<>(detect, Integer.valueOf(rotation));
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
private boolean lG() {
|
||
|
return DocumentDetectionSettings.DocumentEdgeDetection.ISG.equals(((DocumentDetectionSettings) this.GW).getEdgeDetection());
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
@Override // com.kofax.mobile.sdk._internal.capture.c
|
||
|
public void doCleanUp() {
|
||
|
((DocumentDetector) this.GV).destroy();
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
@Override // com.kofax.mobile.sdk._internal.capture.c
|
||
|
public double getMaxFillFraction() {
|
||
|
return ((DocumentDetectionSettings) this.GW).getMaxFillFraction();
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
@Override // com.kofax.mobile.sdk._internal.capture.c
|
||
|
public o bt() {
|
||
|
return new o(((DocumentDetectionSettings) this.GW).getTargetFrameAspectRatio(), ((DocumentDetectionSettings) this.GW).getTargetFramePaddingPercent(), ((DocumentDetectionSettings) this.GW).getCenterPoint());
|
||
|
}
|
||
|
}
|