jakirkham / cybuffer

A Python 2/3 compatible buffer in Cython
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Improve suboffset support #6

Open jakirkham opened 5 years ago

jakirkham commented 5 years ago

Currently suboffsets are not well supported. These are useful in cases where there is an extra level of indirection (IOW arrays of pointers to other arrays). Pillow makes use of suboffsets for its internal representation of images (IIUC for multipage images). Would be nice to support these here as well.

Many operations should work fine with suboffsets and/or are invariant to them. However things like __getitem__, __setitem__, and tolist are not. The first two are leveraging Cython's memoryviews; so, depend on resolving issue ( https://github.com/cython/cython/issues/2727 ). The last one is our own. So we will need to fix it here.

jakirkham commented 5 years ago

Fixing tolist in PR ( https://github.com/jakirkham/cybuffer/pull/8 ).