using namespace cv;
-/// throw java exception from std::exception, no logging
-static const char *throwJavaException(JNIEnv *env, const std::exception &e);
-static const char *throwJavaException(JNIEnv *env, const std::exception &e) {
- const char *exception_str = "std::exception";
+/// throw java exception
+static void throwJavaException(JNIEnv *env, const std::exception *e, const char *method);
+static void throwJavaException(JNIEnv *env, const std::exception *e, const char *method) {
+ std::string what = "unknown exception";
jclass je = 0;
- if(dynamic_cast<const cv::Exception*>(&e)) {
- exception_str = "cv::Exception";
- je = env->FindClass("org/opencv/core/CvException");
+ if(e) {
+ std::string exception_type = "std::exception";
+
+ if(dynamic_cast<const cv::Exception*>(e)) {
+ exception_type = "cv::Exception";
+ je = env->FindClass("org/opencv/core/CvException");
+ }
+
+ what = exception_type + ": " + e->what();
}
if(!je) je = env->FindClass("java/lang/Exception");
- env->ThrowNew(je, e.what());
- return exception_str;
-}
-
-/// throw java exception from unknown exception, no logging
-static void throwJavaException(JNIEnv *env);
-static void throwJavaException(JNIEnv *env) {
- jclass je = env->FindClass("java/lang/Exception");
- env->ThrowNew(je, "unknown exception");
-}
-
-/// throw java exception from std::exception, use LOGD
-static void throwJavaExceptionD(JNIEnv *env, const std::exception &e, const char *method);
-static void throwJavaExceptionD(JNIEnv *env, const std::exception &e, const char *method) {
- const char *exception_str = throwJavaException(env, e);
- LOGD("%s caught %s: %s", method, exception_str, e.what());
- (void)method; // avoid "unused" warning
- (void)exception_str; // avoid "unused" warning
-}
-
-/// throw java exception from unknown exception, use LOGD
-static void throwJavaExceptionD(JNIEnv *env, const char *method);
-static void throwJavaExceptionD(JNIEnv *env, const char *method) {
- throwJavaException(env);
- LOGD("%s caught unknown exception (...)", method);
- (void)method; // avoid "unused" warning
-}
-
-/// throw java exception from std::exception, use LOGE
-static void throwJavaExceptionE(JNIEnv *env, const std::exception &e, const char *method);
-static void throwJavaExceptionE(JNIEnv *env, const std::exception &e, const char *method) {
- const char *exception_str = throwJavaException(env, e);
- LOGE("%s caught %s: %s", method, exception_str, e.what());
+ env->ThrowNew(je, what.c_str());
+
+ LOGE("%s caught %s", method, what.c_str());
(void)method; // avoid "unused" warning
- (void)exception_str; // avoid "unused" warning
-}
-
-/// throw java exception from unknown exception, use LOGE
-static void throwJavaExceptionE(JNIEnv *env, const char *method);
-static void throwJavaExceptionE(JNIEnv *env, const char *method) {
- throwJavaException(env);
- LOGE("%s caught unknown exception (...)", method);
- (void)method; // avoid "unused" warning
}
extern "C" {
static const char method_name[] = "Mat::n_1Mat__III()";
try {
LOGD(method_name);
-
- Mat* _retval_ = new Mat( rows, cols, type );
-
- return (jlong) _retval_;
+ return (jlong) new Mat( rows, cols, type );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Size size((int)size_width, (int)size_height);
- Mat* _retval_ = new Mat( size, type );
-
- return (jlong) _retval_;
+ return (jlong) new Mat( size, type );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Scalar s(s_val0, s_val1, s_val2, s_val3);
- Mat* _retval_ = new Mat( rows, cols, type, s );
-
- return (jlong) _retval_;
+ return (jlong) new Mat( rows, cols, type, s );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Size size((int)size_width, (int)size_height);
Scalar s(s_val0, s_val1, s_val2, s_val3);
- Mat* _retval_ = new Mat( size, type, s );
-
- return (jlong) _retval_;
+ return (jlong) new Mat( size, type, s );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Range rowRange(rowRange_start, rowRange_end);
Range colRange(colRange_start, colRange_end);
- Mat* _retval_ = new Mat( (*(Mat*)m_nativeObj), rowRange, colRange );
-
- return (jlong) _retval_;
+ return (jlong) new Mat( (*(Mat*)m_nativeObj), rowRange, colRange );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Range rowRange(rowRange_start, rowRange_end);
- Mat* _retval_ = new Mat( (*(Mat*)m_nativeObj), rowRange );
-
- return (jlong) _retval_;
+ return (jlong) new Mat( (*(Mat*)m_nativeObj), rowRange );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->adjustROI( dtop, dbottom, dleft, dright );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
me->assignTo( (*(Mat*)m_nativeObj), type );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
me->assignTo( (*(Mat*)m_nativeObj) );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->channels( );
-
- return _retval_;
+ return me->channels( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->checkVector( elemChannels, depth, requireContinuous );
-
- return _retval_;
+ return me->checkVector( elemChannels, depth, requireContinuous );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->checkVector( elemChannels, depth );
-
- return _retval_;
+ return me->checkVector( elemChannels, depth );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->checkVector( elemChannels );
-
- return _retval_;
+ return me->checkVector( elemChannels );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->clone( );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->col( x );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->colRange( startcol, endcol );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->dims;
-
- return _retval_;
+ return me->dims;
} catch(cv::Exception e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->cols;
-
- return _retval_;
+ return me->cols;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
me->convertTo( m, rtype, alpha, beta );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
me->convertTo( m, rtype, alpha );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
me->convertTo( m, rtype );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
me->copyTo( m );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
Mat& m = *((Mat*)m_nativeObj);
Mat& mask = *((Mat*)mask_nativeObj);
me->copyTo( m, mask );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
me->create( rows, cols, type );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
Mat* me = (Mat*) self; //TODO: check for NULL
Size size((int)size_width, (int)size_height);
me->create( size, type );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
Mat _retval_ = me->cross( m );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->depth( );
-
- return _retval_;
+ return me->depth( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->diag( d );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
static const char method_name[] = "Mat::n_1diag__J()";
try {
LOGD(method_name);
-
Mat _retval_ = Mat::diag( (*(Mat*)d_nativeObj) );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
- double _retval_ = me->dot( m );
-
- return _retval_;
+ return me->dot( m );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- size_t _retval_ = me->elemSize( );
-
- return _retval_;
+ return me->elemSize( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- size_t _retval_ = me->elemSize1( );
-
- return _retval_;
+ return me->elemSize1( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- bool _retval_ = me->empty( );
-
- return _retval_;
+ return me->empty( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
static const char method_name[] = "Mat::n_1eye__III()";
try {
LOGD(method_name);
-
Mat _retval_ = Mat::eye( rows, cols, type );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Size size((int)size_width, (int)size_height);
Mat _retval_ = Mat::eye( size, type );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->inv( method );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->inv( );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- bool _retval_ = me->isContinuous( );
-
- return _retval_;
+ return me->isContinuous( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- bool _retval_ = me->isSubmatrix( );
-
- return _retval_;
+ return me->isSubmatrix( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Point ofs;
me->locateROI( wholeSize, ofs );
jdouble tmp_wholeSize[2] = {wholeSize.width, wholeSize.height}; env->SetDoubleArrayRegion(wholeSize_out, 0, 2, tmp_wholeSize); jdouble tmp_ofs[2] = {ofs.x, ofs.y}; env->SetDoubleArrayRegion(ofs_out, 0, 2, tmp_ofs);
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
Mat _retval_ = me->mul( m, scale );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& m = *((Mat*)m_nativeObj);
Mat _retval_ = me->mul( m );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
static const char method_name[] = "Mat::n_1ones__III()";
try {
LOGD(method_name);
-
Mat _retval_ = Mat::ones( rows, cols, type );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Size size((int)size_width, (int)size_height);
Mat _retval_ = Mat::ones( size, type );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
me->push_back( (*(Mat*)m_nativeObj) );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
me->release( );
-
- return;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return;
+ throwJavaException(env, 0, method_name);
}
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->reshape( cn, rows );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->reshape( cn );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->row( y );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->rowRange( startrow, endrow );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->rows;
-
- return _retval_;
+ return me->rows;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Mat* me = (Mat*) self; //TODO: check for NULL
Scalar s(s_val0, s_val1, s_val2, s_val3);
Mat _retval_ = me->operator =( s );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Scalar s(s_val0, s_val1, s_val2, s_val3);
Mat& mask = *((Mat*)mask_nativeObj);
Mat _retval_ = me->setTo( s, mask );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Mat& value = *((Mat*)value_nativeObj);
Mat& mask = *((Mat*)mask_nativeObj);
Mat _retval_ = me->setTo( value, mask );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Mat* me = (Mat*) self; //TODO: check for NULL
Mat& value = *((Mat*)value_nativeObj);
Mat _retval_ = me->setTo( value );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Size _retval_ = me->size( );
- jdoubleArray _da_retval_ = env->NewDoubleArray(2); jdouble _tmp_retval_[2] = {_retval_.width, _retval_.height}; env->SetDoubleArrayRegion(_da_retval_, 0, 2, _tmp_retval_);
+ jdoubleArray _da_retval_ = env->NewDoubleArray(2);
+ jdouble _tmp_retval_[2] = {_retval_.width, _retval_.height};
+ env->SetDoubleArrayRegion(_da_retval_, 0, 2, _tmp_retval_);
return _da_retval_;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- size_t _retval_ = me->step1( i );
-
- return _retval_;
+ return me->step1( i );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- size_t _retval_ = me->step1( );
-
- return _retval_;
+ return me->step1( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
//
Range rowRange(rowRange_start, rowRange_end);
Range colRange(colRange_start, colRange_end);
Mat _retval_ = me->operator()( rowRange, colRange );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
Mat* me = (Mat*) self; //TODO: check for NULL
Rect roi(roi_x, roi_y, roi_width, roi_height);
Mat _retval_ = me->operator()( roi );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
Mat _retval_ = me->t( );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- size_t _retval_ = me->total( );
-
- return _retval_;
+ return me->total( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
try {
LOGD(method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
- int _retval_ = me->type( );
-
- return _retval_;
+ return me->type( );
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
static const char method_name[] = "Mat::n_1zeros__III()";
try {
LOGD(method_name);
-
Mat _retval_ = Mat::zeros( rows, cols, type );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
LOGD(method_name);
Size size((int)size_width, (int)size_height);
Mat _retval_ = Mat::zeros( size, type );
-
return (jlong) new Mat(_retval_);
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutS
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutI
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutF
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetS
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetI
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetF
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetD
env->ReleasePrimitiveArrayCritical(vals, values, 0);
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_nGet
}
return res;
} catch(const std::exception &e) {
- throwJavaExceptionD(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionD(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}
JNIEXPORT jstring JNICALL Java_org_opencv_core_Mat_nDump
std::string str = s.str();
return env->NewStringUTF(str.c_str());
} catch(const std::exception &e) {
- throwJavaExceptionE(env, e, method_name);
- return 0;
+ throwJavaException(env, &e, method_name);
} catch (...) {
- throwJavaExceptionE(env, method_name);
- return 0;
+ throwJavaException(env, 0, method_name);
}
+
+ return 0;
}