org.opencv.utils renamed to org.opencv.android

pull/13383/head
Andrey Pavlenko 14 years ago
parent bc9a9b714c
commit 7ca50b2b3d
  1. 8
      modules/java/src/cpp/android.cpp
  2. 2
      modules/java/src/java/android.java
  3. 4
      samples/android/1-java/src/org/opencv/samples/s1/Sample1View.java
  4. 4
      samples/android/4-mixed/src/org/opencv/samples/s4/Sample4View.java

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

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

@ -16,7 +16,7 @@ import org.opencv.Scalar;
import org.opencv.Size; import org.opencv.Size;
import org.opencv.core; import org.opencv.core;
import org.opencv.imgproc; import org.opencv.imgproc;
import org.opencv.utils; import org.opencv.android;
import java.util.List; import java.util.List;
@ -163,7 +163,7 @@ class Sample1View extends SurfaceView implements SurfaceHolder.Callback, Runnabl
} }
Bitmap bmp = Bitmap.createBitmap(mFrameWidth, mFrameHeight, Bitmap.Config.ARGB_8888); Bitmap bmp = Bitmap.createBitmap(mFrameWidth, mFrameHeight, Bitmap.Config.ARGB_8888);
utils.MatToBitmap(mRgba, bmp); android.MatToBitmap(mRgba, bmp);
Canvas canvas = mHolder.lockCanvas(); Canvas canvas = mHolder.lockCanvas();
canvas.drawBitmap(bmp, (canvas.getWidth()-mFrameWidth)/2, (canvas.getHeight()-mFrameHeight)/2, null); canvas.drawBitmap(bmp, (canvas.getWidth()-mFrameWidth)/2, (canvas.getHeight()-mFrameHeight)/2, null);

@ -14,7 +14,7 @@ import org.opencv.Mat;
import org.opencv.Size; import org.opencv.Size;
import org.opencv.core; import org.opencv.core;
import org.opencv.imgproc; import org.opencv.imgproc;
import org.opencv.utils; import org.opencv.android;
import java.util.List; import java.util.List;
@ -164,7 +164,7 @@ class Sample4View extends SurfaceView implements SurfaceHolder.Callback, Runnabl
} }
Bitmap bmp = Bitmap.createBitmap(mFrameWidth, mFrameHeight, Bitmap.Config.ARGB_8888); Bitmap bmp = Bitmap.createBitmap(mFrameWidth, mFrameHeight, Bitmap.Config.ARGB_8888);
utils.MatToBitmap(mRgba, bmp); android.MatToBitmap(mRgba, bmp);
Canvas canvas = mHolder.lockCanvas(); Canvas canvas = mHolder.lockCanvas();
canvas.drawBitmap(bmp, (canvas.getWidth()-mFrameWidth)/2, (canvas.getHeight()-mFrameHeight)/2, null); canvas.drawBitmap(bmp, (canvas.getWidth()-mFrameWidth)/2, (canvas.getHeight()-mFrameHeight)/2, null);

Loading…
Cancel
Save