[Matplotlib-users] pylab.imshow - how does it work?

2008-01-20 Thread Adeola Bannis
Hi, I have a set of images I want to render with OpenGL, and I do this by doing some calculations, producing an array, then passing this array to OpenGL. Here's the relevant OpenGL call, for reference: gluBuild2DMipmaps(GL_TEXTURE_2D, 1, image.shape[0], image.shape[1],

Re: [Matplotlib-users] pylab.imshow - how does it work?

2008-01-20 Thread Andrew Straw
Hi Adeola, OpenGL must be expecting a certain "packing" but your image data is packed differently. You have (at least) two options: 1) alter your numpy arrays to match the packing of OpenGL. This can be done by creating an array with the appropriate .strides value. 2) alter OpenGL's idea of how