Editar

Compartilhar via


ArrayExtensions.AsSpan2D Method

Definition

Overloads

AsSpan2D<T>(T[,])

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

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

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

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

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

AsSpan2D<T>(T[,])

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

public static Microsoft.Toolkit.HighPerformance.Span2D<T> AsSpan2D<T> (this T[,]? array);
static member AsSpan2D : 'T[,] -> Microsoft.Toolkit.HighPerformance.Span2D<'T>
<Extension()>
Public Function AsSpan2D(Of T) (array As T(,)) As Span2D(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 Span2D<T> instance with the values of array.

Applies to

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

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

public static Microsoft.Toolkit.HighPerformance.Span2D<T> AsSpan2D<T> (this T[,,] array, int depth);
static member AsSpan2D : 'T[,,] * int -> Microsoft.Toolkit.HighPerformance.Span2D<'T>
<Extension()>
Public Function AsSpan2D(Of T) (array As T(,,), depth As Integer) As Span2D(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 Span2D<T> instance wrapping the target layer within array.

Exceptions

Thrown when array doesn't match T.

Thrown when either depth is invalid.

Applies to

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

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

public static Microsoft.Toolkit.HighPerformance.Span2D<T> AsSpan2D<T> (this T[,]? array, int row, int column, int height, int width);
static member AsSpan2D : 'T[,] * int * int * int * int -> Microsoft.Toolkit.HighPerformance.Span2D<'T>
<Extension()>
Public Function AsSpan2D(Of T) (array As T(,), row As Integer, column As Integer, height As Integer, width As Integer) As Span2D(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 Span2D<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