apflib.java 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package com.epson.p007sd.common.apf;
  2. import android.media.ExifInterface;
  3. import java.io.IOException;
  4. import java.util.Arrays;
  5. /* renamed from: com.epson.sd.common.apf.apflib */
  6. public class apflib {
  7. public static final int EPS_APF_INCREMENT_OF_CORRECTION_VALUE = 10;
  8. public static final int EPS_APF_SHRPNESS_OPTIMUN_VALUE = 30;
  9. private static final int EPS_CM_COLOR = 0;
  10. private native int autoCorrectFile(String str, int i, String str2, String str3, boolean z, boolean z2, boolean z3);
  11. private native int autoCorrectFileWithValue(String str, int i, String str2, String str3, boolean z, boolean z2, int i2, int i3, int i4);
  12. private native void setInterruptionFlg();
  13. static {
  14. System.loadLibrary("apf");
  15. }
  16. public boolean apfFile(String str, int i, String str2, String str3) {
  17. if (isEmpty(str2) || isEmpty(str3) || i > 8) {
  18. return false;
  19. }
  20. if (autoCorrectFile(str, i < 0 ? exifOrientation(str) : i, str2, str3, true, false, false) == 0) {
  21. return true;
  22. }
  23. return false;
  24. }
  25. public boolean apfFile(String str, int i, String str2, String str3, boolean z, boolean z2, boolean z3) {
  26. int i2 = i;
  27. if (isEmpty(str2) || isEmpty(str3) || i2 > 8 || (!z && !z2)) {
  28. return false;
  29. }
  30. if (autoCorrectFile(str, i2 < 0 ? exifOrientation(str) : i2, str2, str3, z, z2, z3) == 0) {
  31. return true;
  32. }
  33. return false;
  34. }
  35. public boolean apfFile(String str, int i, String str2, String str3, boolean z, boolean z2, int i2, int i3, int i4) {
  36. int i5 = i;
  37. int i6 = i2;
  38. if (isEmpty(str2) || isEmpty(str3) || i5 > 8 || ((!z && !z2) || (z2 && (i6 > 127 || i6 < -128)))) {
  39. return false;
  40. }
  41. if (autoCorrectFileWithValue(str, i5 < 0 ? exifOrientation(str) : i5, str2, str3, z, z2, i2, i3, i4) == 0) {
  42. return true;
  43. }
  44. return false;
  45. }
  46. public int exifOrientation(String str) {
  47. try {
  48. return new ExifInterface(str).getAttributeInt(android.support.media.ExifInterface.TAG_ORIENTATION, 0);
  49. } catch (IOException unused) {
  50. return 0;
  51. }
  52. }
  53. public void interrupt() {
  54. setInterruptionFlg();
  55. }
  56. public boolean isDspEpsonColorLogo(String str, int i, int i2, boolean z) {
  57. if (z && i2 == 0 && Arrays.asList(EpsonColorLogoList.getMediatypeidlist()).contains(Integer.valueOf(i)) && Arrays.asList(EpsonColorLogoList.getDeviceIDList()).contains(str)) {
  58. return true;
  59. }
  60. return false;
  61. }
  62. private static boolean isEmpty(String str) {
  63. return str == null || str.length() == 0;
  64. }
  65. }