diff options
author | Kenneth Russel <[email protected]> | 2006-01-22 03:38:03 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-01-22 03:38:03 +0000 |
commit | 72acc211539803f1ef57d4331938afb48600398e (patch) | |
tree | 80d37e7c44d2c9a7bae74fc48434810526c8e80a /src/classes/com/sun/opengl/impl/macosx | |
parent | ae26492c30051eb7c6c883b3c6397390f91afcae (diff) |
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
Diffstat (limited to 'src/classes/com/sun/opengl/impl/macosx')
-rw-r--r-- | src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java index b05886e15..fbc52e850 100644 --- a/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java @@ -42,8 +42,8 @@ package com.sun.opengl.impl.macosx; import java.awt.Component; import java.awt.EventQueue; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; +import java.nio.*; +import java.util.*; import javax.media.opengl.*; import com.sun.opengl.impl.*; @@ -136,4 +136,31 @@ public class MacOSXGLDrawableFactory extends GLDrawableFactoryImpl { public void unlockAWTForJava2D() { } + + //------------------------------------------------------ + // Gamma-related functionality + // + + private static final int GAMMA_RAMP_LENGTH = 256; + + /** Returns the length of the computed gamma ramp for this OS and + hardware. Returns 0 if gamma changes are not supported. */ + protected int getGammaRampLength() { + return GAMMA_RAMP_LENGTH; + } + + protected boolean setGammaRamp(float[] ramp) { + return CGL.setGammaRamp(ramp.length, + ramp, 0, + ramp, 0, + ramp, 0); + } + + protected Buffer getGammaRamp() { + return null; + } + + protected void resetGammaRamp(Buffer originalGammaRamp) { + CGL.resetGammaRamp(); + } } |