ReadOnlySpan2D<T> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ReadOnlySpan2D<T>(T[,]) |
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a 2D array. |
ReadOnlySpan2D<T>(T[,,], Int32) |
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a layer in a 3D array. |
ReadOnlySpan2D<T>(T[], Int32, Int32) |
Initializes a new instance of the ReadOnlySpan2D<T> struct. |
ReadOnlySpan2D<T>(Void*, Int32, Int32, Int32) |
Initializes a new instance of the ReadOnlySpan2D<T> struct with the specified parameters. |
ReadOnlySpan2D<T>(T[,], Int32, Int32, Int32, Int32) |
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a 2D array. |
ReadOnlySpan2D<T>(T[], Int32, Int32, Int32, Int32) |
Initializes a new instance of the ReadOnlySpan2D<T> struct. |
ReadOnlySpan2D<T>(T[,,], Int32, Int32, Int32, Int32, Int32) |
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a layer in a 3D array. |
ReadOnlySpan2D<T>(T[,])
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a 2D array.
public ReadOnlySpan2D (T[,]? array);
new Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T> : 'T[,] -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T>
Public Sub New (array As T(,))
Parameters
- array
- T[,]
The given 2D array to wrap.
Applies to
ReadOnlySpan2D<T>(T[,,], Int32)
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a layer in a 3D array.
public ReadOnlySpan2D (T[,,] array, int depth);
new Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T> : 'T[,,] * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'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 a parameter is invalid.
Applies to
ReadOnlySpan2D<T>(T[], Int32, Int32)
Initializes a new instance of the ReadOnlySpan2D<T> struct.
public ReadOnlySpan2D (T[] array, int height, int width);
new Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T> : 'T[] * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'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 either height
or width
are invalid.
Remarks
The total area must match the length of array
.
Applies to
ReadOnlySpan2D<T>(Void*, Int32, Int32, Int32)
Initializes a new instance of the ReadOnlySpan2D<T> struct with the specified parameters.
public ReadOnlySpan2D (void* pointer, int height, int width, int pitch);
new Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T> : nativeptr<unit> * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'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
ReadOnlySpan2D<T>(T[,], Int32, Int32, Int32, Int32)
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a 2D array.
public ReadOnlySpan2D (T[,]? array, int row, int column, int height, int width);
new Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T> : 'T[,] * int * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'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 either height
, width
or height
are negative or not within the bounds that are valid for array
.
Applies to
ReadOnlySpan2D<T>(T[], Int32, Int32, Int32, Int32)
Initializes a new instance of the ReadOnlySpan2D<T> struct.
public ReadOnlySpan2D (T[] array, int offset, int height, int width, int pitch);
new Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T> : 'T[] * int * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'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 one of the input parameters is out of range.
Thrown when the requested area is outside of bounds for array
.
Applies to
ReadOnlySpan2D<T>(T[,,], Int32, Int32, Int32, Int32, Int32)
Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a layer in a 3D array.
public ReadOnlySpan2D (T[,,] array, int depth, int row, int column, int height, int width);
new Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T> : 'T[,,] * int * int * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'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 a parameter is invalid.