Modifier

Partager via


Memory2D<T> Constructors

Definition

Overloads

Memory2D<T>(T[,])

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

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

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

Memory2D<T>(MemoryManager<T>, Int32, Int32)

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

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

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

Memory2D<T>(MemoryManager<T>, Int32, Int32, Int32, Int32)

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

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

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

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

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

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

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

Memory2D<T>(T[,])

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

public Memory2D (T[,]? array);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : 'T[,] -> Microsoft.Toolkit.HighPerformance.Memory2D<'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

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

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

public Memory2D (T[,,] array, int depth);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : 'T[,,] * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'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

Memory2D<T>(MemoryManager<T>, Int32, Int32)

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

public Memory2D (System.Buffers.MemoryManager<T> memoryManager, int height, int width);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : System.Buffers.MemoryManager<'T> * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'T>
Public Sub New (memoryManager As MemoryManager(Of T), height As Integer, width As Integer)

Parameters

memoryManager
MemoryManager<T>

The target MemoryManager<T> 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 memoryManager.

Applies to

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

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

public Memory2D (T[] array, int height, int width);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : 'T[] * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'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

Memory2D<T>(MemoryManager<T>, Int32, Int32, Int32, Int32)

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

public Memory2D (System.Buffers.MemoryManager<T> memoryManager, int offset, int height, int width, int pitch);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : System.Buffers.MemoryManager<'T> * int * int * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'T>
Public Sub New (memoryManager As MemoryManager(Of T), offset As Integer, height As Integer, width As Integer, pitch As Integer)

Parameters

memoryManager
MemoryManager<T>

The target MemoryManager<T> to wrap.

offset
Int32

The initial offset within memoryManager.

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 memoryManager.

Applies to

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

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

public Memory2D (T[,]? array, int row, int column, int height, int width);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : 'T[,] * int * int * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'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

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

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

public Memory2D (T[] array, int offset, int height, int width, int pitch);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : 'T[] * int * int * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'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

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

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

public Memory2D (T[,,] array, int depth, int row, int column, int height, int width);
new Microsoft.Toolkit.HighPerformance.Memory2D<'T> : 'T[,,] * int * int * int * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'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