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 / EXT / texture_sRGB.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  2.5 KB  |  50 lines

  1. '''OpenGL extension EXT.texture_sRGB
  2.  
  3. Overview (from the spec)
  4.     
  5.     Conventional texture formats assume a linear color space.  So for
  6.     a conventional internal texture format such as GL_RGB8, the 256
  7.     discrete values for each 8-bit color component map linearly and
  8.     uniformly to the [0,1] range.
  9.     
  10.     The sRGB color space is based on typical (non-linear) monitor
  11.     characteristics expected in a dimly lit office.  It has been
  12.     standardized by the International Electrotechnical Commission (IEC)
  13.     as IEC 61966-2-1. The sRGB color space roughly corresponds to 2.2
  14.     gamma correction.
  15.     
  16.     This extension adds a few new uncompressed and compressed color
  17.     texture formats with sRGB color components.
  18.  
  19. The official definition of this extension is available here:
  20.     http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_sRGB.txt
  21.  
  22. Automatically generated by the get_gl_extensions script, do not edit!
  23. '''
  24. from OpenGL import platform, constants, constant, arrays
  25. from OpenGL import extensions
  26. from OpenGL.GL import glget
  27. import ctypes
  28. EXTENSION_NAME = 'GL_EXT_texture_sRGB'
  29. GL_SRGB_EXT = constant.Constant( 'GL_SRGB_EXT', 0x8C40 )
  30. GL_SRGB8_EXT = constant.Constant( 'GL_SRGB8_EXT', 0x8C41 )
  31. GL_SRGB_ALPHA_EXT = constant.Constant( 'GL_SRGB_ALPHA_EXT', 0x8C42 )
  32. GL_SRGB8_ALPHA8_EXT = constant.Constant( 'GL_SRGB8_ALPHA8_EXT', 0x8C43 )
  33. GL_SLUMINANCE_ALPHA_EXT = constant.Constant( 'GL_SLUMINANCE_ALPHA_EXT', 0x8C44 )
  34. GL_SLUMINANCE8_ALPHA8_EXT = constant.Constant( 'GL_SLUMINANCE8_ALPHA8_EXT', 0x8C45 )
  35. GL_SLUMINANCE_EXT = constant.Constant( 'GL_SLUMINANCE_EXT', 0x8C46 )
  36. GL_SLUMINANCE8_EXT = constant.Constant( 'GL_SLUMINANCE8_EXT', 0x8C47 )
  37. GL_COMPRESSED_SRGB_EXT = constant.Constant( 'GL_COMPRESSED_SRGB_EXT', 0x8C48 )
  38. GL_COMPRESSED_SRGB_ALPHA_EXT = constant.Constant( 'GL_COMPRESSED_SRGB_ALPHA_EXT', 0x8C49 )
  39. GL_COMPRESSED_SLUMINANCE_EXT = constant.Constant( 'GL_COMPRESSED_SLUMINANCE_EXT', 0x8C4A )
  40. GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = constant.Constant( 'GL_COMPRESSED_SLUMINANCE_ALPHA_EXT', 0x8C4B )
  41. GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = constant.Constant( 'GL_COMPRESSED_SRGB_S3TC_DXT1_EXT', 0x8C4C )
  42. GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = constant.Constant( 'GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT', 0x8C4D )
  43. GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = constant.Constant( 'GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT', 0x8C4E )
  44. GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = constant.Constant( 'GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT', 0x8C4F )
  45.  
  46.  
  47. def glInitTextureSrgbEXT():
  48.     '''Return boolean indicating whether this extension is available'''
  49.     return extensions.hasGLExtension( EXTENSION_NAME )
  50.