[PyOpenGL-Users] PyOpengGL glHistogram()
Brought to you by:
mcfletch
From: Ant S. <an...@ce...> - 2008-08-05 09:55:57
|
Hi I've been looking at the documentation for PyOpenGL and it certainly seems to contain pages on the ARB imaging extension that allows image histogram generation. However, I've not been able to make this work, nor have I been able to find out definitively whether another package, like glewpy, provides these functions. So far, I have introduced the following into a PyOpenGL / WxPython canvas: from OpenGL.GL.ARB import imaging def OnPaint: # some code here ... glHistogram(GL_HISTOGRAM, 4, GL_RGB, GL_FALSE) glEnable(GL_HISTOGRAM) self.OnDraw() # glGetHistogram() definitely doesn't work, that's why it's commented below! #glGetHistogram(GL_HISTOGRAM, GL_FALSE, GL_RGB, GL_UNSIGNED_BYTE, self.HistValues) if glIsEnabled(GL_HISTOGRAM): print "True" else: print "False" # some more code here ... I can enable GL_HISTOGRAM, I guess because this is only setting a bool(?), but when I try to actually call the function glHistogram(), I get the following traceback: Traceback (most recent call last): File "..\glHistogramTest.py", line 97, in OnPaint glHistogram(GL_HISTOGRAM, 4, GL_RGB, GL_FALSE) File "..\Python25\lib\site-packages\OpenGL\platform\baseplatform.py", line 252, in __call__ if self.extension and self.load(): File "..\Python25\lib\site-packages\OpenGL\platform\baseplatform.py", line 234, in load func = functionTypeFor( self.DLL )( NameError: global name 'functionTypeFor' is not defined If anyone knows whether these functions are indeed supported (or not) and how, or if anyone has successfully used other modules that implement them, then I would much appreciate knowing about it. Many thanks. Ant |