Add experimental support for desktop Java

Based on pull request #31 (thanks to Eric Christiansen)
Support for Java is turned off by default and can be enabled setting
BUILD_opencv_java to ON (e.g. cmake -DBUILD_opencv_java=ON ..)
This commit is contained in:
Andrey Kamaev
2012-09-15 15:46:34 +04:00
parent ece71d6a06
commit fe0d07ae53
6 changed files with 65 additions and 10 deletions

View File

@@ -871,7 +871,7 @@ public class %(jc)s {
#include "converters.h"
#ifdef DEBUG
#if defined DEBUG && defined ANDROID
#include <android/log.h>
#define MODULE_LOG_TAG "OpenCV.%(m)s"
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, MODULE_LOG_TAG, __VA_ARGS__))

View File

@@ -2,6 +2,8 @@
#include "converters.h"
#ifdef ANDROID
#include <android/log.h>
#define LOG_TAG "org.opencv.core.Mat"
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
@@ -11,6 +13,11 @@
#define LOGD(...)
#endif //DEBUG
#else
#define LOGE(...)
#define LOGD(...)
#endif
#include "opencv2/core/core.hpp"
using namespace cv;

View File

@@ -3,6 +3,8 @@
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#ifdef ANDROID
#include <android/bitmap.h>
#include <android/log.h>
@@ -165,3 +167,5 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap
}
} // extern "C"
#endif //ANDROID