classes/files renaming, some code refactoring

This commit is contained in:
Andrey Pavlenko
2011-07-22 12:35:52 +00:00
parent b700521b95
commit 2bc9bca349
6 changed files with 57 additions and 47 deletions

View File

@@ -9,12 +9,12 @@ extern "C" {
#endif
/*
* Class: org_opencv_android
* Class: org_opencv_Android
* Method: nBitmapToMat(Bitmap b)
* Signature: (L)J
*/
JNIEXPORT jlong JNICALL Java_org_opencv_android_nBitmapToMat
JNIEXPORT jlong JNICALL Java_org_opencv_Android_nBitmapToMat
(JNIEnv * env, jclass cls, jobject bitmap)
{
AndroidBitmapInfo info;
@@ -40,11 +40,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_android_nBitmapToMat
}
/*
* Class: org_opencv_android
* Class: org_opencv_Android
* Method: nBitmapToMat(long m, Bitmap b)
* Signature: (JL)Z
*/
JNIEXPORT jboolean JNICALL Java_org_opencv_android_nMatToBitmap
JNIEXPORT jboolean JNICALL Java_org_opencv_Android_nMatToBitmap
(JNIEnv * env, jclass cls, jlong m, jobject bitmap)
{
AndroidBitmapInfo info;

View File

@@ -1,8 +1,8 @@
#include "utils.h"
#include "converters.h"
#ifdef DEBUG
#include <android/log.h>
#define MODULE_LOG_TAG "OpenCV.utils.cpp"
#define MODULE_LOG_TAG "OpenCV.converters"
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, MODULE_LOG_TAG, __VA_ARGS__))
#else //DEBUG
#define LOGD(...)

View File

@@ -3,7 +3,7 @@ package org.opencv;
import org.opencv.core.Mat;
import android.graphics.Bitmap;
public class android {
public class Android {
public static Mat BitmapToMat(Bitmap b) {
return new Mat( nBitmapToMat(b) );

View File

@@ -8,13 +8,13 @@ import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.features2d.KeyPoint;
public class utils {
public class Converters {
public static Mat vector_Point_to_Mat(List<Point> pts) {
Mat res;
int count = (pts!=null) ? pts.size() : 0;
if(count>0){
res = new Mat(1, count, CvType.CV_32SC2); //Point can be saved into double[2]
res = new Mat(1, count, CvType.CV_32SC2);
int[] buff = new int[count*2];
for(int i=0; i<count; i++) {
Point p = pts.get(i);