Simple BCG (Brightness, contrast, gamma) question

Started by riz, April 17, 2010, 17:15:51

Previous topic - Next topic

riz

I am developing a video game in Java using LWJGL and am new to this. What I am implementing at the moment is an in game options GUI which contains 3 sliders for BCG respectively, these can be adjusted by the user and the BCG values are updated accordingly. Users can go in and change the values and then I call the method Display.setDisplayConfiguration(gamma,brightness,contrast) without any problems.

What I want to do though, is that the 3 sliders I have, I want their defaults to be the values of the BCG from the underlying user's platform. I have looked at the code in the LWJGL but these values seem to be set when the Display initialises and they're native. Other methods that use them are marked as private. I am assuming that there is a special reason for this.

Is there a way of retrieving the BCG values from the underlying desktop/system? Any code and pointers most welcome. I have looked at documentation and forums but could not find anything as these assume you will pass in these values to have the BCG set.

Thanks in advance.
Riz

EvilOne

You should expect unadjusted values. That is, all values are the default ones. The initial values are not predictable, as the gamma ramp is just an array of RGB values in the framebuffer, to output values in the DAC. That is, a table with 256 color entries that defines the mapping. There could be any values in the table, so there is no initial value.

Under Windows, you may look at the SetDeviceGammaRap function in the MSDN.

Cheers,
E1.

Brigthess: 0.0
Contrast: 1.0
Gamma: 1.0
If you got a shiny new hammer, every problem looks like a nail!

riz

Thank you Evil One,

Will look into this. You mentioned specifically about the gamma ramp for the gamma values that it is unpredictable what it could be. Does the same case apply for brightness and the contrast too where the value is unpredictable and so the default values are used?

Thanks again
Riz

EvilOne

If you got a shiny new hammer, every problem looks like a nail!