SDIC_PWC.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. package epson.colorcorrection;
  2. import android.util.Log;
  3. import com.epson.cameracopy.device.RectangleDetector;
  4. import com.google.common.primitives.UnsignedBytes;
  5. import org.opencv.core.CvException;
  6. import org.opencv.core.Mat;
  7. import org.opencv.core.Rect;
  8. import org.opencv.core.Scalar;
  9. import org.opencv.imgproc.Imgproc;
  10. public class SDIC_PWC extends SDIC_Exception implements SDIC_CommonDefine {
  11. static {
  12. System.loadLibrary("opencv_java3");
  13. }
  14. public static int PaperWhiteCorrection(Mat mat, SDIC_MAT_PTR sdic_mat_ptr) {
  15. return RectangleDetector.paperWhiteCorrection(mat.getNativeObjAddr(), sdic_mat_ptr.getMat().getNativeObjAddr());
  16. }
  17. public static int PaperWhiteCorrection2(Mat mat, SDIC_MAT_PTR sdic_mat_ptr) {
  18. return RectangleDetector.paperWhiteCorrection(mat.getNativeObjAddr(), sdic_mat_ptr.getMat().getNativeObjAddr(), RectangleDetector.getDefaultPaperWhiteCorrection());
  19. }
  20. public static int PaperWhiteCorrectionJAVA(Mat mat, SDIC_MAT_PTR sdic_mat_ptr) {
  21. int cols = mat.cols();
  22. int rows = mat.rows();
  23. int channels = mat.channels();
  24. Mat mat2 = new Mat(rows, cols, mat.type());
  25. Runtime runtime = Runtime.getRuntime();
  26. runtime.maxMemory();
  27. float f = ((float) runtime.totalMemory()) / 1048576.0f;
  28. float freeMemory = f - (f - (((float) runtime.freeMemory()) / 1048576.0f));
  29. float f2 = 2.0f;
  30. float f3 = (freeMemory / 2.0f) / 3.0f;
  31. if (f3 > 2.0f) {
  32. f2 = f3;
  33. }
  34. int i = ((f2 * 1048576.0f) / ((float) (cols * channels)));
  35. if (i >= mat.rows()) {
  36. i = mat.rows();
  37. }
  38. Rect rect = new Rect(0, 0, cols, i);
  39. int ceil = Math.ceil(( rows) / ( i));
  40. LogMemory(String.format("PWC S - [%d] w:%d h:%d c:%d m:%.2fMB use:%.2fMB", new Object[]{Integer.valueOf(ceil), Integer.valueOf(cols), Integer.valueOf(rows), Integer.valueOf(channels), Float.valueOf(((float) ((cols * rows) * channels)) / 1048576.0f), Float.valueOf(f2)}));
  41. int i2 = 0;
  42. int i3 = 0;
  43. while (true) {
  44. if (rows <= 0) {
  45. break;
  46. }
  47. rect.height = rows < i ? rows : i;
  48. Mat submat = mat.submat(rect);
  49. Mat submat2 = mat2.submat(rect);
  50. int PaperWhiteCorrection_ROI = PaperWhiteCorrection_ROI(submat, submat2);
  51. submat.release();
  52. submat2.release();
  53. i2++;
  54. LogMemory(String.format("PWC R - [%d/%d] %d", new Object[]{Integer.valueOf(i2), Integer.valueOf(ceil), Integer.valueOf(rect.height)}));
  55. if (PaperWhiteCorrection_ROI != 0) {
  56. i3 = PaperWhiteCorrection_ROI;
  57. break;
  58. }
  59. rows -= i;
  60. rect.f438y += i;
  61. i3 = PaperWhiteCorrection_ROI;
  62. }
  63. if (i3 == 0) {
  64. sdic_mat_ptr.setMat(mat2);
  65. }
  66. LogMemory(String.format("PWC E use:%.2fMB", new Object[]{Float.valueOf(f2)}));
  67. return i3;
  68. }
  69. public static int PaperWhiteCorrection_ROI(Mat mat, Mat mat2) {
  70. int i;
  71. try {
  72. if (mat.empty()) {
  73. throw new SDIC_Exception(-2);
  74. } else if (mat.dataAddr() == mat2.dataAddr()) {
  75. throw new SDIC_Exception(-1);
  76. } else if (mat.isContinuous()) {
  77. SDIC_MAT_PTR sdic_mat_ptr = new SDIC_MAT_PTR();
  78. SDIC_MAT_PTR sdic_mat_ptr2 = new SDIC_MAT_PTR();
  79. SDIC_MAT_PTR sdic_mat_ptr3 = new SDIC_MAT_PTR();
  80. int MakeCleaningFilter = MakeCleaningFilter(mat, sdic_mat_ptr2, 0.05d, 80.0d);
  81. if (MakeCleaningFilter == 0) {
  82. int Sharpness = Sharpness(mat, sdic_mat_ptr3, 2.0f);
  83. if (Sharpness == 0) {
  84. int ColorDodge = ColorDodge(sdic_mat_ptr3.getMat(), sdic_mat_ptr2.getMat(), sdic_mat_ptr);
  85. if (ColorDodge == 0) {
  86. sdic_mat_ptr2.releaseMat();
  87. sdic_mat_ptr3.releaseMat();
  88. SDIC_MAT_PTR sdic_mat_ptr4 = new SDIC_MAT_PTR();
  89. SDIC_MAT_PTR sdic_mat_ptr5 = new SDIC_MAT_PTR();
  90. int MakeCleaningFilter2 = MakeCleaningFilter(mat, sdic_mat_ptr5, 1.0d, 80.0d);
  91. if (MakeCleaningFilter2 == 0) {
  92. int ColorDodge2 = ColorDodge(mat, sdic_mat_ptr5.getMat(), sdic_mat_ptr4);
  93. if (ColorDodge2 == 0) {
  94. sdic_mat_ptr5.releaseMat();
  95. Multiply(sdic_mat_ptr4.getMat(), sdic_mat_ptr.getMat(), mat2);
  96. sdic_mat_ptr4.releaseMat();
  97. sdic_mat_ptr.releaseMat();
  98. i = 0;
  99. if (!(i == 0 || mat2.empty() || i == -1)) {
  100. mat2.release();
  101. }
  102. return i;
  103. }
  104. throw new SDIC_Exception(ColorDodge2);
  105. }
  106. throw new SDIC_Exception(MakeCleaningFilter2);
  107. }
  108. throw new SDIC_Exception(ColorDodge);
  109. }
  110. throw new SDIC_Exception(Sharpness);
  111. }
  112. throw new SDIC_Exception(MakeCleaningFilter);
  113. } else {
  114. throw new SDIC_Exception(-3);
  115. }
  116. } catch (SDIC_Exception e) {
  117. i = e.mCode;
  118. } catch (CvException unused) {
  119. i = -100;
  120. } catch (Exception unused2) {
  121. i = SDIC_CommonDefine.SDIC_ERR_UNKNOWN;
  122. }
  123. }
  124. private static int Sharpness(Mat mat, SDIC_MAT_PTR sdic_mat_ptr, float f) {
  125. Mat mat2 = sdic_mat_ptr.getMat();
  126. Mat mat3 = new Mat(3, 3, 5);
  127. mat3.setTo(Scalar.all( ((-1.0f * f) / 9.0f)));
  128. float f2 = ((f * 8.0f) / 9.0f) + 1.0f;
  129. int channels = mat3.channels();
  130. float[] fArr = new float[channels];
  131. int i = 0;
  132. for (int i2 = 0; i2 < channels; i2++) {
  133. fArr[i2] = f2;
  134. }
  135. mat3.put(1, 1, fArr);
  136. Imgproc.filter2D(mat, mat2, mat.depth(), mat3);
  137. mat3.release();
  138. if (mat2.empty()) {
  139. i = -100;
  140. }
  141. sdic_mat_ptr.setMat(mat2);
  142. return i;
  143. }
  144. private static int Multiply(Mat mat, Mat mat2, Mat mat3) {
  145. int channels = mat.channels();
  146. int i = (mat.total() * ((long) channels));
  147. byte[] GetPixcelData = SDIC_BCSC.GetPixcelData(mat);
  148. byte[] GetPixcelData2 = SDIC_BCSC.GetPixcelData(mat2);
  149. byte[] GetPixcelData3 = SDIC_BCSC.GetPixcelData(mat);
  150. for (int i2 = 0; i2 < i; i2 += channels) {
  151. for (int i3 = 0; i3 < 3; i3++) {
  152. int i4 = i2 + i3;
  153. double d = ( ((GetPixcelData[i4] & UnsignedBytes.MAX_VALUE) * (GetPixcelData2[i4] & UnsignedBytes.MAX_VALUE))) * 0.00392156862745098d;
  154. if (d > 255.0d) {
  155. d = 255.0d;
  156. }
  157. if (d < 0.0d) {
  158. d = 0.0d;
  159. }
  160. GetPixcelData3[i4] = (byte) ( d);
  161. }
  162. }
  163. mat3.put(0, 0, GetPixcelData3);
  164. return 0;
  165. }
  166. private static int ColorDodge(Mat mat, Mat mat2, SDIC_MAT_PTR sdic_mat_ptr) {
  167. int channels = mat.channels();
  168. int i = (mat.total() * ((long) channels));
  169. byte[] GetPixcelData = SDIC_BCSC.GetPixcelData(mat);
  170. byte[] GetPixcelData2 = SDIC_BCSC.GetPixcelData(mat2);
  171. byte[] MakePixcelData = SDIC_BCSC.MakePixcelData(mat);
  172. for (int i2 = 0; i2 < i; i2 += channels) {
  173. for (int i3 = 0; i3 < 3; i3++) {
  174. int i4 = i2 + i3;
  175. byte b = GetPixcelData2[i4] & UnsignedBytes.MAX_VALUE;
  176. if (b <= 0) {
  177. b = 1;
  178. }
  179. int i5 = (( ((GetPixcelData[i4] & UnsignedBytes.MAX_VALUE) * UnsignedBytes.MAX_VALUE)) / ( b));
  180. if (i5 > 255) {
  181. i5 = 255;
  182. }
  183. if (i5 < 0) {
  184. i5 = 0;
  185. }
  186. MakePixcelData[i4] = (byte) i5;
  187. }
  188. }
  189. sdic_mat_ptr.setMat(SDIC_BCSC.SetPixcelData(mat.rows(), mat.cols(), mat.type(), MakePixcelData));
  190. return 0;
  191. }
  192. /* JADX WARNING: Code restructure failed: missing block: B:24:0x009b, code lost:
  193. r0 = e;
  194. */
  195. /* JADX WARNING: Code restructure failed: missing block: B:25:0x009d, code lost:
  196. r0 = th;
  197. */
  198. /* JADX WARNING: Code restructure failed: missing block: B:43:0x00bb, code lost:
  199. r0 = th;
  200. */
  201. /* JADX WARNING: Code restructure failed: missing block: B:44:0x00bd, code lost:
  202. r3 = r16;
  203. */
  204. /* JADX WARNING: Code restructure failed: missing block: B:46:0x00c0, code lost:
  205. r3 = r16;
  206. */
  207. /* JADX WARNING: Code restructure failed: missing block: B:48:0x00c3, code lost:
  208. r0 = e;
  209. */
  210. /* JADX WARNING: Code restructure failed: missing block: B:49:0x00c4, code lost:
  211. r3 = r16;
  212. */
  213. /* JADX WARNING: Code restructure failed: missing block: B:58:0x00d3, code lost:
  214. r2.release();
  215. */
  216. /* JADX WARNING: Code restructure failed: missing block: B:59:0x00d6, code lost:
  217. if (r1 != null) goto L_0x00d8;
  218. */
  219. /* JADX WARNING: Code restructure failed: missing block: B:60:0x00d8, code lost:
  220. r1.release();
  221. */
  222. /* JADX WARNING: Code restructure failed: missing block: B:66:0x00e6, code lost:
  223. r2.release();
  224. */
  225. /* JADX WARNING: Code restructure failed: missing block: B:67:0x00e9, code lost:
  226. if (r1 != null) goto L_0x00d8;
  227. */
  228. /* JADX WARNING: Code restructure failed: missing block: B:73:0x00f4, code lost:
  229. r1.release();
  230. */
  231. /* JADX WARNING: Code restructure failed: missing block: B:75:0x00f9, code lost:
  232. r4.release();
  233. */
  234. /* JADX WARNING: Code restructure failed: missing block: B:87:?, code lost:
  235. return r0;
  236. */
  237. /* JADX WARNING: Failed to process nested try/catch */
  238. /* JADX WARNING: Removed duplicated region for block: B:25:0x009d A[ExcHandler: all (th java.lang.Throwable), Splitter:B:18:0x0073] */
  239. /* JADX WARNING: Removed duplicated region for block: B:43:0x00bb A[ExcHandler: all (th java.lang.Throwable), Splitter:B:7:0x003c] */
  240. /* JADX WARNING: Removed duplicated region for block: B:58:0x00d3 */
  241. /* JADX WARNING: Removed duplicated region for block: B:66:0x00e6 */
  242. /* JADX WARNING: Removed duplicated region for block: B:73:0x00f4 */
  243. /* JADX WARNING: Removed duplicated region for block: B:75:0x00f9 */
  244. /* JADX WARNING: Removed duplicated region for block: B:81:0x0105 */
  245. /* JADX WARNING: Removed duplicated region for block: B:83:0x010a */
  246. /* JADX WARNING: Removed duplicated region for block: B:87:? A[RETURN, SYNTHETIC] */
  247. /* Code decompiled incorrectly, please refer to instructions dump. */
  248. private static int MakeCleaningFilter(org.opencv.core.Mat r15, epson.colorcorrection.SDIC_MAT_PTR r16, double r17, double r19) {
  249. /*
  250. r1 = 0
  251. org.opencv.core.Size r0 = r15.size() // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  252. double r2 = r0.width // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  253. double r2 = r19 / r2
  254. org.opencv.core.Size r0 = r15.size() // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  255. double r4 = r0.height // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  256. org.opencv.core.Size r0 = r15.size() // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  257. double r6 = r0.width // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  258. int r0 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1))
  259. if (r0 >= 0) goto L_0x0021
  260. org.opencv.core.Size r0 = r15.size() // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  261. double r2 = r0.height // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  262. double r2 = r19 / r2
  263. L_0x0021:
  264. org.opencv.core.Size r0 = new org.opencv.core.Size // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  265. org.opencv.core.Size r4 = r15.size() // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  266. double r4 = r4.width // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  267. double r4 = r4 * r2
  268. org.opencv.core.Size r6 = r15.size() // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  269. double r6 = r6.height // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  270. double r6 = r6 * r2
  271. r0.<init>(r4, r6) // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  272. org.opencv.core.Mat r2 = new org.opencv.core.Mat // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  273. r2.<init>() // Catch:{ SDIC_Exception -> 0x00ec, CvException -> 0x00df, Exception -> 0x00cc, all -> 0x00c9 }
  274. r3 = r15
  275. org.opencv.imgproc.Imgproc.resize(r15, r2, r0) // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  276. r4 = 0
  277. int r0 = (r17 > r4 ? 1 : (r17 == r4 ? 0 : -1))
  278. if (r0 <= 0) goto L_0x00ac
  279. org.opencv.core.Size r0 = r15.size() // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  280. double r4 = r0.height // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  281. org.opencv.core.Size r0 = r15.size() // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  282. double r6 = r0.width // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  283. int r0 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1))
  284. if (r0 >= 0) goto L_0x005f
  285. org.opencv.core.Size r0 = r2.size() // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  286. double r4 = r0.height // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  287. double r4 = r4 * r17
  288. int r0 = r4 // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  289. goto L_0x0068
  290. L_0x005f:
  291. org.opencv.core.Size r0 = r2.size() // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  292. double r4 = r0.width // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  293. double r4 = r4 * r17
  294. int r0 = r4 // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  295. L_0x0068:
  296. int r4 = r0 % 2
  297. if (r4 != 0) goto L_0x006e
  298. int r0 = r0 + 1
  299. L_0x006e:
  300. org.opencv.core.Mat r4 = new org.opencv.core.Mat // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  301. r4.<init>() // Catch:{ SDIC_Exception -> 0x00c3, CvException -> 0x00c0, Exception -> 0x00bd, all -> 0x00bb }
  302. org.opencv.core.Size r10 = new org.opencv.core.Size // Catch:{ SDIC_Exception -> 0x00a8, CvException -> 0x00a4, Exception -> 0x00a0, all -> 0x009d }
  303. double r0 = r0 // Catch:{ SDIC_Exception -> 0x00a8, CvException -> 0x00a4, Exception -> 0x00a0, all -> 0x009d }
  304. r10.<init>(r0, r0) // Catch:{ SDIC_Exception -> 0x00a8, CvException -> 0x00a4, Exception -> 0x00a0, all -> 0x009d }
  305. r11 = 0
  306. r13 = 0
  307. r8 = r2
  308. r9 = r4
  309. org.opencv.imgproc.Imgproc.GaussianBlur(r8, r9, r10, r11, r13) // Catch:{ SDIC_Exception -> 0x00a8, CvException -> 0x00a4, Exception -> 0x00a0, all -> 0x009d }
  310. org.opencv.core.Mat r0 = r16.getMat() // Catch:{ SDIC_Exception -> 0x00a8, CvException -> 0x00a4, Exception -> 0x00a0, all -> 0x009d }
  311. org.opencv.core.Size r1 = r15.size() // Catch:{ SDIC_Exception -> 0x00a8, CvException -> 0x00a4, Exception -> 0x00a0, all -> 0x009d }
  312. org.opencv.imgproc.Imgproc.resize(r4, r0, r1) // Catch:{ SDIC_Exception -> 0x00a8, CvException -> 0x00a4, Exception -> 0x00a0, all -> 0x009d }
  313. r3 = r16
  314. r3.setMat(r0) // Catch:{ SDIC_Exception -> 0x009b, CvException -> 0x00a6, Exception -> 0x00a2, all -> 0x009d }
  315. r2.release()
  316. r4.release()
  317. r0 = 0
  318. goto L_0x00ff
  319. L_0x009b:
  320. r0 = move-exception
  321. goto L_0x00c7
  322. L_0x009d:
  323. r0 = move-exception
  324. goto L_0x0102
  325. L_0x00a0:
  326. r3 = r16
  327. L_0x00a2:
  328. r1 = r4
  329. goto L_0x00cf
  330. L_0x00a4:
  331. r3 = r16
  332. L_0x00a6:
  333. r1 = r4
  334. goto L_0x00e2
  335. L_0x00a8:
  336. r0 = move-exception
  337. r3 = r16
  338. goto L_0x00c7
  339. L_0x00ac:
  340. r3 = r16
  341. epson.colorcorrection.SDIC_Exception r0 = new epson.colorcorrection.SDIC_Exception // Catch:{ SDIC_Exception -> 0x00b9, CvException -> 0x00b7, Exception -> 0x00b5, all -> 0x00bb }
  342. r4 = -7
  343. r0.<init>(r4) // Catch:{ SDIC_Exception -> 0x00b9, CvException -> 0x00b7, Exception -> 0x00b5, all -> 0x00bb }
  344. throw r0 // Catch:{ SDIC_Exception -> 0x00b9, CvException -> 0x00b7, Exception -> 0x00b5, all -> 0x00bb }
  345. L_0x00b5:
  346. goto L_0x00cf
  347. L_0x00b7:
  348. goto L_0x00e2
  349. L_0x00b9:
  350. r0 = move-exception
  351. goto L_0x00c6
  352. L_0x00bb:
  353. r0 = move-exception
  354. goto L_0x0103
  355. L_0x00bd:
  356. r3 = r16
  357. goto L_0x00cf
  358. L_0x00c0:
  359. r3 = r16
  360. goto L_0x00e2
  361. L_0x00c3:
  362. r0 = move-exception
  363. r3 = r16
  364. L_0x00c6:
  365. r4 = r1
  366. L_0x00c7:
  367. r1 = r2
  368. goto L_0x00f0
  369. L_0x00c9:
  370. r0 = move-exception
  371. r2 = r1
  372. goto L_0x0103
  373. L_0x00cc:
  374. r3 = r16
  375. r2 = r1
  376. L_0x00cf:
  377. r0 = -400(0xfffffffffffffe70, float:NaN)
  378. if (r2 == 0) goto L_0x00d6
  379. r2.release()
  380. L_0x00d6:
  381. if (r1 == 0) goto L_0x00db
  382. L_0x00d8:
  383. r1.release()
  384. L_0x00db:
  385. r16.releaseMat()
  386. goto L_0x00ff
  387. L_0x00df:
  388. r3 = r16
  389. r2 = r1
  390. L_0x00e2:
  391. r0 = -100
  392. if (r2 == 0) goto L_0x00e9
  393. r2.release()
  394. L_0x00e9:
  395. if (r1 == 0) goto L_0x00db
  396. goto L_0x00d8
  397. L_0x00ec:
  398. r0 = move-exception
  399. r3 = r16
  400. r4 = r1
  401. L_0x00f0:
  402. int r0 = r0.mCode // Catch:{ all -> 0x0100 }
  403. if (r1 == 0) goto L_0x00f7
  404. r1.release()
  405. L_0x00f7:
  406. if (r4 == 0) goto L_0x00fc
  407. r4.release()
  408. L_0x00fc:
  409. if (r0 == 0) goto L_0x00ff
  410. goto L_0x00db
  411. L_0x00ff:
  412. return r0
  413. L_0x0100:
  414. r0 = move-exception
  415. r2 = r1
  416. L_0x0102:
  417. r1 = r4
  418. L_0x0103:
  419. if (r2 == 0) goto L_0x0108
  420. r2.release()
  421. L_0x0108:
  422. if (r1 == 0) goto L_0x010d
  423. r1.release()
  424. L_0x010d:
  425. throw r0
  426. */
  427. throw new UnsupportedOperationException("Method not decompiled: epson.colorcorrection.SDIC_PWC.MakeCleaningFilter(org.opencv.core.Mat, epson.colorcorrection.SDIC_MAT_PTR, double, double):int");
  428. }
  429. private static void LogMemory(String str) {
  430. Runtime runtime = Runtime.getRuntime();
  431. float f = (float) runtime.totalMemory();
  432. float freeMemory = (float) runtime.freeMemory();
  433. Log.d("LogMemory", String.format("max:%.2fMB total:%.2fMB free:%.2fMB used:%.2fMB %s", new Object[]{Float.valueOf(((float) runtime.maxMemory()) / 1048576.0f), Float.valueOf(f / 1048576.0f), Float.valueOf(freeMemory / 1048576.0f), Float.valueOf((f - freeMemory) / 1048576.0f), str}));
  434. }
  435. }