[gs-commits] mupdf 1.16.1.17 jni: Add interfaces to support inverting

[email protected] (Tor Andersson)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit 7f21c9bed459a0736a9c94dfd1e0d17f75871a1c
Author: Sebastian Rasmussen <[email protected]>
Date:   Tue Aug 20 20:33:36 2019 +0200

    jni: Add interfaces to support inverting pixmap luminance.

diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 54d019e..2f199ee 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -4140,6 +4140,20 @@ FUN(Pixmap_invert)(JNIEnv *env, jobject self)
 }
 
 JNIEXPORT void JNICALL
+FUN(Pixmap_invertLuminance)(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_luminance(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);
diff --git a/platform/java/mupdf_native.h b/platform/java/mupdf_native.h
index ba990d8..0ccba08 100644
--- a/platform/java/mupdf_native.h
+++ b/platform/java/mupdf_native.h
@@ -3112,6 +3112,14 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Pixmap_invert
 
 /*
  * Class:     com_artifex_mupdf_fitz_Pixmap
+ * Method:    invertLuminance
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Pixmap_invertLuminance
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_artifex_mupdf_fitz_Pixmap
  * Method:    gamma
  * Signature: (F)V
  */
diff --git a/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java b/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java
index 5c3552e..80e49ec 100644
--- a/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java
+++ b/platform/java/src/com/artifex/mupdf/fitz/Pixmap.java
@@ -67,6 +67,7 @@ public class Pixmap
 	public native int getXResolution();
 	public native int getYResolution();
 	public native void invert();
+	public native void invertLuminance();
 	public native void gamma(float gamma);
 
 	public Rect getBounds() {

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=7f21c9bed459a0736a9c94dfd1e0d17f75871a1c

--
MuPDF library
Artifex Software, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.