com.jogamp.newt.util
Class ScreenModeUtil

java.lang.Object
  extended by com.jogamp.newt.util.ScreenModeUtil

public class ScreenModeUtil
extends Object

Convenient ScreenMode utility methods, filters etc.


Field Summary
static int NUM_MONITOR_MODE_PROPERTIES
          WARNING: must be synchronized with ScreenMode.h, native implementation 3: ScreenSizeMM[width, height], refresh-rate
static int NUM_RESOLUTION_PROPERTIES
          WARNING: must be synchronized with ScreenMode.h, native implementation 2: width and height
static int NUM_SCREEN_MODE_PROPERTIES
          WARNING: must be synchronized with ScreenMode.h, native implementation 1: rotation, native_mode_id
static int NUM_SCREEN_MODE_PROPERTIES_ALL
          WARNING: must be synchronized with ScreenMode.h, native implementation count + all the above
static int NUM_SURFACE_SIZE_PROPERTIES
          WARNING: must be synchronized with ScreenMode.h, native implementation 1: bpp
 
Constructor Summary
ScreenModeUtil()
           
 
Method Summary
static List filterByBpp(List screenModes, int bitsPerPixel)
           
static List filterByRate(List screenModes, int refreshRate)
           
static List filterByResolution(List screenModes, DimensionReadOnly resolution)
           
static List filterByRotation(List screenModes, int rotation)
           
static List filterBySurfaceSize(List screenModes, SurfaceSize surfaceSize)
           
static List getHighestAvailableBpp(List screenModes)
           
static List getHighestAvailableRate(List screenModes)
           
static int getIndex(List screenModes, ScreenMode search)
           
static int getIndexByHashCode(List screenModes, ScreenMode search)
           
static int streamIn(ArrayHashSet resolutionPool, ArrayHashSet surfaceSizePool, ArrayHashSet screenSizeMMPool, ArrayHashSet monitorModePool, ArrayHashSet screenModePool, int[] modeProperties, int offset)
          WARNING: must be synchronized with ScreenMode.h, native implementation
static ScreenMode streamIn(int[] modeProperties, int offset)
          WARNING: must be synchronized with ScreenMode.h, native implementation
static MonitorMode streamInMonitorMode(SurfaceSize surfaceSize, DimensionReadOnly screenSizeMM, int[] monitorProperties, int offset)
          WARNING: must be synchronized with ScreenMode.h, native implementation
static DimensionReadOnly streamInResolution(int[] resolutionProperties, int offset)
          WARNING: must be synchronized with ScreenMode.h, native implementation
static ScreenMode streamInScreenMode(MonitorMode monitorMode, int[] modeProperties, int offset)
          WARNING: must be synchronized with ScreenMode.h, native implementation
static SurfaceSize streamInSurfaceSize(DimensionReadOnly resolution, int[] sizeProperties, int offset)
          WARNING: must be synchronized with ScreenMode.h, native implementation
static int[] streamOut(ScreenMode screenMode)
          WARNING: must be synchronized with ScreenMode.h, native implementation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_RESOLUTION_PROPERTIES

public static final int NUM_RESOLUTION_PROPERTIES
WARNING: must be synchronized with ScreenMode.h, native implementation 2: width and height

See Also:
Constant Field Values

NUM_SURFACE_SIZE_PROPERTIES

public static final int NUM_SURFACE_SIZE_PROPERTIES
WARNING: must be synchronized with ScreenMode.h, native implementation 1: bpp

See Also:
Constant Field Values

NUM_MONITOR_MODE_PROPERTIES

public static final int NUM_MONITOR_MODE_PROPERTIES
WARNING: must be synchronized with ScreenMode.h, native implementation 3: ScreenSizeMM[width, height], refresh-rate

See Also:
Constant Field Values

NUM_SCREEN_MODE_PROPERTIES

public static final int NUM_SCREEN_MODE_PROPERTIES
WARNING: must be synchronized with ScreenMode.h, native implementation 1: rotation, native_mode_id

See Also:
Constant Field Values

NUM_SCREEN_MODE_PROPERTIES_ALL

public static final int NUM_SCREEN_MODE_PROPERTIES_ALL
WARNING: must be synchronized with ScreenMode.h, native implementation count + all the above

See Also:
Constant Field Values
Constructor Detail

ScreenModeUtil

public ScreenModeUtil()
Method Detail

getIndex

public static int getIndex(List screenModes,
                           ScreenMode search)

getIndexByHashCode

public static int getIndexByHashCode(List screenModes,
                                     ScreenMode search)

filterByResolution

public static List filterByResolution(List screenModes,
                                      DimensionReadOnly resolution)
Parameters:
screenModes -
resolution -
Returns:
modes with nearest resolution, or matching ones

filterBySurfaceSize

public static List filterBySurfaceSize(List screenModes,
                                       SurfaceSize surfaceSize)

filterByRotation

public static List filterByRotation(List screenModes,
                                    int rotation)

filterByBpp

public static List filterByBpp(List screenModes,
                               int bitsPerPixel)

filterByRate

public static List filterByRate(List screenModes,
                                int refreshRate)
Parameters:
screenModes -
refreshRate -
Returns:
modes with nearest refreshRate, or matching ones

getHighestAvailableBpp

public static List getHighestAvailableBpp(List screenModes)

getHighestAvailableRate

public static List getHighestAvailableRate(List screenModes)

streamInResolution

public static DimensionReadOnly streamInResolution(int[] resolutionProperties,
                                                   int offset)
WARNING: must be synchronized with ScreenMode.h, native implementation


streamInSurfaceSize

public static SurfaceSize streamInSurfaceSize(DimensionReadOnly resolution,
                                              int[] sizeProperties,
                                              int offset)
WARNING: must be synchronized with ScreenMode.h, native implementation


streamInMonitorMode

public static MonitorMode streamInMonitorMode(SurfaceSize surfaceSize,
                                              DimensionReadOnly screenSizeMM,
                                              int[] monitorProperties,
                                              int offset)
WARNING: must be synchronized with ScreenMode.h, native implementation


streamInScreenMode

public static ScreenMode streamInScreenMode(MonitorMode monitorMode,
                                            int[] modeProperties,
                                            int offset)
WARNING: must be synchronized with ScreenMode.h, native implementation


streamIn

public static ScreenMode streamIn(int[] modeProperties,
                                  int offset)
WARNING: must be synchronized with ScreenMode.h, native implementation

Parameters:
modeProperties - the input data
offset - the offset to the input data
Returns:
index of the identical (old or new) ScreenMode element in screenModePool, matching the input modeProperties, or -1 if input could not be processed.

streamIn

public static int streamIn(ArrayHashSet resolutionPool,
                           ArrayHashSet surfaceSizePool,
                           ArrayHashSet screenSizeMMPool,
                           ArrayHashSet monitorModePool,
                           ArrayHashSet screenModePool,
                           int[] modeProperties,
                           int offset)
WARNING: must be synchronized with ScreenMode.h, native implementation

Parameters:
resolutionPool - hash array of unique DimensionReadOnly resolutions, no duplicates
surfaceSizePool - hash array of unique SurfaceSize, no duplicates
monitorModePool - hash array of unique MonitorMode, no duplicates
screenModePool - hash array of unique ScreenMode, no duplicates
modeProperties - the input data
offset - the offset to the input data
Returns:
index of the identical (old or new) ScreenMode element in screenModePool, matching the input modeProperties, or -1 if input could not be processed.

streamOut

public static int[] streamOut(ScreenMode screenMode)
WARNING: must be synchronized with ScreenMode.h, native implementation



Copyright 2010 JogAmp Community.