mirror of https://github.com/opencv/opencv.git
parent
81656597e9
commit
7f3b6c177f
11 changed files with 131 additions and 89 deletions
@ -0,0 +1,8 @@ |
||||
#ifndef __CL_PROCESSOR_HPP__ |
||||
#define __CL_PROCESSOR_HPP__ |
||||
|
||||
int initCL(); |
||||
void closeCL(); |
||||
void processFrame(int tex1, int tex2, int w, int h, int mode); |
||||
|
||||
#endif |
@ -1,20 +0,0 @@ |
||||
#include <jni.h> |
||||
|
||||
int initCL(); |
||||
void closeCL(); |
||||
void processFrame(int tex1, int tex2, int w, int h, int mode); |
||||
|
||||
JNIEXPORT jint JNICALL Java_org_opencv_samples_tutorial4_NativePart_initCL(JNIEnv * env, jclass cls) |
||||
{ |
||||
return initCL(); |
||||
} |
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_closeCL(JNIEnv * env, jclass cls) |
||||
{ |
||||
closeCL(); |
||||
} |
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_processFrame(JNIEnv * env, jclass cls, jint tex1, jint tex2, jint w, jint h, jint mode) |
||||
{ |
||||
processFrame(tex1, tex2, w, h, mode); |
||||
} |
@ -0,0 +1,36 @@ |
||||
#include <jni.h> |
||||
#include "CLprocessor.hpp" |
||||
|
||||
extern "C" { |
||||
JNIEXPORT jboolean JNICALL Java_org_opencv_samples_tutorial4_NativePart_builtWithOpenCL(JNIEnv * env, jclass cls); |
||||
|
||||
JNIEXPORT jint JNICALL Java_org_opencv_samples_tutorial4_NativePart_initCL(JNIEnv * env, jclass cls); |
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_closeCL(JNIEnv * env, jclass cls); |
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_processFrame(JNIEnv * env, jclass cls, jint tex1, jint tex2, jint w, jint h, jint mode); |
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_opencv_samples_tutorial4_NativePart_builtWithOpenCL(JNIEnv * env, jclass cls) |
||||
{ |
||||
#ifdef OPENCL_FOUND |
||||
return JNI_TRUE; |
||||
#else |
||||
return JNI_FALSE; |
||||
#endif |
||||
} |
||||
|
||||
JNIEXPORT jint JNICALL Java_org_opencv_samples_tutorial4_NativePart_initCL(JNIEnv * env, jclass cls) |
||||
{ |
||||
return initCL(); |
||||
} |
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_closeCL(JNIEnv * env, jclass cls) |
||||
{ |
||||
closeCL(); |
||||
} |
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_processFrame(JNIEnv * env, jclass cls, jint tex1, jint tex2, jint w, jint h, jint mode) |
||||
{ |
||||
processFrame(tex1, tex2, w, h, mode); |
||||
} |
||||
} // extern "C"
|
@ -1,9 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
<group android:checkableBehavior="single"> |
||||
<item android:id="@+id/no_proc" android:title="No processing" /> |
||||
<item android:id="@+id/cpu" android:title="Use CPU code" /> |
||||
<item android:id="@+id/ocl_direct" android:title="Use OpenCL direct" /> |
||||
<item android:id="@+id/ocl_ocv" android:title="Use OpenCL via OpenCV" /> |
||||
</group> |
||||
</menu> |
Loading…
Reference in new issue