com.sun.opengl.util

Class Gamma


public class Gamma
extends Object

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.

Method Details

resetDisplayGamma

public 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. 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.

setDisplayGamma

public static boolean setDisplayGamma(float gamma,
                                      float brightness,
                                      float contrast)
            throws IllegalArgumentException
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

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.