what-the-bank/sources/com/google/android/gms/internal/vision/zzp.java

44 lines
1.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.internal.vision;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import com.google.android.gms.dynamite.DynamiteModule;
import org.bouncycastle.crypto.tls.CipherSuite;
/* loaded from: classes2.dex */
public final class zzp {
public static Bitmap zzb(Bitmap bitmap, zzn zznVar) {
int i;
int width = bitmap.getWidth();
int height = bitmap.getHeight();
if (zznVar.rotation != 0) {
Matrix matrix = new Matrix();
int i2 = zznVar.rotation;
if (i2 == 0) {
i = 0;
} else if (i2 == 1) {
i = 90;
} else if (i2 == 2) {
i = CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA256;
} else {
if (i2 != 3) {
throw new IllegalArgumentException("Unsupported rotation degree.");
}
i = 270;
}
matrix.postRotate(i);
bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, false);
}
if (zznVar.rotation == 1 || zznVar.rotation == 3) {
zznVar.width = height;
zznVar.height = width;
}
return bitmap;
}
public static boolean zza(Context context, String str) {
return DynamiteModule.getLocalVersion(context, str) > DynamiteModule.getRemoteVersion(context, "com.google.android.gms.vision.dynamite");
}
}