jni.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #include <jni.h>
  2. #include "CLprocessor.hpp"
  3. extern "C" {
  4. JNIEXPORT jboolean JNICALL Java_org_opencv_samples_tutorial4_NativePart_builtWithOpenCL(JNIEnv * env, jclass cls);
  5. JNIEXPORT jint JNICALL Java_org_opencv_samples_tutorial4_NativePart_initCL(JNIEnv * env, jclass cls);
  6. JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_closeCL(JNIEnv * env, jclass cls);
  7. JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_processFrame(JNIEnv * env, jclass cls, jint tex1, jint tex2, jint w, jint h, jint mode);
  8. JNIEXPORT jboolean JNICALL Java_org_opencv_samples_tutorial4_NativePart_builtWithOpenCL(JNIEnv * env, jclass cls)
  9. {
  10. #ifdef OPENCL_FOUND
  11. return JNI_TRUE;
  12. #else
  13. return JNI_FALSE;
  14. #endif
  15. }
  16. JNIEXPORT jint JNICALL Java_org_opencv_samples_tutorial4_NativePart_initCL(JNIEnv * env, jclass cls)
  17. {
  18. return initCL();
  19. }
  20. JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_closeCL(JNIEnv * env, jclass cls)
  21. {
  22. closeCL();
  23. }
  24. JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_NativePart_processFrame(JNIEnv * env, jclass cls, jint tex1, jint tex2, jint w, jint h, jint mode)
  25. {
  26. processFrame(tex1, tex2, w, h, mode);
  27. }
  28. } // extern "C"