Re: pygobject and buffers

2014-09-08 Thread jcupitt
On 4 September 2014 10:31, PICCA Frederic-Emmanuel wrote: >> I wrote a tiny Python module that converts from our GObject-based buffer >> class to a NumPy array [1]. Works okay but requires a memcpy. > >> [1] https://github.com/ufo-kit/ufo-python-tools/blob/master/src/ufo.c > > as an user of gobjec

Re: pygobject and buffers

2014-09-05 Thread jcupitt
On 4 September 2014 21:31, Simon Feltman wrote: > On Thu, Sep 4, 2014 at 1:49 AM, wrote: >> Does pygobject support buffers? How have other people done this? I >> couldn't find any reference to "Buffer" in the C sources in a quick >> search. I'm probably being dumb. > > There are some preliminary

Re: pygobject and buffers

2014-09-04 Thread Simon Feltman
On Thu, Sep 4, 2014 at 1:49 AM, wrote: > Does pygobject support buffers? How have other people done this? I > couldn't find any reference to "Buffer" in the C sources in a quick > search. I'm probably being dumb. There are some preliminary sketches here [1] but at the moment a custom C extension

Re: pygobject and buffers

2014-09-04 Thread Matthias Vogelgesang
On 09/04/14 11:10, jcup...@gmail.com wrote: > You can imagine it being useful in the other direction too: you could > get maybe get binary image data out of NumPy and into cairo with fewer > copies. That's actually how we do it in another project [1]. I create an empty NumPy array and pass the und

Re: pygobject and buffers

2014-09-04 Thread jcupitt
On 4 September 2014 10:05, Matthias Vogelgesang wrote: > On 09/04/14 09:49, jcup...@gmail.com wrote: >> How have other people done this? > > I wrote a tiny Python module that converts from our GObject-based buffer > class to a NumPy array [1]. Works okay but requires a memcpy. That's neat. I wond

Re: pygobject and buffers

2014-09-04 Thread Matthias Vogelgesang
On 09/04/14 09:49, jcup...@gmail.com wrote: > How have other people done this? I wrote a tiny Python module that converts from our GObject-based buffer class to a NumPy array [1]. Works okay but requires a memcpy. [1] https://github.com/ufo-kit/ufo-python-tools/blob/master/src/ufo.c -- Matthias