Re: pygobject and buffers
- From: Matthias Vogelgesang <matthias vogelgesang gmail com>
- To: jcupitt gmail com
- Cc: python-hackers-list gnome org
- Subject: Re: pygobject and buffers
- Date: Thu, 4 Sep 2014 12:38:01 +0200
On 09/04/14 11:10, jcupitt 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 underlying C array to GObject method that fills
it. This in fact does not require a memcpy but turns the data transfer
semantic upside down. Oh, and it assumes that the NumPy internals stay like that
...
Regards,
Matthias
[1] https://github.com/ufo-kit/concert/blob/master/concert/devices/cameras/uca.py#L182-L186
--
Matthias Vogelgesang | bloerg.net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]