80 lines
3.0 KiB
Java
80 lines
3.0 KiB
Java
|
package com.kofax.kmc.ken.engines;
|
||
|
|
||
|
import android.graphics.Point;
|
||
|
import android.graphics.Rect;
|
||
|
import com.kofax.kmc.ken.engines.data.DocumentDetectionResult;
|
||
|
import com.kofax.kmc.ken.engines.data.DocumentDetectionSettings;
|
||
|
import com.kofax.kmc.ken.engines.data.HorizontalGuidance;
|
||
|
import com.kofax.kmc.ken.engines.data.OrientationGuidance;
|
||
|
import com.kofax.kmc.ken.engines.data.TurnGuidance;
|
||
|
import com.kofax.kmc.ken.engines.data.VerticalGuidance;
|
||
|
import com.kofax.kmc.ken.engines.data.ZoomGuidance;
|
||
|
import com.kofax.mobile.sdk._internal.impl.detection.Frame;
|
||
|
import java.util.List;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes3.dex */
|
||
|
public class c extends DocumentDetectionResult {
|
||
|
private ZoomGuidance L;
|
||
|
private final DocumentDetectionSettings R;
|
||
|
private final g S;
|
||
|
private final IBoundingRectCalculator T;
|
||
|
private final OrientationGuidance U;
|
||
|
private final int _height;
|
||
|
private final int _width;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public c(Rect rect, List<Point> list, Frame frame, INativeGuidance iNativeGuidance, DocumentDetectionSettings documentDetectionSettings, IBoundingRectCalculator iBoundingRectCalculator, IOrientationGuidanceCalculator iOrientationGuidanceCalculator) {
|
||
|
super(rect, list, frame);
|
||
|
this.R = documentDetectionSettings;
|
||
|
this.S = new b(iNativeGuidance, documentDetectionSettings, rect);
|
||
|
this.T = iBoundingRectCalculator;
|
||
|
this.U = iOrientationGuidanceCalculator.calculate(rect, this.bounds);
|
||
|
this._width = frame.getWidth();
|
||
|
this._height = frame.getHeight();
|
||
|
}
|
||
|
|
||
|
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
|
||
|
public ZoomGuidance getZoomGuidance() {
|
||
|
if (this.L == null) {
|
||
|
a(this._width, this._height);
|
||
|
}
|
||
|
return this.L;
|
||
|
}
|
||
|
|
||
|
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
|
||
|
public TurnGuidance getTurnGuidance() {
|
||
|
return this.S.getTurnGuidance();
|
||
|
}
|
||
|
|
||
|
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
|
||
|
public HorizontalGuidance getHorizontalMovementGuidance() {
|
||
|
return this.S.getHorizontalMovementGuidance();
|
||
|
}
|
||
|
|
||
|
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
|
||
|
public VerticalGuidance getVerticalMovementGuidance() {
|
||
|
return this.S.getVerticalMovementGuidance();
|
||
|
}
|
||
|
|
||
|
private void a(int i, int i2) {
|
||
|
Rect calculate = this.T.calculate(getBounds());
|
||
|
double width = calculate.width() / getTargetRect().width();
|
||
|
double height = calculate.height() / getTargetRect().height();
|
||
|
if (i <= i2) {
|
||
|
width = height;
|
||
|
height = width;
|
||
|
}
|
||
|
if (width < this.R.getLongEdgeThreshold() && height < this.R.getShortEdgeThreshold()) {
|
||
|
this.L = ZoomGuidance.ZOOM_IN;
|
||
|
} else {
|
||
|
this.L = this.S.getZoomGuidance();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
|
||
|
public OrientationGuidance getOrientationGuidance() {
|
||
|
return this.U;
|
||
|
}
|
||
|
}
|