Re: Format of New glReadPixels

Ian Mallett <[email protected]> Fri, 16 Aug 2013 22:56:29 -0700
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAG4NV=uJsRWewjmnUy9bewqyyyv_h1gFKvXpp08FSedCZmtrJA@mail.gmail.com>
On Mon, Jul 8, 2013 at 7:24 AM, Mike C. Fletcher <[email protected]>wrote:

>  > Is there a workaround available for current implementations?
> You can pass the array in explicitly (param array), then convert it on
> output (.tostring() for numpy).  If you have numpy installed and the
> code isn't picking it up, then we have another failure case :( .  You
> could also just copy the wrapper function from bzr into your code, it's
> just a regular python function wrapper; however, if you have numpy, then
> it should have picked that up as your default output array format
> (generic preferences are numpy, numeric, ctypesarrays, and since *noone*
> has Numeric any more, that's just numpy or ctypes arrays).
>
> You can *explicitly* set your preferred handler with
> OpenGL.arrays.arraydatatype.ArrayDatatype.registerReturn( 'numpy' ), but
> since that's the default anyway, it *shouldn't* make a difference, and
> it will still try the others if it can't find your preferred format.
>
> My guess is that numpy isn't importable/usable, and you fell through to
> the ctypes arrays. If not, we need to spelunk.
>
The numpy on my machine is seriously broken--which might be due to a
nonstandard Python setup. I'm on Windows, and all the Pythons wanted to
install themselves to the registry in the same place. I fussed around with
it a while ago, and now double-clicking on a file runs it with Python 2.7,
while IDLE is Python 3.3. In fact, if I recall correctly, the NumPy
installers that come for Windows couldn't find *any* Python on the computer
at all, nor would they let me tell them where it was. I was annoyed about
the whole thing, but didn't (and still don't) have time to untangle the
mess.

May I recommend a feature to convert the result directly to a Python string
or something for those of us without NumPy?

 HTH,
> Mike
>
Thanks,
Ian

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users