[Bf-committers] bpy.Image memoryview problems

Dan Eicher dan at trollwerks.org
Mon May 3 01:08:27 CEST 2010


On Sun, May 2, 2010 at 1:32 PM, Campbell Barton <ideasman42 at gmail.com>wrote:

>
> Hi, I didnt realize this was possible but you should be able to add
> image access without any C changes using the as_pointer() function.
> pt = bpy.data.images["Image"].as_pointer()
>
> >From here you should be able to use pure python with ctypes to access
> the ibuf's rect.
> this is one of the reasons I added as_pointer() but I didnt test it with
> images.
>
> --
> - Campbell
>

Seem to recall you saying you wanted a py_buffer method to replace
Image.getpixel()/setpixel() which is what this patch attempts to do but I
suppose one could use ctypes and a raw pointer to do the same thing...not
very pythonic though.


More information about the Bf-committers mailing list