what-the-bank/sources/org/beyka/tiffbitmapfactory/TiffConverter.java

123 lines
6.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.beyka.tiffbitmapfactory;
import java.io.File;
import org.beyka.tiffbitmapfactory.exceptions.CantOpenFileException;
import org.beyka.tiffbitmapfactory.exceptions.DecodeTiffException;
import org.beyka.tiffbitmapfactory.exceptions.NotEnoughtMemoryException;
/* loaded from: classes6.dex */
public class TiffConverter {
public static native boolean convertBmpTiff(String str, String str2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertBmpTiffFd(int i, int i2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertJpgTiff(String str, String str2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertJpgTiffFd(int i, int i2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertPngTiff(String str, String str2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertPngTiffFd(int i, int i2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertTiffBmp(String str, String str2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertTiffBmpFd(int i, int i2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertTiffJpg(String str, String str2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertTiffJpgFd(int i, int i2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertTiffPng(String str, String str2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native boolean convertTiffPngFd(int i, int i2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException;
public static native ImageFormat getImageType(String str);
public static native ImageFormat getImageTypeFd(int i);
static {
System.loadLibrary("rbae");
System.loadLibrary("x231e2");
}
public static boolean convertToTiff(File file, File file2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException {
return convertToTiff(file.getAbsolutePath(), file2.getAbsolutePath(), converterOptions, iProgressListener);
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: org.beyka.tiffbitmapfactory.TiffConverter$1, reason: invalid class name */
/* loaded from: classes6.dex */
public static /* synthetic */ class AnonymousClass1 {
static final int[] $SwitchMap$org$beyka$tiffbitmapfactory$ImageFormat;
static {
int[] iArr = new int[ImageFormat.values().length];
$SwitchMap$org$beyka$tiffbitmapfactory$ImageFormat = iArr;
try {
iArr[ImageFormat.JPEG.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$org$beyka$tiffbitmapfactory$ImageFormat[ImageFormat.PNG.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$org$beyka$tiffbitmapfactory$ImageFormat[ImageFormat.BMP.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$org$beyka$tiffbitmapfactory$ImageFormat[ImageFormat.TIFF.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
public static boolean convertToTiff(String str, String str2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException {
int i = AnonymousClass1.$SwitchMap$org$beyka$tiffbitmapfactory$ImageFormat[getImageType(str).ordinal()];
if (i == 1) {
return convertJpgTiff(str, str2, converterOptions, iProgressListener);
}
if (i == 2) {
return convertPngTiff(str, str2, converterOptions, iProgressListener);
}
if (i != 3) {
return false;
}
return convertBmpTiff(str, str2, converterOptions, iProgressListener);
}
public static boolean convertToTiff(int i, int i2, ConverterOptions converterOptions, IProgressListener iProgressListener) throws CantOpenFileException, DecodeTiffException, NotEnoughtMemoryException {
int i3 = AnonymousClass1.$SwitchMap$org$beyka$tiffbitmapfactory$ImageFormat[getImageTypeFd(i).ordinal()];
if (i3 == 1) {
return convertJpgTiffFd(i, i2, converterOptions, iProgressListener);
}
if (i3 == 2) {
return convertPngTiffFd(i, i2, converterOptions, iProgressListener);
}
if (i3 != 3) {
return false;
}
return convertBmpTiffFd(i, i2, converterOptions, iProgressListener);
}
/* loaded from: classes6.dex */
public static final class ConverterOptions {
public String imageDescription;
public DecodeArea inTiffDecodeArea;
public int readTiffDirectory;
public String software;
public float xResolution;
public float yResolution;
public long availableMemory = 256000000;
public boolean appendTiff = false;
public ResolutionUnit resUnit = ResolutionUnit.NONE;
public CompressionScheme compressionScheme = CompressionScheme.NONE;
public boolean throwExceptions = false;
private volatile boolean isStoped = false;
public final void stop() {
this.isStoped = true;
}
}
}