From 72acc211539803f1ef57d4331938afb48600398e Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 22 Jan 2006 03:38:03 +0000 Subject: Fixed Issue 173: Adjust gamma, brightness and contrast Added com.sun.opengl.util.Gamma supporting adjusting of gamma, brightness, and contrast. API and implementation derived from code in the LWJGL project. Added demos.gamma.TestGamma demo illustrating how to use the APIs. Tested on Linux, Mac OS X and Windows. No Solaris support at this time, although future Solaris releases, being based on the Xorg server, will probably have support for the required XF86VidMode extension. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@557 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/native/jogl/MacOSXWindowSystemInterface.m | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/native/jogl/MacOSXWindowSystemInterface.m') diff --git a/src/native/jogl/MacOSXWindowSystemInterface.m b/src/native/jogl/MacOSXWindowSystemInterface.m index d644fb80a..4365917ff 100644 --- a/src/native/jogl/MacOSXWindowSystemInterface.m +++ b/src/native/jogl/MacOSXWindowSystemInterface.m @@ -379,3 +379,12 @@ void setSwapInterval(void* context, int interval) { long swapInterval = interval; [nsContext setValues: &swapInterval forParameter: NSOpenGLCPSwapInterval]; } + +Bool setGammaRamp(int tableSize, float* redRamp, float* greenRamp, float* blueRamp) { + CGDisplayErr err = CGSetDisplayTransferByTable(kCGDirectMainDisplay, tableSize, redRamp, greenRamp, blueRamp); + return (err == CGDisplayNoErr); +} + +void resetGammaRamp() { + CGDisplayRestoreColorSyncSettings(); +} -- cgit v1.2.3