Commit 86105b87 authored by Andrey Pavlenko's avatar Andrey Pavlenko

Java API: fix in Mat::put(r,c,double[]vals) method

parent cc3c034c
......@@ -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);
......
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