package com.kofax.kmc.ken.engines.gpu; import com.kofax.kmc.ken.engines.gpu.ImageProcessor; /* loaded from: classes3.dex */ class a extends e { protected final int[] fA; private ImageProcessor.Method fw = ImageProcessor.Method.GPU_RgbSobel; protected final boolean[] fx = new boolean[ImageProcessor.Method.GPU_End.ordinal()]; protected final int[] fy = new int[ImageProcessor.Method.GPU_End.ordinal()]; protected final int[] fz; public a() { int[] iArr = new int[ImageProcessor.Method.GPU_End.ordinal()]; this.fz = iArr; int[] iArr2 = new int[ImageProcessor.Method.GPU_End.ordinal()]; this.fA = iArr2; iArr[ImageProcessor.Method.GPU_RgbSobel.ordinal()] = 2; iArr[ImageProcessor.Method.GPU_LocalAdaptiveThreshold.ordinal()] = 2; iArr[ImageProcessor.Method.GPU_GlobalAdaptiveThreshold.ordinal()] = 1; iArr[ImageProcessor.Method.GPU_Barnsen.ordinal()] = 1; iArr2[ImageProcessor.Method.GPU_RgbSobel.ordinal()] = 10; iArr2[ImageProcessor.Method.GPU_LocalAdaptiveThreshold.ordinal()] = 10; iArr2[ImageProcessor.Method.GPU_GlobalAdaptiveThreshold.ordinal()] = 6; iArr2[ImageProcessor.Method.GPU_Barnsen.ordinal()] = 4; for (int ordinal = ImageProcessor.Method.GPU_RgbSobel.ordinal(); ordinal < ImageProcessor.Method.GPU_End.ordinal(); ordinal++) { this.fy[ordinal] = this.fz[ordinal]; } } @Override // com.kofax.kmc.ken.engines.gpu.ImageProcessor public void processTexture(FrameBufferTexture frameBufferTexture, FrameBufferTexture frameBufferTexture2) { J(); this.gF = null; if (K()) { int i = AnonymousClass1.fB[this.fw.ordinal()]; if (i == 1) { a(frameBufferTexture2); } else if (i == 2) { b(frameBufferTexture); } else if (i == 3) { c(frameBufferTexture); } else if (i == 4) { d(frameBufferTexture); } b(getBounds() != null); } } /* renamed from: com.kofax.kmc.ken.engines.gpu.a$1, reason: invalid class name */ /* loaded from: classes3.dex */ static /* synthetic */ class AnonymousClass1 { static final int[] fB; static { int[] iArr = new int[ImageProcessor.Method.values().length]; fB = iArr; try { iArr[ImageProcessor.Method.GPU_RgbSobel.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { fB[ImageProcessor.Method.GPU_GlobalAdaptiveThreshold.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { fB[ImageProcessor.Method.GPU_LocalAdaptiveThreshold.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { fB[ImageProcessor.Method.GPU_Barnsen.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } } } @Override // com.kofax.kmc.ken.engines.gpu.ImageProcessor public boolean isRGBInputTextureRequired() { J(); K(); return this.fw == ImageProcessor.Method.GPU_RgbSobel; } @Override // com.kofax.kmc.ken.engines.gpu.ImageProcessor public boolean isGrayScaleInputTextureRequired() { J(); K(); return this.fw != ImageProcessor.Method.GPU_RgbSobel; } protected void J() { this.fx[ImageProcessor.Method.GPU_RgbSobel.ordinal()] = GPUSettings.getSettings().enableRgbSobel; this.fx[ImageProcessor.Method.GPU_GlobalAdaptiveThreshold.ordinal()] = GPUSettings.getSettings().enableGlobalAdaptiveThreshold; this.fx[ImageProcessor.Method.GPU_LocalAdaptiveThreshold.ordinal()] = GPUSettings.getSettings().enableLocalAdaptiveThreshold; this.fx[ImageProcessor.Method.GPU_Barnsen.ordinal()] = GPUSettings.getSettings().enableBarnsen; } protected boolean K() { for (int ordinal = ImageProcessor.Method.GPU_RgbSobel.ordinal(); !this.fx[this.fw.ordinal()] && ordinal < ImageProcessor.Method.GPU_End.ordinal(); ordinal++) { int ordinal2 = this.fw.ordinal() + 1; if (ordinal2 >= ImageProcessor.Method.GPU_End.ordinal()) { ordinal2 = ImageProcessor.Method.GPU_RgbSobel.ordinal(); } this.fw = ImageProcessor.Method.values()[ordinal2]; } return this.fx[this.fw.ordinal()]; } protected void b(boolean z) { int i = this.fy[this.fw.ordinal()]; if (z) { int i2 = i + 1; if (i2 <= this.fA[this.fw.ordinal()]) { this.fy[this.fw.ordinal()] = i2; return; } return; } int i3 = i - 1; if (i3 <= 0) { this.fy[this.fw.ordinal()] = this.fz[this.fw.ordinal()]; int ordinal = this.fw.ordinal() + 1; if (ordinal >= ImageProcessor.Method.GPU_End.ordinal()) { ordinal = ImageProcessor.Method.GPU_RgbSobel.ordinal(); } this.fw = ImageProcessor.Method.values()[ordinal]; return; } this.fy[this.fw.ordinal()] = i3; } }