File: color_table.py

package info (click to toggle)
pyopengl 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,184 kB
  • ctags: 21,473
  • sloc: python: 80,468; makefile: 4
file content (57 lines) | stat: -rw-r--r-- 2,533 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'''OpenGL extension SGI.color_table

This module customises the behaviour of the 
OpenGL.raw.GL.SGI.color_table to provide a more 
Python-friendly API

Overview (from the spec)
	
	This extension defines a new RGBA-format color lookup mechanism.  It does
	not replace the color lookups defined by the GL Specification, but rather
	provides additional lookup capabilities with different operation.  The key
	difference is that the new lookup tables are treated as 1-dimensional images
	with internal formats, like texture images and convolution filter images.
	From this follows the fact that the new tables can operate on a subset of
	the components of passing pixel groups.  For example, a table with internal
	format ALPHA modifies only the A component of each pixel group, leaving the
	R, G, and B components unmodified.
	
	If EXT_copy_texture is implemented, this extension also defines methods to
	initialize the color lookup tables from the framebuffer, in addition to the
	standard memory source mechanisms.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/SGI/color_table.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.SGI.color_table import *
from OpenGL.raw.GL.SGI.color_table import _EXTENSION_NAME

def glInitColorTableSGI():
    '''Return boolean indicating whether this extension is available'''
    from OpenGL import extensions
    return extensions.hasGLExtension( _EXTENSION_NAME )

# INPUT glColorTableSGI.table size not checked against 'format,type,width'
glColorTableSGI=wrapper.wrapper(glColorTableSGI).setInputArraySize(
    'table', None
)
# INPUT glColorTableParameterfvSGI.params size not checked against 'pname'
glColorTableParameterfvSGI=wrapper.wrapper(glColorTableParameterfvSGI).setInputArraySize(
    'params', None
)
# INPUT glColorTableParameterivSGI.params size not checked against 'pname'
glColorTableParameterivSGI=wrapper.wrapper(glColorTableParameterivSGI).setInputArraySize(
    'params', None
)
# OUTPUT glGetColorTableSGI.table COMPSIZE(target,format,type) 
glGetColorTableParameterfvSGI=wrapper.wrapper(glGetColorTableParameterfvSGI).setOutput(
    'params',size=_glgets._glget_size_mapping,pnameArg='pname',orPassIn=True
)
glGetColorTableParameterivSGI=wrapper.wrapper(glGetColorTableParameterivSGI).setOutput(
    'params',size=_glgets._glget_size_mapping,pnameArg='pname',orPassIn=True
)
### END AUTOGENERATED SECTION