From: Andrey Pavlenko Date: Mon, 2 Jul 2012 11:54:24 +0000 (+0000) Subject: restoring binary compatibility with 2.4.1 X-Git-Tag: accepted/2.0/20130307.220821~364^2~447 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=600ad799c78a5826fad7eaebdce623a51040a003;p=profile%2Fivi%2Fopencv.git restoring binary compatibility with 2.4.1 --- diff --git a/modules/java/generator/src/cpp/utils.cpp b/modules/java/generator/src/cpp/utils.cpp index fed03b6..3193d6b 100644 --- a/modules/java/generator/src/cpp/utils.cpp +++ b/modules/java/generator/src/cpp/utils.cpp @@ -21,13 +21,13 @@ extern "C" { /* * Class: org_opencv_android_Utils - * Method: void nBitmapToMat(Bitmap b, long m_addr, boolean unPremultiplyAlpha) + * Method: void nBitmapToMat2(Bitmap b, long m_addr, boolean unPremultiplyAlpha) */ -JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat2 (JNIEnv * env, jclass, jobject bitmap, jlong m_addr, jboolean needUnPremultiplyAlpha); -JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat2 (JNIEnv * env, jclass, jobject bitmap, jlong m_addr, jboolean needUnPremultiplyAlpha) { AndroidBitmapInfo info; @@ -72,14 +72,25 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat } } +// old signature is left for binary compatibility with 2.4.0 & 2.4.1, to removed in 2.5 +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat + (JNIEnv * env, jclass, jobject bitmap, jlong m_addr); + +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat + (JNIEnv * env, jclass, jobject bitmap, jlong m_addr) +{ + Java_org_opencv_android_Utils_nBitmapToMat2(env, 0, bitmap, m_addr, false); +} + /* * Class: org_opencv_android_Utils - * Method: void nMatToBitmap(long m_addr, Bitmap b, boolean premultiplyAlpha) + * Method: void nMatToBitmap2(long m_addr, Bitmap b, boolean premultiplyAlpha) */ -JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap + +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap2 (JNIEnv * env, jclass, jlong m_addr, jobject bitmap, jboolean needPremultiplyAlpha); -JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap2 (JNIEnv * env, jclass, jlong m_addr, jobject bitmap, jboolean needPremultiplyAlpha) { AndroidBitmapInfo info; @@ -143,4 +154,14 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap } } +// old signature is left for binary compatibility with 2.4.0 & 2.4.1, to removed in 2.5 +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap + (JNIEnv * env, jclass, jlong m_addr, jobject bitmap); + +JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap + (JNIEnv * env, jclass, jlong m_addr, jobject bitmap) +{ + Java_org_opencv_android_Utils_nMatToBitmap2(env, 0, m_addr, bitmap, false); +} + } // extern "C" diff --git a/modules/java/generator/src/java/android+Utils.java b/modules/java/generator/src/java/android+Utils.java index 6b67f66..28ca261 100644 --- a/modules/java/generator/src/java/android+Utils.java +++ b/modules/java/generator/src/java/android+Utils.java @@ -90,7 +90,7 @@ public class Utils { throw new java.lang.IllegalArgumentException("bmp == null"); if (mat == null) throw new java.lang.IllegalArgumentException("mat == null"); - nBitmapToMat(bmp, mat.nativeObj, unPremultiplyAlpha); + nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha); } /** @@ -120,7 +120,7 @@ public class Utils { throw new java.lang.IllegalArgumentException("mat == null"); if (bmp == null) throw new java.lang.IllegalArgumentException("bmp == null"); - nMatToBitmap(mat.nativeObj, bmp, premultiplyAlpha); + nMatToBitmap2(mat.nativeObj, bmp, premultiplyAlpha); } /** @@ -138,7 +138,7 @@ public class Utils { System.loadLibrary("opencv_java"); } - private static native void nBitmapToMat(Bitmap b, long m_addr, boolean unPremultiplyAlpha); + private static native void nBitmapToMat2(Bitmap b, long m_addr, boolean unPremultiplyAlpha); - private static native void nMatToBitmap(long m_addr, Bitmap b, boolean premultiplyAlpha); + private static native void nMatToBitmap2(long m_addr, Bitmap b, boolean premultiplyAlpha); }