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
86105b87
Commit
86105b87
authored
Jul 18, 2011
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java API: fix in Mat::put(r,c,double[]vals) method
parent
cc3c034c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
Mat.cpp
modules/java/src/cpp/Mat.cpp
+1
-3
No files found.
modules/java/src/cpp/Mat.cpp
View file @
86105b87
...
...
@@ -78,7 +78,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nClone
}
// unlike other nPut()-s this one (with double[]) should convert input values to correct type
#define PUT_ITEM(T, R, C)
for(int ch=0; ch<me->channels() && count>0; ch++,count--) *((T*)me->ptr(R, C)+ch) = cv::saturate_cast<T>(*(src+ch))
#define PUT_ITEM(T, R, C)
{ T*dst = (T*)me->ptr(R, C); for(int ch=0; ch<me->channels() && count>0; count--,ch++,src++,dst++) *dst = cv::saturate_cast<T>(*src); }
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nPutD
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jdoubleArray
vals
)
...
...
@@ -104,7 +104,6 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutD
case
CV_32F
:
PUT_ITEM
(
float
,
row
,
c
);
break
;
case
CV_64F
:
PUT_ITEM
(
double
,
row
,
c
);
break
;
}
src
++
;
}
for
(
r
=
row
+
1
;
r
<
me
->
rows
&&
count
>
0
;
r
++
)
...
...
@@ -119,7 +118,6 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutD
case
CV_32F
:
PUT_ITEM
(
float
,
r
,
c
);
break
;
case
CV_64F
:
PUT_ITEM
(
double
,
r
,
c
);
break
;
}
src
++
;
}
env
->
ReleasePrimitiveArrayCritical
(
vals
,
values
,
0
);
...
...
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