Hi list,
sorry if this is the wrong place to articulate an uneducated wish.
I was recently playing around with pyOpenCV, pyOpenGL, pygame and the
like.
What I found in those libraries is the ability to pass around pixel
buffers in the form of a raw string meaning they are all able to convert
from
On Wed, May 5, 2010 at 9:35 AM, Theo de Ridder wrote:
>
> On 5 mei 2010, at 07:53, Campbell wrote:
>
>> indeed it seems there is no way to get a PyCapsule into ctypes.
>> Since this was the purpose, as_pointer() could return an 'int' which
>> ctypes can convert into a pointer.
>>
>> as for securit
On 5 mei 2010, at 07:53, Campbell wrote:
> indeed it seems there is no way to get a PyCapsule into ctypes.
> Since this was the purpose, as_pointer() could return an 'int' which
> ctypes can convert into a pointer.
>
> as for security, there are probably easier ways to exploit blender
> then get
On Wed, May 5, 2010 at 3:59 AM, Dan Eicher wrote:
> On Tue, May 4, 2010 at 2:06 AM, Theo de Ridder
> wrote:
>
>>
>> On 4 mei 2010, at 08:13, Campbell wrote:
>>
>> > class Image(bpy_types.ID):
>> > def buffer_get(self, type="byte", frame=None):
>> > return None # replace with ctypes/buff
On Tue, May 4, 2010 at 2:06 AM, Theo de Ridder wrote:
>
> On 4 mei 2010, at 08:13, Campbell wrote:
>
> > class Image(bpy_types.ID):
> >def buffer_get(self, type="byte", frame=None):
> >return None # replace with ctypes/buffer stuff.
> >
> > After this you can do..
> > buffer = bpy.dat
On 4 mei 2010, at 08:13, Campbell wrote:
> class Image(bpy_types.ID):
>def buffer_get(self, type="byte", frame=None):
>return None # replace with ctypes/buffer stuff.
>
> After this you can do..
> buffer = bpy.data.images["foo"].buffer_get()
I tried this, by adding those lines in t
For experimenting, defining a type for an image is trivial.
The way it works is bpy_types.py has its classes used when available,
otherwise the C/API creates a class its self.
All you'd need to do is...
class Image(bpy_types.ID):
def buffer_get(self, type="byte", frame=None):
return
> - An Image has float and int buffers, so we cant assume one buffer per
> image
> - An image has imbuf's for different frames of an image sequence.
>
Could add a method that returns a memory view object that deals with frames,
layers and such instead of exporting it directly or add different memo
On Mon, May 3, 2010 at 1:08 AM, Dan Eicher wrote:
> On Sun, May 2, 2010 at 1:32 PM, Campbell Barton 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(
On Sun, May 2, 2010 at 1:32 PM, Campbell Barton 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 wit
On Sun, May 2, 2010 at 9:39 PM, Dan Eicher wrote:
> Been working on a py_buffer method for pixel access (
> http://www.pasteall.org/12868/diff) and can't seem to figure out where it
> goes wrong.
>
> It appears to work...
>
import bpy
img = memoryview(bpy.data.images['Lenna.png'])
i
Been working on a py_buffer method for pixel access (
http://www.pasteall.org/12868/diff) and can't seem to figure out where it
goes wrong.
It appears to work...
>>> import bpy
>>> img = memoryview(bpy.data.images['Lenna.png'])
>>> img.format
'B'
>>> img.itemsize
1
>>> img.shape
(512, 512, 3)
12 matches
Mail list logo