restoring binary compatibility with 2.4.1

pull/2/head
Andrey Pavlenko 13 years ago
parent 5d6c90e166
commit 600ad799c7
  1. 33
      modules/java/generator/src/cpp/utils.cpp
  2. 8
      modules/java/generator/src/java/android+Utils.java

@ -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"

@ -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);
}

Loading…
Cancel
Save