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 / SGIX / ycrcb.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  1.9 KB  |  46 lines

  1. '''OpenGL extension SGIX.ycrcb
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension provides a method for OpenGL to read and store 
  6.     images that are defined in standard YCRCB 422 and 444 video formats.
  7.     As with the CYMK extension, conversion to RGBA takes place immediately 
  8.     following the unpack pixel store, and preceding the pack pixel store 
  9.     operations, and is only available on transfers to and from memory.  
  10.     The algorithms that convert between YCRCB and RGBA are "black-box"
  11.     in nature, and left undefined by the extension.
  12.     
  13.     Two new formats are added, YCRCB_422_SGIX and YCRCB_444_SGIX.
  14.     
  15.     To handle the difference in sampling rate for 422 video, the pixel 
  16.     storage operations treat YCRCB_422_SGIX as a 2 component format,
  17.     where the first component represents chroma, and the second luma.
  18.     The chroma component alternates between Cb and Cr values on
  19.     a per pixel basis.  If the specified image <width> parameter is not
  20.     a multiple of 2, then fragments or texels that result from processing 
  21.     the <width>th column of pixels will have undefined color value.
  22.     
  23.     YCRCB_444_SGIX is defined as a 3 component format representing 
  24.     the Cb, Y, and Cr values per pixel.
  25.     
  26.     As with the CMYK extension, this extension doesn't preclude the 
  27.     possiblity of other higher quality conversion methods.
  28.  
  29. The official definition of this extension is available here:
  30.     http://oss.sgi.com/projects/ogl-sample/registry/SGIX/ycrcb.txt
  31.  
  32. Automatically generated by the get_gl_extensions script, do not edit!
  33. '''
  34. from OpenGL import platform, constants, constant, arrays
  35. from OpenGL import extensions
  36. from OpenGL.GL import glget
  37. import ctypes
  38. EXTENSION_NAME = 'GL_SGIX_ycrcb'
  39. GL_YCRCB_422_SGIX = constant.Constant( 'GL_YCRCB_422_SGIX', 0x81BB )
  40. GL_YCRCB_444_SGIX = constant.Constant( 'GL_YCRCB_444_SGIX', 0x81BC )
  41.  
  42.  
  43. def glInitYcrcbSGIX():
  44.     '''Return boolean indicating whether this extension is available'''
  45.     return extensions.hasGLExtension( EXTENSION_NAME )
  46.