aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-09 05:31:04 +0100
committerSven Gothel <[email protected]>2023-03-09 05:31:04 +0100
commit4cc2787766d1d692c668d0cabd9f4619de396f72 (patch)
tree416e827adb382850325f5c9cb05a6448a9341b01 /src/newt
parent0571fafebee846b77de5740d23fc141810897f84 (diff)
Misc: Add MonitorDevice.perMMToPerInch(..); Drop unused RegionRenderer.init(..) renderModes argument
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/MonitorDevice.java15
-rw-r--r--src/newt/classes/com/jogamp/newt/Window.java1
2 files changed, 14 insertions, 2 deletions
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 <i>pixels per millimeter</i> value according to the <i>current</i> {@link MonitorMode mode}'s
* {@link SurfaceSize#getResolution() surface resolution}.
* <p>
- * To convert the result to <i>dpi</i>, i.e. dots-per-inch, multiply both components with <code>25.4f</code>.
+ * To convert the result to <i>dpi</i>, i.e. dots-per-inch, multiply both components with <code>25.4f</code>,
+ * see {@link #perMMToPerInch(float[])}.
* </p>
* @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);
@@ -258,6 +260,17 @@ public abstract class MonitorDevice {
}
/**
+ * 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.
* <p>
* The returned {@link MonitorMode} is element of the lists {@link #getSupportedModes()} and {@link Screen#getMonitorModes()}.
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;