package com.kofax.kmc.ken.engines.gpu; import com.google.android.gms.maps.model.BitmapDescriptorFactory; /* loaded from: classes3.dex */ public class TextureRotationUtil { public static final float[] TEXTURE_NO_ROTATION = {BitmapDescriptorFactory.HUE_RED, 1.0f, 1.0f, 1.0f, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 1.0f, BitmapDescriptorFactory.HUE_RED}; public static final float[] TEXTURE_ROTATED_90 = {1.0f, 1.0f, 1.0f, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 1.0f, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED}; public static final float[] TEXTURE_ROTATED_180 = {1.0f, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 1.0f, 1.0f, BitmapDescriptorFactory.HUE_RED, 1.0f}; public static final float[] TEXTURE_ROTATED_270 = {BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 1.0f, 1.0f, BitmapDescriptorFactory.HUE_RED, 1.0f, 1.0f}; private static float c(float f) { if (f == BitmapDescriptorFactory.HUE_RED) { return 1.0f; } return BitmapDescriptorFactory.HUE_RED; } private TextureRotationUtil() { } /* renamed from: com.kofax.kmc.ken.engines.gpu.TextureRotationUtil$1, reason: invalid class name */ /* loaded from: classes3.dex */ static /* synthetic */ class AnonymousClass1 { static final int[] hs; static { int[] iArr = new int[Rotation.values().length]; hs = iArr; try { iArr[Rotation.ROTATION_90.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { hs[Rotation.ROTATION_180.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { hs[Rotation.ROTATION_270.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { hs[Rotation.NORMAL.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } } } public static float[] getRotation(Rotation rotation, boolean z, boolean z2) { int i = AnonymousClass1.hs[rotation.ordinal()]; float[] fArr = i != 1 ? i != 2 ? i != 3 ? TEXTURE_NO_ROTATION : TEXTURE_ROTATED_270 : TEXTURE_ROTATED_180 : TEXTURE_ROTATED_90; if (z) { fArr = new float[]{c(fArr[0]), fArr[1], c(fArr[2]), fArr[3], c(fArr[4]), fArr[5], c(fArr[6]), fArr[7]}; } return z2 ? new float[]{fArr[0], c(fArr[1]), fArr[2], c(fArr[3]), fArr[4], c(fArr[5]), fArr[6], c(fArr[7])} : fArr; } }