You can also directly build a numpy array from a pointer with the numpy
API.
And I recommend Cython as an interface to make these things easy.
This does mean you’d need to have the numpy lib at build time, .which may
be a downside.
-CHB
Christopher Barker, Ph.D.
Oceanographer
Emergency Respon
On 16 Jul 2019, at 9:30 am, Omry Levy wrote:
>
> I have a question, regarding conversion of C (unsigned char *) buffer to a
> two dimensional numpy array
>
> this is what i am doing:
> 1) I get a C network buffer of unsigned char * let's call it the source
> buffer
> the size of the source bu
Hi,
I have a question, regarding conversion of C (unsigned char *) buffer to a
two dimensional numpy array
this is what i am doing:
1) I get a C network buffer of unsigned char * let's call it the source
buffer
the size of the source buffer is:
W * H * 2 bytes
2) I am using PyByteArray_FromSt