Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How pass Rect from Java code to Jni?

Hi :) I have a problem... How can I pass Rect object from Java to C ?

If I want pass Mat... I do something like this:

Java:

Mat mat = new Mat()
nativeMethod(mat.getNativeObjAddr())

C

nativeMethod(JNIEnv * jenv, jclass, jlong matFromJava){
  Mat mat = *(Mat*)matFromJava;
}

but getNativeObjAddr() for Rect objects doesn't exist, so how can I do this?