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<ScreenMode> filterByBpp(List<ScreenMode> screenModes, int bitsPerPixel)
           
static List<ScreenMode> filterByRate(List<ScreenMode> screenModes, int refreshRate)
           
static List<ScreenMode> filterByResolution(List<ScreenMode> screenModes, DimensionImmutable resolution)
           
static List<ScreenMode> filterByRotation(List<ScreenMode> screenModes, int rotation)
           
static List<ScreenMode> filterBySurfaceSize(List<ScreenMode> screenModes, SurfaceSize surfaceSize)
           
static List<ScreenMode> getHighestAvailableBpp(List<ScreenMode> screenModes)
           
static List<ScreenMode> getHighestAvailableRate(List<ScreenMode> screenModes)
           
static int getIndex(List<ScreenMode> screenModes, ScreenMode search)
           
static int getIndexByHashCode(List<ScreenMode> screenModes, ScreenMode search)
           
static int streamIn(com.jogamp.common.util.ArrayHashSet<DimensionImmutable> resolutionPool, com.jogamp.common.util.ArrayHashSet<SurfaceSize> surfaceSizePool, com.jogamp.common.util.ArrayHashSet<DimensionImmutable> screenSizeMMPool, com.jogamp.common.util.ArrayHashSet<MonitorMode> monitorModePool, com.jogamp.common.util.ArrayHashSet<ScreenMode> 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, DimensionImmutable screenSizeMM, int[] monitorProperties, int offset)
          WARNING: must be synchronized with ScreenMode.h, native implementation
static DimensionImmutable 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(DimensionImmutable 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<ScreenMode> screenModes,
                           ScreenMode search)

getIndexByHashCode

public static int getIndexByHashCode(List<ScreenMode> screenModes,
                                     ScreenMode search)

filterByResolution

public static List<ScreenMode> filterByResolution(List<ScreenMode> screenModes,
                                                  DimensionImmutable resolution)
Parameters:
screenModes -
resolution -
Returns:
modes with nearest resolution, or matching ones

filterBySurfaceSize

public static List<ScreenMode> filterBySurfaceSize(List<ScreenMode> screenModes,
                                                   SurfaceSize surfaceSize)

filterByRotation

public static List<ScreenMode> filterByRotation(List<ScreenMode> screenModes,
                                                int rotation)

filterByBpp

public static List<ScreenMode> filterByBpp(List<ScreenMode> screenModes,
                                           int bitsPerPixel)

filterByRate

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

getHighestAvailableBpp

public static List<ScreenMode> getHighestAvailableBpp(List<ScreenMode> screenModes)

getHighestAvailableRate

public static List<ScreenMode> getHighestAvailableRate(List<ScreenMode> screenModes)

streamInResolution

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


streamInSurfaceSize

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


streamInMonitorMode

public static MonitorMode streamInMonitorMode(SurfaceSize surfaceSize,
                                              DimensionImmutable 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:
ScreenMode element matching the input modeProperties, or null if input could not be processed.

streamIn

public static int streamIn(com.jogamp.common.util.ArrayHashSet<DimensionImmutable> resolutionPool,
                           com.jogamp.common.util.ArrayHashSet<SurfaceSize> surfaceSizePool,
                           com.jogamp.common.util.ArrayHashSet<DimensionImmutable> screenSizeMMPool,
                           com.jogamp.common.util.ArrayHashSet<MonitorMode> monitorModePool,
                           com.jogamp.common.util.ArrayHashSet<ScreenMode> screenModePool,
                           int[] modeProperties,
                           int offset)
WARNING: must be synchronized with ScreenMode.h, native implementation

Parameters:
resolutionPool - hash array of unique 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.