Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
5688b014
Commit
5688b014
authored
Jul 05, 2011
by
Kirill Kornyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JavaAPI: implemented Mat.dump method (analog for C++ stream <<)
parent
ff8fe39e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
MatTest.java
modules/java/android_test/src/org/opencv/test/MatTest.java
+2
-1
Mat.cpp
modules/java/src/cpp/Mat.cpp
+17
-0
Mat.java
modules/java/src/java/Mat.java
+6
-1
No files found.
modules/java/android_test/src/org/opencv/test/MatTest.java
View file @
5688b014
...
...
@@ -9,7 +9,8 @@ public class MatTest extends OpenCVTestCase {
}
public
void
testChannels
()
{
fail
(
"Not yet implemented"
);
//fail("Not yet implemented");
utils
.
Log
(
grayRnd
.
dump
());
}
public
void
testClone
()
{
...
...
modules/java/src/cpp/Mat.cpp
View file @
5688b014
...
...
@@ -240,6 +240,14 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nInv
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nEye
(
JNIEnv
*
,
jclass
,
jint
,
jint
,
jint
);
/*
* Class: org_opencv_Mat
* Method: nDump
* Signature: (J)S
*/
JNIEXPORT
jstring
JNICALL
Java_org_opencv_Mat_nDump
(
JNIEnv
*
,
jclass
,
jlong
);
#ifdef __cplusplus
}
#endif
...
...
@@ -619,6 +627,15 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nEye
return
(
jlong
)
new
cv
::
Mat
(
cv
::
Mat
::
eye
(
_rows
,
_cols
,
_type
));
}
JNIEXPORT
jstring
JNICALL
Java_org_opencv_Mat_nDump
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
std
::
stringstream
s
;
s
<<
*
me
;
return
env
->
NewStringUTF
(
s
.
str
().
c_str
());
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nCreateMat__III
(
JNIEnv
*
env
,
jclass
cls
,
jint
_rows
,
jint
_cols
,
jint
_type
)
{
...
...
modules/java/src/java/Mat.java
View file @
5688b014
...
...
@@ -180,10 +180,14 @@ public class Mat {
rows
()
+
"*"
+
cols
()
+
"*"
+
type
()
+
", isCont="
+
isContinuous
()
+
", isSubmat="
+
isSubmatrix
()
+
", nativeObj=0x"
+
Long
.
toHexString
(
nativeObj
)
+
", dataAddr=0x"
+
Long
.
toHexString
(
dataAddr
())
+
", dataAddr=0x"
+
Long
.
toHexString
(
dataAddr
())
+
" ]"
;
}
public
String
dump
()
{
return
nDump
(
nativeObj
);
}
public
boolean
empty
()
{
if
(
nativeObj
==
0
)
return
true
;
return
nIsEmpty
(
nativeObj
);
...
...
@@ -426,5 +430,6 @@ public class 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
);
private
static
native
String
nDump
(
long
self
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment