summaryrefslogtreecommitdiff
path: root/platform/java
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-11-02 01:01:36 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-11-02 01:02:45 +0800
commit1db2d649f316fb6b202b2761c1fe085ea54c0577 (patch)
tree80dc28c6fbeb1f69b7905534fcd8155d98af00c8 /platform/java
parenta605a0efb83fb3bec8983752c2fe000785746f74 (diff)
downloadmupdf-1db2d649f316fb6b202b2761c1fe085ea54c0577.tar.xz
jni: Add AndroidImage, using Android Bitmaps to create Images.
Diffstat (limited to 'platform/java')
-rw-r--r--platform/java/mupdf_native.c2
-rw-r--r--platform/java/src/com/artifex/mupdf/fitz/android/AndroidImage.java16
2 files changed, 17 insertions, 1 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 6cf6716a..96cc89cb 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -2660,7 +2660,7 @@ FUN(android_AndroidDrawDevice_newNative)(JNIEnv *env, jclass self, jobject jbitm
}
JNIEXPORT jlong JNICALL
-FUN(Image_newImageFromBitmap)(JNIEnv *env, jobject self, jobject jbitmap, jlong jmask)
+FUN(AndroidImage_newImageFromBitmap)(JNIEnv *env, jobject self, jobject jbitmap, jlong jmask)
{
fz_context *ctx = get_context(env);
fz_image *mask = CAST(fz_image *, jmask);
diff --git a/platform/java/src/com/artifex/mupdf/fitz/android/AndroidImage.java b/platform/java/src/com/artifex/mupdf/fitz/android/AndroidImage.java
new file mode 100644
index 00000000..3a6ebb99
--- /dev/null
+++ b/platform/java/src/com/artifex/mupdf/fitz/android/AndroidImage.java
@@ -0,0 +1,16 @@
+package com.artifex.mupdf.fitz.android;
+
+import android.graphics.Bitmap;
+
+import com.artifex.mupdf.fitz.Image;
+
+public final class AndroidImage extends Image
+{
+ private native long newAndroidImageFromBitmap(Bitmap bitmap, long mask);
+
+ public AndroidImage(Bitmap bitmap, AndroidImage mask)
+ {
+ super(0);
+ pointer = newAndroidImageFromBitmap(bitmap, mask.pointer);
+ }
+}