package com.kofax.kmc.ken.engines; import android.graphics.Bitmap; import com.kofax.android.abc.machine_vision.CaptureGuidance; import com.kofax.android.abc.machine_vision.TrackedDocument; import com.kofax.kmc.ken.engines.data.DocumentDetectionResult; import com.kofax.kmc.ken.engines.data.DocumentDetectionSettings; import com.kofax.kmc.kut.utilities.RectUtil; import com.kofax.mobile.sdk._internal.impl.detection.Frame; import o.InterfaceC13390fZB; import o.InterfaceC13391fZD; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public class i implements IDocumentDetector { private final IBoundingRectCalculator T; private final IOrientationGuidanceCalculator ae; private final com.kofax.mobile.sdk.o.c bI; /* JADX INFO: Access modifiers changed from: package-private */ @InterfaceC13391fZD public i(@InterfaceC13390fZB(a = "DOCUMENT") com.kofax.mobile.sdk.o.c cVar) { a aVar = new a(); this.T = aVar; this.ae = new l(aVar); this.bI = cVar; } @Override // com.kofax.kmc.ken.engines.IDocumentDetector public DocumentDetectionResult detect(DocumentDetectionSettings documentDetectionSettings, Bitmap bitmap) { return a(documentDetectionSettings, new com.kofax.mobile.sdk.o.d(bitmap)); } @Override // com.kofax.kmc.ken.engines.IDocumentDetector public DocumentDetectionResult detect(DocumentDetectionSettings documentDetectionSettings, byte[] bArr, int i, int i2) { return a(documentDetectionSettings, new com.kofax.mobile.sdk.o.e(bArr, 17, i, i2)); } @Override // com.kofax.kmc.ken.engines.IDocumentDetector public void destroy() { this.bI.destroy(); } private DocumentDetectionResult a(DocumentDetectionSettings documentDetectionSettings, com.kofax.mobile.sdk.o.f fVar) { TrackedDocument a = this.bI.a(fVar); if (a == null) { return null; } return a(documentDetectionSettings, fVar, a); } private c a(DocumentDetectionSettings documentDetectionSettings, Frame frame, TrackedDocument trackedDocument) { return new c(RectUtil.createTargetRect(documentDetectionSettings.getTargetFramePaddingPercent(), documentDetectionSettings.getTargetFrameAspectRatio(), documentDetectionSettings.getCenterPoint(), frame.getWidth(), frame.getHeight()), trackedDocument.Boundary().Corners(), frame, new k(new CaptureGuidance(trackedDocument, CaptureGuidance.GuidanceSource.BEST_RECTANGLE)), documentDetectionSettings, this.T, this.ae); } }