|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.opengl.util.Gamma
Provides control over the primary display's gamma, brightness and contrast controls via the hardware gamma ramp tables. Not supported on all platforms or graphics hardware.
Thanks to the LWJGL project for illustrating how to access gamma control on the various platforms.
Method Summary | |
static void |
resetDisplayGamma()
Resets the gamma, brightness and contrast values for the primary display to their original values before setDisplayGamma was called the first time. |
static boolean |
setDisplayGamma(float gamma,
float brightness,
float contrast)
Sets the gamma, brightness, and contrast of the current main display. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException
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, use resetDisplayGamma
(). It is recommended to
call resetDisplayGamma
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 calling resetDisplayGamma
will only reset the settings to the values
before the first call to this method.
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)
IllegalArgumentException
- if any of the parameters were
out-of-boundspublic static void resetDisplayGamma()
setDisplayGamma
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |