[Bf-python] Resubmission of patch for Draw.Image()

Jonathan Merritt j.merritt at pgrad.unimelb.edu.au
Wed Nov 24 15:39:11 CET 2004


Hi Cambell,

Well, an advantage of my method is that the image data *isn't* loaded 
into memory managed by OpenGL (at least, I don't think it is; please 
correct me if I'm wrong - see below :-).  It uses raster operations 
rather than texture operations for image display, which is far more 
accurate on my graphics card.  Accuracy is very important for my 
application (camera calibration and 3D reconstruction from images).

I use the load_image() function.  My reading of the eventual outcome of 
this function is that it populates image->ibuf->rect (managed by 
Blender) with the actual image data in the GL_RGBA format suitable for 
glDrawPixels().  Naturally, you could extend my method at some point in 
the future to use texture operations (which I think do load the image 
into OpenGL memory) rather than raster operations.

However, as we discussed here some time ago, it would still be very 
useful to have a method to read in or access the actual image data 
within an arbitrary image file using Python.  My own application for 
this would be in identifying and tracking markers.

The only issue I've noticed with my current method occurs with very 
large images (more than about 1024x768px, although I haven't pinned down 
the exact resolution).  At some point, the images just seem to get too 
big.  I'm not sure if this is i) a bug in my code, ii) an inbuilt OpenGL 
limitation that I don't know about or iii) a limitation of the OpenGL 
implementation on my laptop.  I'm tending to think it's issue number 3, 
because on a friend's PC with an nVidia chipset, I couldn't reproduce 
the problem even with *huge* images.

Jonathan Merritt.

> Hi, I like this function, its better in some ways then using glLoad()
>
> glLoad seams to be a bit buggy, I have a scene with 130 images in it 
> and whenever a do a glLoad (using my thumbnail browser) it segfaults 
> on some images every time. - needs to be looked into,
>
> But yours sidesteps the issue of having to have all textures loaded 
> into openGL memory it once.
>
> - Cam




More information about the Bf-python mailing list