diff options
Diffstat (limited to 'platform/java')
-rw-r--r-- | platform/java/mupdf_native.c | 28 | ||||
-rw-r--r-- | platform/java/mupdf_native.h | 16 | ||||
-rw-r--r-- | platform/java/src/com/artifex/mupdf/fitz/Pixmap.java | 2 |
3 files changed, 46 insertions, 0 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 8af0b8a4..8d811afe 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -3816,6 +3816,34 @@ FUN(Pixmap_getYResolution)(JNIEnv *env, jobject self) return pixmap ? pixmap->yres : 0; } +JNIEXPORT void JNICALL +FUN(Pixmap_invert)(JNIEnv *env, jobject self) +{ + fz_context *ctx = get_context(env); + fz_pixmap *pixmap = from_Pixmap(env, self); + + if (!ctx || !pixmap) return; + + fz_try(ctx) + fz_invert_pixmap(ctx, pixmap); + fz_catch(ctx) + jni_rethrow(env, ctx); +} + +JNIEXPORT void JNICALL +FUN(Pixmap_gamma)(JNIEnv *env, jobject self, jfloat gamma) +{ + fz_context *ctx = get_context(env); + fz_pixmap *pixmap = from_Pixmap(env, self); + + if (!ctx || !pixmap) return; + + fz_try(ctx) + fz_gamma_pixmap(ctx, pixmap, gamma); + fz_catch(ctx) + jni_rethrow(env, ctx); +} + /* Path Interface */ JNIEXPORT void JNICALL diff --git a/platform/java/mupdf_native.h b/platform/java/mupdf_native.h index 36807a0a..22fdc04a 100644 --- a/platform/java/mupdf_native.h +++ b/platform/java/mupdf_native.h @@ -2865,6 +2865,22 @@ JNIEXPORT jint JNICALL Java_com_artifex_mupdf_fitz_Pixmap_getXResolution JNIEXPORT jint JNICALL Java_com_artifex_mupdf_fitz_Pixmap_getYResolution (JNIEnv *, jobject); +/* + * Class: com_artifex_mupdf_fitz_Pixmap + * Method: invert + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Pixmap_invert + (JNIEnv *, jobject); + +/* + * Class: com_artifex_mupdf_fitz_Pixmap + * Method: gamma + * Signature: (F)V + */ +JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Pixmap_gamma + (JNIEnv *, jobject, jfloat); + #ifdef __cplusplus } #endif diff --git a/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java b/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java index 1616b90b..5c3552e0 100644 --- a/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java +++ b/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java @@ -66,6 +66,8 @@ public class Pixmap public native int[] getPixels(); /* only valid for RGBA or BGRA pixmaps */ public native int getXResolution(); public native int getYResolution(); + public native void invert(); + public native void gamma(float gamma); public Rect getBounds() { int x = getX(); |