Commit 7fed582d authored by Kirill Kornyakov's avatar Kirill Kornyakov

implemented static Mat.eye method

parent 837b733a
......@@ -218,6 +218,14 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nCross
*/
JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nInv
(JNIEnv *, jclass, jlong);
/*
* Class: org_opencv_Mat
* Method: nEye
* Signature: (III)J
*/
JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nEye
(JNIEnv *, jclass, jint, jint, jint);
#ifdef __cplusplus
}
......@@ -586,6 +594,12 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nInv
return 0; //NYI
}
JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nEye
(JNIEnv* env, jclass cls, jint _rows, jint _cols, jint _type)
{
return (jlong) new cv::Mat(cv::Mat::eye( _rows, _cols, _type ));
}
JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nCreateMat__III
(JNIEnv* env, jclass cls, jint _rows, jint _cols, jint _type)
{
......
......@@ -383,6 +383,10 @@ public class Mat {
return nativeObj;
}
static public Mat eye(int rows, int cols, CvType type) {
return new Mat( nEye(rows, cols, type.toInt()) );
}
// native stuff
static { System.loadLibrary("opencv_java"); }
protected long nativeObj;
......@@ -414,5 +418,6 @@ public class Mat {
private static native double nDot(long self, long mat);
private static native long nCross(long self, long mat);
private static native long nInv(long self);
private static native long nEye(int rows, int cols, int type);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment