Path: blob/master/modules/java/generator/src/cpp/opencv_java.hpp
16354 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html34// Author: abratchik56#undef LOGE7#undef LOGD8#ifdef __ANDROID__9# include <android/log.h>10# define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))11# ifdef DEBUG12# define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))13# else14# define LOGD(...)15# endif16#else17# define LOGE(...)18# define LOGD(...)19#endif2021#ifndef OPENCV_JAVA_HPP22#define OPENCV_JAVA_HPP2324#define MATOFINT(ENV) static_cast<jclass>(ENV->NewGlobalRef(ENV->FindClass("org/opencv/core/MatOfInt")))25#define GETNATIVEOBJ(ENV, CLS, MAT) ENV->GetLongField(MAT, ENV->GetFieldID(CLS, "nativeObj", "J"))2627#define CONSTRUCTOR(ENV, CLS) ENV->GetMethodID(CLS, "<init>", "(I)V")2829#define ARRAYLIST(ENV) static_cast<jclass>(ENV->NewGlobalRef(ENV->FindClass("java/util/ArrayList")))30#define LIST_ADD(ENV, LIST) ENV->GetMethodID(LIST, "add", "(Ljava/lang/Object;)Z")31#define LIST_GET(ENV, LIST) ENV->GetMethodID(LIST, "get", "(I)Ljava/lang/Object;")32#define LIST_SIZE(ENV, LIST) ENV->GetMethodID(LIST, "size", "()I")33#define LIST_CLEAR(ENV, LIST) ENV->GetMethodID(LIST, "clear", "()V")3435#define CHECK_MAT(cond) if(!(cond)){ LOGD("FAILED: " #cond); return; }3637#endif // OPENCV_JAVA_HPP383940