Re: [GD-DEVEL] allocation of pixel buffer
[email protected] (Chris Barker - NOAA Federal) Thu, 20 Jun 2013 07:44:39 -0700
| Newsgroups | php.gd.devel |
|---|---|
| Message-ID | <8505967003607913857@unknownmsgid> |
On Jun 19, 2013, at 9:30 PM, Pierre Joye <[email protected]> wrote: >> I'm working on some new bindings of GD for Python. > > Very nice, let us know if we can help in any way! > Will do. I'll try to get it up on github or something soon, so others can take a look. >> One of the things >> I'd hoped to do is wrap the pixel buffer in a numpy array, > > It was done like that in all the 2.x serie and we can't really change > that at this point. That's not the best way but it is how it is :) Fair enough. > 2.2+ will allow custom buffer to be used, allocated by gd or 3rd > parties, with more buffer formats. Something like what is done in > pixmap (freedesktop) if you know it. I don't, but that would be perfect. While you can wrap a numpy array around a block of existing memory, it gets pretty tricky to do the Memory management. It's easier and more robust if you can let numpy allocate the memory, and pass that pointer into another lib. So that would be great. I imagine I'll have questions at some point.... -Chris