From 4cc2787766d1d692c668d0cabd9f4619de396f72 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 9 Mar 2023 05:31:04 +0100 Subject: Misc: Add MonitorDevice.perMMToPerInch(..); Drop unused RegionRenderer.init(..) renderModes argument --- src/newt/classes/com/jogamp/newt/MonitorDevice.java | 15 ++++++++++++++- src/newt/classes/com/jogamp/newt/Window.java | 1 - 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/newt/classes/com') diff --git a/src/newt/classes/com/jogamp/newt/MonitorDevice.java b/src/newt/classes/com/jogamp/newt/MonitorDevice.java index 9ad194ce8..f7d08686e 100644 --- a/src/newt/classes/com/jogamp/newt/MonitorDevice.java +++ b/src/newt/classes/com/jogamp/newt/MonitorDevice.java @@ -230,10 +230,12 @@ public abstract class MonitorDevice { * Returns the pixels per millimeter value according to the current {@link MonitorMode mode}'s * {@link SurfaceSize#getResolution() surface resolution}. *

- * To convert the result to dpi, i.e. dots-per-inch, multiply both components with 25.4f. + * To convert the result to dpi, i.e. dots-per-inch, multiply both components with 25.4f, + * see {@link #perMMToPerInch(float[])}. *

* @param ppmmStore float[2] storage for the ppmm result * @return the passed storage containing the ppmm for chaining + * @see #perMMToPerInch(float[]) */ public final float[] getPixelsPerMM(final float[] ppmmStore) { return getPixelsPerMM(getCurrentMode(), ppmmStore); @@ -257,6 +259,17 @@ public abstract class MonitorDevice { return ppmmStore; } + /** + * Converts [1/mm] to [1/inch] in place + * @param ppmm float[2] [1/mm] value + * @return return [1/inch] value + */ + public static float[/*2*/] perMMToPerInch(final float[/*2*/] ppmm) { + ppmm[0] *= 25.4f; + ppmm[1] *= 25.4f; + return ppmm; + } + /** * Returns the immutable original {@link com.jogamp.newt.MonitorMode}, as used at NEWT initialization. *

diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index 5134708c4..3a84bd79c 100644 --- a/src/newt/classes/com/jogamp/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -47,7 +47,6 @@ import com.jogamp.nativewindow.CapabilitiesImmutable; import com.jogamp.nativewindow.NativeWindow; import com.jogamp.nativewindow.ScalableSurface; import com.jogamp.nativewindow.WindowClosingProtocol; -import com.jogamp.nativewindow.util.Rectangle; import com.jogamp.nativewindow.util.RectangleImmutable; import com.jogamp.nativewindow.util.SurfaceSize; -- cgit v1.2.3