-
-
Save anonymous/e50639738d97d4e6b1cd551cb3ce1fc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%typemap(jstype) cv::Rect "org.opencv.core.Rect" // C++ cv::Rect corresponds to JAVA org.opencv.core.Rect (any input parameter or return value will be mapped to org.opencv.rect in the created JAVA classes) | |
%typemap(jtype) cv::Rect "org.opencv.core.Rect" // C++ cv::Rect corresponds to the JAVA intermediary type org.opencv.Rect in the generated JNI class (any input parameter or return value will be mapped to org.opencv.rect in the JNI classes) | |
%typemap(jni) cv::Rect "jobject" // C++ cv::Rect is treated as a jobject in the C++ part of the JNI code | |
%typemap(javaout) cv::Rect { | |
return $jnicall; | |
} // the JAVA implementation returning a cv::Rect just returns the result of the jni call | |
%typemap(out) cv::Rect{ // the C++ JNI implementation. This tells SWIG how to return a cv::Rect to JAVA via JNI | |
jclass jRectClass = jenv->FindClass("org/opencv/core/Rect"); | |
jmethodID jRectConstructor = jenv->GetMethodID(jRectClass, "<init>", "(IIII)V"); | |
jobject jRect = jenv->NewObject(jRectClass, jRectConstructor, $1.x, $1.y, $1.width, $1.height); | |
$result = jRect; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment