Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

corrade.containers.StridedBitArrayView2D class

Two-dimensional bit array view with stride information

See StridedBitArrayView1D for more information.

Methods

def broadcasted(self, dimension: int, size: int) -> StridedBitArrayView2D
Broadcast a dimension
def expanded(self, dimension: int, size: tuple[int, int]) -> StridedBitArrayView3D
Expand a dimension
def expanded(self, dimension: int, size: tuple[int, int, int]) -> StridedBitArrayView4D
Expand a dimension
def flipped(self, dimension: int) -> StridedBitArrayView2D
Flip a dimension
def transposed(self, a: int, b: int) -> StridedBitArrayView2D
Transpose two dimensions

Special methods

def __getitem__(self, slice: slice) -> StridedBitArrayView2D
Slice the view
def __getitem__(self, i: int) -> StridedBitArrayView1D
Sub-view at given position
def __getitem__(self, i: tuple[int, int]) -> bool
Bit at given position
def __getitem__(self, slice: tuple[slice, slice]) -> StridedBitArrayView2D
Slice the view
def __init__(self, /) -> None
Default constructor
def __len__(self, /) -> int
View size in the top-level dimension

Properties

dimensions: int get
Dimension count
offset: int get
Bit offset
owner: object get
Memory owner object
size: tuple[int, int] get
View size in each dimension
stride: tuple[int, int] get
View stride in each dimension

Method documentation

def corrade.containers.StridedBitArrayView2D.broadcasted(self, dimension: int, size: int) -> StridedBitArrayView2D

Broadcast a dimension

Exceptions
IndexError If dimension is not 0 or 1

def corrade.containers.StridedBitArrayView2D.expanded(self, dimension: int, size: tuple[int, int]) -> StridedBitArrayView3D

Expand a dimension

Exceptions
IndexError If dimension is not 0 or 1
ValueError If product of size is not equal to size in dimension

def corrade.containers.StridedBitArrayView2D.expanded(self, dimension: int, size: tuple[int, int, int]) -> StridedBitArrayView4D

Expand a dimension

Exceptions
IndexError If dimension is not 0 or 1
ValueError If product of size is not equal to size in dimension

def corrade.containers.StridedBitArrayView2D.flipped(self, dimension: int) -> StridedBitArrayView2D

Flip a dimension

Exceptions
IndexError If dimension is not 0 or 1

def corrade.containers.StridedBitArrayView2D.transposed(self, a: int, b: int) -> StridedBitArrayView2D

Transpose two dimensions

Exceptions
IndexError If a or b is not 0 or 1 or if they’re the same