File: texture_shared_exponent.py

package info (click to toggle)
pyopengl 3.1.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,668 kB
  • sloc: python: 108,024; makefile: 4
file content (45 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download | duplicates (15)
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
'''OpenGL extension EXT.texture_shared_exponent

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

Overview (from the spec)
	
	Existing texture formats provide either fixed-point formats with
	limited range and precision but with compact encodings (allowing 32
	or fewer bits per multi-component texel), or floating-point formats
	with tremendous range and precision but without compact encodings
	(typically 16 or 32 bits per component).
	
	This extension adds a new packed format and new internal texture
	format for encoding 3-component vectors (typically RGB colors) with
	a single 5-bit exponent (biased up by 15) and three 9-bit mantissas
	for each respective component.  There is no sign bit so all three
	components must be non-negative.  The fractional mantissas are
	stored without an implied 1 to the left of the decimal point.
	Neither infinity nor not-a-number (NaN) are representable in this
	shared exponent format.
	
	This 32 bits/texel shared exponent format is particularly well-suited
	to high dynamic range (HDR) applications where light intensity is
	typically stored as non-negative red, green, and blue components
	with considerable range.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/texture_shared_exponent.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.EXT.texture_shared_exponent import *
from OpenGL.raw.GL.EXT.texture_shared_exponent import _EXTENSION_NAME

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


### END AUTOGENERATED SECTION