congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MonitorDevice.getPixelsPerMM
Code IndexAdd Tabnine to your IDE (free)

How to use
getPixelsPerMM
method
in
com.jogamp.newt.MonitorDevice

Best Java code snippets using com.jogamp.newt.MonitorDevice.getPixelsPerMM (Showing top 5 results out of 315)

origin: ch.unibas.cs.gravis/scalismo-native-stub

/**
 * 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>.
 * </p>
 * @param ppmmStore float[2] storage for the ppmm result
 * @return the passed storage containing the ppmm for chaining
 */
public final float[] getPixelsPerMM(final float[] ppmmStore) {
  return getPixelsPerMM(getCurrentMode(), ppmmStore);
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

@Override
public final float[] getPixelsPerMM(final float[] ppmmStore) {
  getMainMonitor().getPixelsPerMM(ppmmStore);
  ppmmStore[0] *= (float)hasPixelScale[0] / (float)nativePixelScale[0];
  ppmmStore[1] *= (float)hasPixelScale[1] / (float)nativePixelScale[1];
  return ppmmStore;
}
origin: org.jogamp.jogl/jogl-all-noawt

/**
 * 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>.
 * </p>
 * @param ppmmStore float[2] storage for the ppmm result
 * @return the passed storage containing the ppmm for chaining
 */
public final float[] getPixelsPerMM(final float[] ppmmStore) {
  return getPixelsPerMM(getCurrentMode(), ppmmStore);
}
origin: org.jogamp.jogl/jogl-all-noawt

@Override
public final float[] getPixelsPerMM(final float[] ppmmStore) {
  getMainMonitor().getPixelsPerMM(ppmmStore);
  ppmmStore[0] *= hasPixelScale[0] / maxPixelScale[0];
  ppmmStore[1] *= hasPixelScale[1] / maxPixelScale[1];
  return ppmmStore;
}
origin: org.jogamp.jogl/jogl-all-noawt

@Override
public void init(final GLAutoDrawable drawable) {
  final MonitorDevice monitor = glWindow.getMainMonitor();
  System.err.println("Main Monitor: "+monitor);
  final float[] pixelPerMM = monitor.getPixelsPerMM(new float[2]);
  System.err.println("    pixel/mm ["+pixelPerMM[0]+", "+pixelPerMM[1]+"]");
  System.err.println("    pixel/in ["+pixelPerMM[0]*25.4f+", "+pixelPerMM[1]*25.4f+"]");
  final GL gl = drawable.getGL();
  System.err.println(JoglVersion.getGLInfo(gl, null));
  System.err.println("Requested: "+drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());
  System.err.println("Chosen   : "+drawable.getChosenGLCapabilities());
  System.err.println("GL impl. class "+gl.getClass().getName());
  if( gl.isGL4ES3() ) {
    final GL4ES3 _gl = gl.getGL4ES3();
    System.err.println("GL4ES3 retrieved, impl. class "+_gl.getClass().getName());
  }
  if( gl.isGL3() ) {
    final GL3 _gl = gl.getGL3();
    System.err.println("GL3 retrieved, impl. class "+_gl.getClass().getName());
  }
  if( gl.isGLES3() ) {
    final GLES3 _gl = gl.getGLES3();
    System.err.println("GLES3 retrieved, impl. class "+_gl.getClass().getName());
  }
  if( gl.isGLES2() ) {
    final GLES2 _gl = gl.getGLES2();
    System.err.println("GLES2 retrieved, impl. class "+_gl.getClass().getName());
  }
}
com.jogamp.newtMonitorDevicegetPixelsPerMM

Javadoc

Returns the pixels per millimeter value according to the given MonitorMode's SurfaceSize#getResolution().

To convert the result to dpi, i.e. dots-per-inch, multiply both components with 25.4f.

Popular methods of MonitorDevice

  • getCurrentMode
    Returns the cached current MonitorMode w/o native query. The returned MonitorMode is element of the
  • getSupportedModes
    Returns a list of immutable MonitorModes supported by this monitor. The list is ordered in descendin
  • setCurrentMode
    Set the current com.jogamp.newt.MonitorMode.This method is lifecycle heavy [Window.html#lifecycleHea
  • getId
  • getOriginalMode
    Returns the immutable original com.jogamp.newt.MonitorMode, as used at NEWT initialization. The retu
  • getSizeMM
  • getViewport
    Returns the RectangleImmutable portion of the rotated virtual Screen size in pixel units represented
  • getViewportInWindowUnits
    Returns the RectangleImmutable portion of the rotated virtual Screen size in window units represente
  • isModeChangedByUs
    Returns true if the MonitorModehas been changed programmatic via this API only, otherwise false. Not
  • isOriginalMode
  • toString
  • unionOfViewports
    Calculates the union of the given monitor's #getViewport() in pixel- and window units.
  • toString,
  • unionOfViewports,
  • getScreen,
  • isClone,
  • isPrimary,
  • queryCurrentMode

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • setScale (BigDecimal)
  • putExtra (Intent)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Notification (javax.management)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now