Span2D<T> Constructors

Definition

Overloads

Span2D<T>(T[,])

Initializes a new instance of the Span2D<T> struct wrapping a 2D array.

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

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

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

Initializes a new instance of the Span2D<T> struct.

Span2D<T>(Void*, Int32, Int32, Int32)

Initializes a new instance of the Span2D<T> struct with the specified parameters.

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

Initializes a new instance of the Span2D<T> struct wrapping a 2D array.

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

Initializes a new instance of the Span2D<T> struct.

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

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

Span2D<T>(T[,])

Initializes a new instance of the Span2D<T> struct wrapping a 2D array.

public Span2D (T[,]? array);
new CommunityToolkit.HighPerformance.Span2D<'T> : 'T[,] -> CommunityToolkit.HighPerformance.Span2D<'T>
Public Sub New (array As T(,))

Parameters

array
T[,]

The given 2D array to wrap.

Exceptions

Thrown when array doesn't match T.

Applies to

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

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

public Span2D (T[,,] array, int depth);
new CommunityToolkit.HighPerformance.Span2D<'T> : 'T[,,] * int -> CommunityToolkit.HighPerformance.Span2D<'T>
Public Sub New (array As T(,,), depth As Integer)

Parameters

array
T[,,]

The given 3D array to wrap.

depth
Int32

The target layer to map within array.

Exceptions

Thrown when array doesn't match T.

Thrown when a parameter is invalid.

Applies to

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

Initializes a new instance of the Span2D<T> struct.

public Span2D (T[] array, int height, int width);
new CommunityToolkit.HighPerformance.Span2D<'T> : 'T[] * int * int -> CommunityToolkit.HighPerformance.Span2D<'T>
Public Sub New (array As T(), height As Integer, width As Integer)

Parameters

array
T[]

The target array to wrap.

height
Int32

The height of the resulting 2D area.

width
Int32

The width of each row in the resulting 2D area.

Exceptions

Thrown when array doesn't match T.

Thrown when either height or width are invalid.

Remarks

The total area must match the length of array.

Applies to

Span2D<T>(Void*, Int32, Int32, Int32)

Initializes a new instance of the Span2D<T> struct with the specified parameters.

public Span2D (void* pointer, int height, int width, int pitch);
new CommunityToolkit.HighPerformance.Span2D<'T> : nativeptr<unit> * int * int * int -> CommunityToolkit.HighPerformance.Span2D<'T>

Parameters

pointer
Void*

The pointer to the first T item to map.

height
Int32

The height of the 2D memory area to map.

width
Int32

The width of the 2D memory area to map.

pitch
Int32

The pitch of the 2D memory area to map (the distance between each row).

Exceptions

Thrown when one of the parameters are negative.

Applies to

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

Initializes a new instance of the Span2D<T> struct wrapping a 2D array.

public Span2D (T[,]? array, int row, int column, int height, int width);
new CommunityToolkit.HighPerformance.Span2D<'T> : 'T[,] * int * int * int * int -> CommunityToolkit.HighPerformance.Span2D<'T>
Public Sub New (array As T(,), row As Integer, column As Integer, height As Integer, width As Integer)

Parameters

array
T[,]

The given 2D array to wrap.

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.

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

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

Initializes a new instance of the Span2D<T> struct.

public Span2D (T[] array, int offset, int height, int width, int pitch);
new CommunityToolkit.HighPerformance.Span2D<'T> : 'T[] * int * int * int * int -> CommunityToolkit.HighPerformance.Span2D<'T>
Public Sub New (array As T(), offset As Integer, height As Integer, width As Integer, pitch As Integer)

Parameters

array
T[]

The target array to wrap.

offset
Int32

The initial offset within array.

height
Int32

The height of the resulting 2D area.

width
Int32

The width of each row in the resulting 2D area.

pitch
Int32

The pitch in the resulting 2D area.

Exceptions

Thrown when array doesn't match T.

Thrown when one of the input parameters is out of range.

Thrown when the requested area is outside of bounds for array.

Applies to

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

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

public Span2D (T[,,] array, int depth, int row, int column, int height, int width);
new CommunityToolkit.HighPerformance.Span2D<'T> : 'T[,,] * int * int * int * int * int -> CommunityToolkit.HighPerformance.Span2D<'T>
Public Sub New (array As T(,,), depth As Integer, row As Integer, column As Integer, height As Integer, width As Integer)

Parameters

array
T[,,]

The given 3D array to wrap.

depth
Int32

The target layer to map within array.

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.

Exceptions

Thrown when array doesn't match T.

Thrown when a parameter is invalid.

Applies to