home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / lib / site-packages / OpenGL / raw / GL / SGIS / pixel_texture.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  5.1 KB  |  120 lines

  1. '''OpenGL extension SGIS.pixel_texture
  2.  
  3. Overview (from the spec)
  4.     
  5.     The geometry rasterization and pixel pipeline "convert to fragment"
  6.     stages each produce fragments.  The fragments are processed by
  7.     a unified per fragment pipeline that begins with the application
  8.     of the texture to the fragment color.  Because the pixel pipeline
  9.     shares the per fragment processing with the geometry pipeline, the
  10.     fragments produced by the pixel pipeline must have the same fields
  11.     as the ones produced by the geometry pipeline.  When
  12.     pixel groups are being converted to fragments, the parts 
  13.     of the fragment that aren't derived from the pixel groups 
  14.     are taken from the associated values in the current raster position.
  15.     
  16.     A fragment consists of x and y window coordinates and their
  17.     associated color value, depth value, and texture coordinates.
  18.     In the 1.1 OpenGL specification, when the pixel group is RGBA
  19.     the fragment color is always derived from the pixel group, 
  20.     and the depth value and texture coordinates always come 
  21.     from the raster position.
  22.     
  23.     This extension provides a way to specify how the texture coordinates
  24.     of the fragments can be derived from RGBA pixel groups.  When
  25.     this option is enabled, the source of the fragment color value
  26.     when the pixel group is RGBA can be specified to come from either 
  27.     the raster position or the pixel group.
  28.     
  29.     Deriving the fragment texture coordinates from the pixel group
  30.     effectively converts a color image into a texture coordinate image.
  31.     The multidimensional texture mapping lookup logic also makes this
  32.     extension useful for implementing multidimensional color lookups.
  33.     Multidimensional color lookups can be used to implement very
  34.     accurate color space conversions.
  35.     
  36.     Deriving texture coordinates from the pixel groups in the pixel
  37.     pipeline introduces a problem with the lambda parameter in the
  38.     texture mapping equations.  When texture coordinates are
  39.     being taken from the current raster position texture coordinates,
  40.     the texture coordinate values don't change from pixel to pixel,
  41.     and the equation for calculating lambda always produces zero.
  42.     Enabling pixel_texture introduces changes in the texture
  43.     coordinates from pixel to pixel which are not necessarily
  44.     meaningful for texture lookups.  This problem is addressed
  45.     by specifying that lambda is always set to zero when pixel_texture 
  46.     is enabled.  
  47.  
  48. The official definition of this extension is available here:
  49.     http://oss.sgi.com/projects/ogl-sample/registry/SGIS/pixel_texture.txt
  50.  
  51. Automatically generated by the get_gl_extensions script, do not edit!
  52. '''
  53. from OpenGL import platform, constants, constant, arrays
  54. from OpenGL import extensions
  55. from OpenGL.GL import glget
  56. import ctypes
  57. EXTENSION_NAME = 'GL_SGIS_pixel_texture'
  58. GL_PIXEL_TEXTURE_SGIS = constant.Constant( 'GL_PIXEL_TEXTURE_SGIS', 0x8353 )
  59. GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS = constant.Constant( 'GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS', 0x8354 )
  60. GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = constant.Constant( 'GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS', 0x8355 )
  61. GL_PIXEL_GROUP_COLOR_SGIS = constant.Constant( 'GL_PIXEL_GROUP_COLOR_SGIS', 0x8356 )
  62. glPixelTexGenParameteriSGIS = platform.createExtensionFunction( 
  63.     'glPixelTexGenParameteriSGIS', dll=platform.GL,
  64.     extension=EXTENSION_NAME,
  65.     resultType=None, 
  66.     argTypes=(constants.GLenum, constants.GLint,),
  67.     doc = 'glPixelTexGenParameteriSGIS( GLenum(pname), GLint(param) ) -> None',
  68.     argNames = ('pname', 'param',),
  69. )
  70.  
  71. glPixelTexGenParameterivSGIS = platform.createExtensionFunction( 
  72.     'glPixelTexGenParameterivSGIS', dll=platform.GL,
  73.     extension=EXTENSION_NAME,
  74.     resultType=None, 
  75.     argTypes=(constants.GLenum, arrays.GLintArray,),
  76.     doc = 'glPixelTexGenParameterivSGIS( GLenum(pname), GLintArray(params) ) -> None',
  77.     argNames = ('pname', 'params',),
  78. )
  79.  
  80. glPixelTexGenParameterfSGIS = platform.createExtensionFunction( 
  81.     'glPixelTexGenParameterfSGIS', dll=platform.GL,
  82.     extension=EXTENSION_NAME,
  83.     resultType=None, 
  84.     argTypes=(constants.GLenum, constants.GLfloat,),
  85.     doc = 'glPixelTexGenParameterfSGIS( GLenum(pname), GLfloat(param) ) -> None',
  86.     argNames = ('pname', 'param',),
  87. )
  88.  
  89. glPixelTexGenParameterfvSGIS = platform.createExtensionFunction( 
  90.     'glPixelTexGenParameterfvSGIS', dll=platform.GL,
  91.     extension=EXTENSION_NAME,
  92.     resultType=None, 
  93.     argTypes=(constants.GLenum, arrays.GLfloatArray,),
  94.     doc = 'glPixelTexGenParameterfvSGIS( GLenum(pname), GLfloatArray(params) ) -> None',
  95.     argNames = ('pname', 'params',),
  96. )
  97.  
  98. glGetPixelTexGenParameterivSGIS = platform.createExtensionFunction( 
  99.     'glGetPixelTexGenParameterivSGIS', dll=platform.GL,
  100.     extension=EXTENSION_NAME,
  101.     resultType=None, 
  102.     argTypes=(constants.GLenum, arrays.GLintArray,),
  103.     doc = 'glGetPixelTexGenParameterivSGIS( GLenum(pname), GLintArray(params) ) -> None',
  104.     argNames = ('pname', 'params',),
  105. )
  106.  
  107. glGetPixelTexGenParameterfvSGIS = platform.createExtensionFunction( 
  108.     'glGetPixelTexGenParameterfvSGIS', dll=platform.GL,
  109.     extension=EXTENSION_NAME,
  110.     resultType=None, 
  111.     argTypes=(constants.GLenum, arrays.GLfloatArray,),
  112.     doc = 'glGetPixelTexGenParameterfvSGIS( GLenum(pname), GLfloatArray(params) ) -> None',
  113.     argNames = ('pname', 'params',),
  114. )
  115.  
  116.  
  117. def glInitPixelTextureSGIS():
  118.     '''Return boolean indicating whether this extension is available'''
  119.     return extensions.hasGLExtension( EXTENSION_NAME )
  120.