diff --git a/eyes-two/src/main/jni/Application.mk b/eyes-two/src/main/jni/Application.mk index aad99517e..af9bf9a7b 100644 --- a/eyes-two/src/main/jni/Application.mk +++ b/eyes-two/src/main/jni/Application.mk @@ -1,3 +1,3 @@ -APP_ABI := armeabi-v7a # x86 arm64-v8a x86_64 mips64 +APP_ABI := armeabi-v7a x86 arm64-v8a x86_64 APP_OPTIM := release NDK_TOOLCHAIN_VERSION := clang diff --git a/tess-two/jni/Application.mk b/tess-two/jni/Application.mk index 979b40dcc..f734e7c37 100644 --- a/tess-two/jni/Application.mk +++ b/tess-two/jni/Application.mk @@ -1,5 +1,5 @@ APP_STL := gnustl_static -APP_ABI := armeabi-v7a # x86 arm64-v8a x86_64 mips64 +APP_ABI := armeabi-v7a x86 arm64-v8a x86_64 APP_OPTIM := release APP_PLATFORM := android-9 APP_CPPFLAGS += -fexceptions -frtti diff --git a/tess-two/jni/com_googlecode_leptonica_android/utilities.cpp b/tess-two/jni/com_googlecode_leptonica_android/utilities.cpp index 51d1ca1aa..1bc0dcf04 100644 --- a/tess-two/jni/com_googlecode_leptonica_android/utilities.cpp +++ b/tess-two/jni/com_googlecode_leptonica_android/utilities.cpp @@ -39,7 +39,7 @@ jlong Java_com_googlecode_leptonica_android_AdaptiveMap_nativeBackgroundNormMorp PIX *pixd = pixBackgroundNormMorph(pixs, NULL, (l_int32) reduction, (l_int32) size, (l_int32) bgval); - return (jlong) pixd; + return jlong(pixd); } jlong Java_com_googlecode_leptonica_android_AdaptiveMap_nativePixContrastNorm(JNIEnv *env, @@ -55,7 +55,7 @@ jlong Java_com_googlecode_leptonica_android_AdaptiveMap_nativePixContrastNorm(JN PIX *pixd = pixContrastNorm(NULL, pixs, (l_int32) sizeX, (l_int32) sizeY, (l_int32) minDiff, (l_int32) smoothX, (l_int32) smoothY); - return (jlong) pixd; + return jlong(pixd); } /************ @@ -79,7 +79,7 @@ jlong Java_com_googlecode_leptonica_android_Binarize_nativeOtsuAdaptiveThreshold return (jlong) 0; } - return (jlong) pixd; + return jlong(pixd); } jlong Java_com_googlecode_leptonica_android_Binarize_nativeSauvolaBinarizeTiled(JNIEnv *env, @@ -98,7 +98,7 @@ jlong Java_com_googlecode_leptonica_android_Binarize_nativeSauvolaBinarizeTiled( return (jlong) 0; } - return (jlong) pixd; + return jlong(pixd); } /******** @@ -112,7 +112,7 @@ jlong Java_com_googlecode_leptonica_android_Clip_nativeClipRectangle(JNIEnv *env BOX *box = (BOX *) nativeBox; PIX *pixd; pixd = pixClipRectangle(pixs,box,NULL); - return (jlong) pixd; + return jlong(pixd); } /*********** @@ -124,7 +124,7 @@ jlong Java_com_googlecode_leptonica_android_Convert_nativeConvertTo8(JNIEnv *env PIX *pixs = (PIX *) nativePix; PIX *pixd = pixConvertTo8(pixs, FALSE); - return (jlong) pixd; + return jlong(pixd); } /******** @@ -138,7 +138,7 @@ jlong Java_com_googlecode_leptonica_android_Edge_nativePixSobelEdgeFilter(JNIEnv PIX *pixs = (PIX *) nativePix; PIX *pixd = pixSobelEdgeFilter(pixs, (l_int32) orientFlag); - return (jlong) pixd; + return jlong(pixd); } /*********** @@ -152,7 +152,7 @@ jlong Java_com_googlecode_leptonica_android_Enhance_nativeUnsharpMasking(JNIEnv PIX *pixs = (PIX *) nativePix; PIX *pixd = pixUnsharpMasking(pixs, (l_int32) halfwidth, (l_float32) fract); - return (jlong) pixd; + return jlong(pixd); } /************* @@ -164,7 +164,7 @@ jlong Java_com_googlecode_leptonica_android_GrayQuant_nativePixThresholdToBinary PIX *pixs = (PIX *) nativePix; PIX *pixd = pixThresholdToBinary(pixs, (l_int32) thresh); - return (jlong) pixd; + return jlong(pixd); } /********** @@ -206,7 +206,7 @@ jlong Java_com_googlecode_leptonica_android_MorphApp_nativePixTophat(JNIEnv *env PIX *pixs = (PIX *) nativePix; PIX *pixd = pixTophat(pixs, (l_int32) hsize, (l_int32) vsize, (l_int32) type); - return (jlong) pixd; + return jlong(pixd); } jlong Java_com_googlecode_leptonica_android_MorphApp_nativePixFastTophat(JNIEnv *env, jclass clazz, @@ -215,7 +215,7 @@ jlong Java_com_googlecode_leptonica_android_MorphApp_nativePixFastTophat(JNIEnv PIX *pixs = (PIX *) nativePix; PIX *pixd = pixFastTophat(pixs, (l_int32) xsize, (l_int32) ysize, (l_int32) type); - return (jlong) pixd; + return jlong(pixd); } /********* @@ -225,18 +225,17 @@ jlong Java_com_googlecode_leptonica_android_MorphApp_nativePixFastTophat(JNIEnv jlong Java_com_googlecode_leptonica_android_Scale_nativeScaleGeneral(JNIEnv *env, jclass clazz, jlong nativePix, jfloat scaleX, jfloat scaleY, jfloat sharpfract, jint sharpwidth) { - PIX *pixs = (PIX *) nativePix; - PIX *pixd = pixScaleGeneral(pixs, (l_float32) scaleX, (l_float32) scaleY,(l_float32) sharpfract, (l_int32) sharpwidth); - return (jlong) pixd; + PIX *pixs = (Pix *) nativePix; + return (jlong) pixScaleGeneral(pixs, (l_float32) scaleX, (l_float32) scaleY,(l_float32) sharpfract, (l_int32) sharpwidth); } jlong Java_com_googlecode_leptonica_android_Scale_nativeScale(JNIEnv *env, jclass clazz, jlong nativePix, jfloat scaleX, jfloat scaleY) { - PIX *pixs = (PIX *) nativePix; + PIX *pixs = (Pix *) nativePix; PIX *pixd = pixScale(pixs, (l_float32) scaleX, (l_float32) scaleY); - return (jlong) pixd; + return jlong(pixd); } /******** @@ -291,7 +290,7 @@ jlong Java_com_googlecode_leptonica_android_Rotate_nativeRotate(JNIEnv *env, jcl pixd = pixRotate(pixs, radians, type, L_BRING_IN_WHITE, w, h); } - return (jlong) pixd; + return jlong(pixd); } jlong Java_com_googlecode_leptonica_android_Rotate_nativeRotateOrth(JNIEnv *env, jclass clazz, @@ -300,7 +299,7 @@ jlong Java_com_googlecode_leptonica_android_Rotate_nativeRotateOrth(JNIEnv *env, PIX *pixs = (PIX *) nativePix; PIX *pixd; pixd = pixRotateOrth(pixs,(int)quads); - return (jlong) pixd; + return jlong(pixd); } #ifdef __cplusplus diff --git a/tess-two/src/com/googlecode/leptonica/android/Clip.java b/tess-two/src/com/googlecode/leptonica/android/Clip.java index 49bf07b8b..d742b26ae 100644 --- a/tess-two/src/com/googlecode/leptonica/android/Clip.java +++ b/tess-two/src/com/googlecode/leptonica/android/Clip.java @@ -55,7 +55,7 @@ public class Clip { * @return clipped pix, or null if rectangle doesn't intersect source pix */ public static Pix clipRectangle(Pix source, Box box) { - int result = nativeClipRectangle(source.getNativePix(), + long result = nativeClipRectangle(source.getNativePix(), box.getNativeBox()); if (result != 0) { return new Pix(result); @@ -67,5 +67,5 @@ public static Pix clipRectangle(Pix source, Box box) { // * NATIVE CODE * // *************** - private static native int nativeClipRectangle(long nativePix, long nativeBox); + private static native long nativeClipRectangle(long nativePix, long nativeBox); } \ No newline at end of file diff --git a/tess-two/src/com/googlecode/leptonica/android/Pixa.java b/tess-two/src/com/googlecode/leptonica/android/Pixa.java index 20d343f3b..aba993857 100644 --- a/tess-two/src/com/googlecode/leptonica/android/Pixa.java +++ b/tess-two/src/com/googlecode/leptonica/android/Pixa.java @@ -120,7 +120,7 @@ public Pixa copy() { if (mRecycled) throw new IllegalStateException(); - int nativePixa = nativeCopy(mNativePixa); + long nativePixa = nativeCopy(mNativePixa); if (nativePixa == 0) { throw new OutOfMemoryError(); @@ -143,7 +143,7 @@ public Pixa sort(@Constants.SortBy int field, @Constants.SortOrder int order) { if (mRecycled) throw new IllegalStateException(); - int nativePixa = nativeSort(mNativePixa, field, order); + long nativePixa = nativeSort(mNativePixa, field, order); if (nativePixa == 0) { throw new OutOfMemoryError(); @@ -484,11 +484,11 @@ public void remove() { // * NATIVE CODE * // *************** - private static native int nativeCreate(int size); + private static native long nativeCreate(int size); - private static native int nativeCopy(long nativePixa); + private static native long nativeCopy(long nativePixa); - private static native int nativeSort(long nativePixa, int field, int order); + private static native long nativeSort(long nativePixa, int field, int order); private static native boolean nativeJoin(long nativePixa, long otherPixa); diff --git a/tess-two/src/com/googlecode/leptonica/android/Rotate.java b/tess-two/src/com/googlecode/leptonica/android/Rotate.java index a9a379e6e..f04d88286 100644 --- a/tess-two/src/com/googlecode/leptonica/android/Rotate.java +++ b/tess-two/src/com/googlecode/leptonica/android/Rotate.java @@ -109,7 +109,7 @@ public static Pix rotateOrth(Pix pixs, @IntRange(from=0, to=3) int quads) { if (quads < 0 || quads > 3) throw new IllegalArgumentException("quads not in {0,1,2,3}"); - int nativePix = nativeRotateOrth(pixs.getNativePix(), quads); + long nativePix = nativeRotateOrth(pixs.getNativePix(), quads); if (nativePix == 0) return null; @@ -121,7 +121,7 @@ public static Pix rotateOrth(Pix pixs, @IntRange(from=0, to=3) int quads) { // * NATIVE CODE * // *************** - private static native int nativeRotateOrth(long nativePix, int quads); + private static native long nativeRotateOrth(long nativePix, int quads); private static native long nativeRotate(long nativePix, float degrees, boolean quality, boolean resize);