Modifier

Partager via


ArrayExtensions.AsMemory2D Method

Definition

Overloads

AsMemory2D<T>(T[,])

Creates a new Memory2D<T> over an input 2D T array.

AsMemory2D<T>(T[,,], Int32)

Creates a new instance of the Memory2D<T> struct wrapping a layer in a 3D array.

AsMemory2D<T>(T[,], Int32, Int32, Int32, Int32)

Creates a new Memory2D<T> over an input 2D T array.

AsMemory2D<T>(T[,])

Creates a new Memory2D<T> over an input 2D T array.

public static CommunityToolkit.HighPerformance.Memory2D<T> AsMemory2D<T> (this T[,]? array);
static member AsMemory2D : 'T[,] -> CommunityToolkit.HighPerformance.Memory2D<'T>
<Extension()>
Public Function AsMemory2D(Of T) (array As T(,)) As Memory2D(Of T)

Type Parameters

T

The type of elements in the input 2D T array instance.

Parameters

array
T[,]

The input 2D T array instance.

Returns

A Memory2D<T> instance with the values of array.

Applies to

AsMemory2D<T>(T[,,], Int32)

Creates a new instance of the Memory2D<T> struct wrapping a layer in a 3D array.

public static CommunityToolkit.HighPerformance.Memory2D<T> AsMemory2D<T> (this T[,,] array, int depth);
static member AsMemory2D : 'T[,,] * int -> CommunityToolkit.HighPerformance.Memory2D<'T>
<Extension()>
Public Function AsMemory2D(Of T) (array As T(,,), depth As Integer) As Memory2D(Of T)

Type Parameters

T

The type of elements in the input 3D T array instance.

Parameters

array
T[,,]

The given 3D array to wrap.

depth
Int32

The target layer to map within array.

Returns

A Memory2D<T> instance wrapping the target layer within array.

Exceptions

Thrown when array doesn't match T.

Thrown when either depth is invalid.

Applies to

AsMemory2D<T>(T[,], Int32, Int32, Int32, Int32)

Creates a new Memory2D<T> over an input 2D T array.

public static CommunityToolkit.HighPerformance.Memory2D<T> AsMemory2D<T> (this T[,]? array, int row, int column, int height, int width);
static member AsMemory2D : 'T[,] * int * int * int * int -> CommunityToolkit.HighPerformance.Memory2D<'T>
<Extension()>
Public Function AsMemory2D(Of T) (array As T(,), row As Integer, column As Integer, height As Integer, width As Integer) As Memory2D(Of T)

Type Parameters

T

The type of elements in the input 2D T array instance.

Parameters

array
T[,]

The input 2D T array instance.

row
Int32

The target row to map within array.

column
Int32

The target column to map within array.

height
Int32

The height to map within array.

width
Int32

The width to map within array.

Returns

A Memory2D<T> instance with the values of array.

Exceptions

Thrown when array doesn't match T.

Thrown when either height, width or height are negative or not within the bounds that are valid for array.

Applies to