PydObject.BufferView

exposes a lowish-level wrapper of the new-style buffer interface

Constructors

this
this()

construct buffer view. Probe for capabilities this object supports.

this
this(int flags)

Construct buffer view. Don't probe for capabilities; assume object supports capabilities implied by flags.

Members

Functions

item
T item(Py_ssize_t[] indices)

_

item_ptr
void* item_ptr(Py_ssize_t[] indices)
Undocumented in source. Be warned that the author may not have intended to support it.
set_item
void set_item(T value, Py_ssize_t[] indices)

_

Properties

buf
ubyte[] buf [@property getter]

Get the raw bytes of this buffer

format
string format [@property getter]

Get the struct-style format of the element type of this buffer.

itemsize
itemsize [@property getter]

_

ndim
int ndim [@property getter]

Get number of dimensions of this buffer.

readonly
bool readonly [@property getter]

_

shape
Py_ssize_t[] shape [@property getter]

_

strides
Py_ssize_t[] strides [@property getter]

_

suboffsets
Py_ssize_t[] suboffsets [@property getter]

_

Variables

buffer
Py_buffer buffer;
Undocumented in source.
c_contiguous
bool c_contiguous;

supports PyBUF_C_CONTIGUOUS.
buffer is row-major.

fortran_contiguous
bool fortran_contiguous;

supports PyBUF_F_CONTIGUOUS.
buffer is column-major

has_indirect
bool has_indirect;

supports PyBUF_INDIRECT.
i.e. buffer supplies suboffsets.

has_nd
bool has_nd;

supports PyBUF_ND.
i.e. buffer supplies ndim, shape.

has_simple
bool has_simple;

supports PyBUF_SIMPLE.
should always be true.

has_strides
bool has_strides;

supports PyBUF_STRIDES.
i.e. buffer supplies strides.

See Also

<a href="http://docs.python.org/c-api/buffer.html"> Buffers and MemoryView Objects </a>

Meta