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 / cmyka.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  1.7 KB  |  41 lines

  1. '''OpenGL extension EXT.cmyka
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension provides a simple method for OpenGL to read and store
  6.     images whose pixels have CMYK or CMYKA formats.  The algorithms used to
  7.     convert to RGBA from CMYKA and to convert back from RGBA to CMYKA are of
  8.     the "black-box" nature, meaning that the application has little control
  9.     over how the conversion is done.  Also, this black-box mechanism is
  10.     available only for transfers to or from memory, not for internal copies
  11.     of pixel data (such as invoked by CopyPixels, CopyTexImage1D, etc.)
  12.     However, the defined mechanism nicely handles 5-component CMYKA images,
  13.     and it is very easy to use.
  14.     
  15.     A more configurable and potentially higher quality color conversion can
  16.     be implemented using the color tables, the color matrix, and possibly 3D
  17.     and 4D texture lookup.  Such a color conversion also applies to copied
  18.     pixel data.
  19.  
  20. The official definition of this extension is available here:
  21.     http://oss.sgi.com/projects/ogl-sample/registry/EXT/cmyka.txt
  22.  
  23. Automatically generated by the get_gl_extensions script, do not edit!
  24. '''
  25. from OpenGL import platform, constants, constant, arrays
  26. from OpenGL import extensions
  27. from OpenGL.GL import glget
  28. import ctypes
  29. EXTENSION_NAME = 'GL_EXT_cmyka'
  30. GL_CMYK_EXT = constant.Constant( 'GL_CMYK_EXT', 0x800C )
  31. GL_CMYKA_EXT = constant.Constant( 'GL_CMYKA_EXT', 0x800D )
  32. GL_PACK_CMYK_HINT_EXT = constant.Constant( 'GL_PACK_CMYK_HINT_EXT', 0x800E )
  33. glget.addGLGetConstant( GL_PACK_CMYK_HINT_EXT, (1,) )
  34. GL_UNPACK_CMYK_HINT_EXT = constant.Constant( 'GL_UNPACK_CMYK_HINT_EXT', 0x800F )
  35. glget.addGLGetConstant( GL_UNPACK_CMYK_HINT_EXT, (1,) )
  36.  
  37.  
  38. def glInitCmykaEXT():
  39.     '''Return boolean indicating whether this extension is available'''
  40.     return extensions.hasGLExtension( EXTENSION_NAME )
  41.