diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-11-02 01:01:36 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-11-02 01:02:45 +0800 |
commit | 1db2d649f316fb6b202b2761c1fe085ea54c0577 (patch) | |
tree | 80dc28c6fbeb1f69b7905534fcd8155d98af00c8 /platform | |
parent | a605a0efb83fb3bec8983752c2fe000785746f74 (diff) | |
download | mupdf-1db2d649f316fb6b202b2761c1fe085ea54c0577.tar.xz |
jni: Add AndroidImage, using Android Bitmaps to create Images.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/java/mupdf_native.c | 2 | ||||
-rw-r--r-- | platform/java/src/com/artifex/mupdf/fitz/android/AndroidImage.java | 16 |
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); + } +} |