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 --- .../impl/macosx/MacOSXGLDrawableFactory.java | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/classes/com/sun/opengl/impl/macosx') 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(); + } } -- cgit v1.2.3