ReadOnlyMemory2D<T> Constructors

Definition

Overloads

ReadOnlyMemory2D<T>(T[,])

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

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

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

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

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

ReadOnlyMemory2D<T>(String, Int32, Int32)

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

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

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

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

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

ReadOnlyMemory2D<T>(String, Int32, Int32, Int32, Int32)

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

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

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

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

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

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

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

ReadOnlyMemory2D<T>(T[,])

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

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

Parameters

array
T[,]

The given 2D array to wrap.

Applies to

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

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

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

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

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

public ReadOnlyMemory2D (System.Buffers.MemoryManager<T> memoryManager, int height, int width);
new Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T> : System.Buffers.MemoryManager<'T> * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'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

ReadOnlyMemory2D<T>(String, Int32, Int32)

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

public ReadOnlyMemory2D (string text, int height, int width);
new Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T> : string * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T>
Public Sub New (text As String, height As Integer, width As Integer)

Parameters

text
String

The target String 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 text.

Applies to

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

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

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

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

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

public ReadOnlyMemory2D (System.Buffers.MemoryManager<T> memoryManager, int offset, int height, int width, int pitch);
new Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T> : System.Buffers.MemoryManager<'T> * int * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'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

ReadOnlyMemory2D<T>(String, Int32, Int32, Int32, Int32)

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

public ReadOnlyMemory2D (string text, int offset, int height, int width, int pitch);
new Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T> : string * int * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T>
Public Sub New (text As String, offset As Integer, height As Integer, width As Integer, pitch As Integer)

Parameters

text
String

The target String to wrap.

offset
Int32

The initial offset within text.

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

Applies to

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

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

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

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

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

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

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

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

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

Applies to