Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.sun.opengl.util.Gamma
public class Gamma
extends Object
Method Summary | |
static void |
|
static boolean |
|
public static void resetDisplayGamma()
Resets the gamma, brightness and contrast values for the primary display to their original values beforesetDisplayGamma
was called the first time.setDisplayGamma
must be called before calling this method or an unspecified exception will be thrown. While it is not explicitly required that this method be called before exiting, calling it is recommended because of the inevitable unspecified behavior during JVM teardown.
public static boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException
Sets the gamma, brightness, and contrast of the current main display. This functionality is not available on all platforms and graphics hardware. Returns true if the settings were successfully changed, false if not. This method may return false for some values of the incoming arguments even on hardware which does support the underlying functionality. If this method returns true, the display settings will automatically be reset to their original values upon JVM exit (assuming the JVM does not crash); if the user wishes to change the display settings back to normal ahead of time, useresetDisplayGamma
(). It is recommended to callresetDisplayGamma
before calling e.g.System.exit()
from the application rather than rely on the shutdown hook functionality due to inevitable race conditions and unspecified behavior during JVM teardown. This method may be called multiple times during the application's execution, but callingresetDisplayGamma
will only reset the settings to the values before the first call to this method.
- Parameters:
gamma
- The gamma value, typically > 1.0 (default values vary, but typically roughly 1.0)brightness
- The brightness value between -1.0 and 1.0, inclusive (default values vary, but typically 0)contrast
- The contrast, greater than 0.0 (default values vary, but typically 1)
- Returns:
- true if gamma settings were successfully changed, false if not