Package psychopy :: Module gamma
[frames] | no frames]

Module gamma

source code

Functions
 
setGamma(pygletWindow=None, newGamma=1.0, rampType=None) source code
 
setGammaRamp(pygletWindow, newRamp)
Sets the hardware look-up table, using platform-specific ctypes functions.
source code
 
getGammaRamp(pygletWindow)
Ramp will be returned as 3x256 array in range 0:1
source code
 
createLinearRamp(win, rampType=None)
Generate the Nx3 values for a linear gamma ramp on the current platform.
source code
Variables
  carbon = <CDLL '/System/Library/Carbon.framework/Carbon', hand...
  xf86vm = ctypes.CDLL(ctypes.util.find_library('Xxf86vm'))
Function Details

setGammaRamp(pygletWindow, newRamp)

source code 
Sets the hardware look-up table, using platform-specific ctypes functions. For use with pyglet windows only (pygame has its ow routines for this). Ramp should be provided as 3x256 or 3x1024 array in range 0:1.0

createLinearRamp(win, rampType=None)

source code 
Generate the Nx3 values for a linear gamma ramp on the current platform.
This uses heuristics about known graphics cards to guess the 'rampType' if 
none is exlicitly given.

Much of this work is ported from LoadIdentityClut.m, written by Mario Kleiner
for the psychtoolbox

rampType 0 : an 8-bit CLUT ranging 0:1
    This is seems correct for most windows machines and older OS X systems
    Known to be used by:
        OSX 10.4.9 PPC with GeForceFX-5200
    
rampType 1 : an 8-bit CLUT ranging (1/256.0):1
    For some reason a number of macs then had a CLUT that (erroneously?) started with 1/256 rather than 0
    Known to be used by:
        OSX 10.4.9 with ATI Mobility Radeon X1600
        OSX 10.5.8 with ATI Radeon HD-2600
        maybe all ATI cards?

rampType 2 : a 10-bit CLUT ranging 0:(1023/1024)
    A slightly odd 10-bit CLUT that doesn't quite finish on 1.0!
    Known to be used by:
        OSX 10.5.8 with Geforce-9200M (MacMini)
        OSX 10.5.8 with Geforce-8800

rampType 3 : a nasty, bug-fixing 10bit CLUT for crumby OS X drivers
    Craziest of them all for Snow leopard. Like rampType 2, except that the upper half of the table has 1/256.0 removed?!!
    Known to be used by:
        OSX 10.6.0 with NVidia Geforce-9200M


Variables Details

carbon

Value:
<CDLL '/System/Library/Carbon.framework/Carbon', handle 524a40 at 1a56\
2810>