If the image will always be 2D, you can add

cdef Py_ssize_t shape[2]

To your cdef class and assign self.shape to the Py_buffer. This is a bit more 
efficient.

Dag
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Christian Heimes <li...@cheimes.de> wrote:

Am 17.07.2012 22:55, schrieb Christian Heimes:
> Either I'm doing something wrong or I found a Cython bug. I've attached
> two files. The output is unexpected and looks like something is
> accessing uninitialized memory:

For the record:
It's my fault. The shade and stripes Py_ssize_t* arrays can't be local
variables. I've to malloc() two arrays and free() them in
__releasebuffer__(). Cython is so easy to use, it makes me forget all
this little annoying C things.

Christian

_____________________________________________

cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to