ReadOnlyMemoryExtensions.AsMemory2D Method

Definition

Overloads

AsMemory2D<T>(ReadOnlyMemory<T>, Int32, Int32)

Returns a ReadOnlyMemory2D<T> instance wrapping the underlying data for the given ReadOnlyMemory<T> instance.

AsMemory2D<T>(ReadOnlyMemory<T>, Int32, Int32, Int32, Int32)

Returns a ReadOnlyMemory2D<T> instance wrapping the underlying data for the given ReadOnlyMemory<T> instance.

AsMemory2D<T>(ReadOnlyMemory<T>, Int32, Int32)

Returns a ReadOnlyMemory2D<T> instance wrapping the underlying data for the given ReadOnlyMemory<T> instance.

public static Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<T> AsMemory2D<T> (this ReadOnlyMemory<T> memory, int height, int width);
static member AsMemory2D : ReadOnlyMemory<'T> * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T>
<Extension()>
Public Function AsMemory2D(Of T) (memory As ReadOnlyMemory(Of T), height As Integer, width As Integer) As ReadOnlyMemory2D(Of T)

Type Parameters

T

The type of items in the input ReadOnlyMemory<T> instance.

Parameters

memory
ReadOnlyMemory<T>

The input ReadOnlyMemory<T> instance.

height
Int32

The height of the resulting 2D area.

width
Int32

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

Returns

The resulting ReadOnlyMemory2D<T> instance.

Exceptions

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

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

Applies to

AsMemory2D<T>(ReadOnlyMemory<T>, Int32, Int32, Int32, Int32)

Returns a ReadOnlyMemory2D<T> instance wrapping the underlying data for the given ReadOnlyMemory<T> instance.

public static Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<T> AsMemory2D<T> (this ReadOnlyMemory<T> memory, int offset, int height, int width, int pitch);
static member AsMemory2D : ReadOnlyMemory<'T> * int * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<'T>
<Extension()>
Public Function AsMemory2D(Of T) (memory As ReadOnlyMemory(Of T), offset As Integer, height As Integer, width As Integer, pitch As Integer) As ReadOnlyMemory2D(Of T)

Type Parameters

T

The type of items in the input ReadOnlyMemory<T> instance.

Parameters

memory
ReadOnlyMemory<T>

The input ReadOnlyMemory<T> instance.

offset
Int32

The initial offset within memory.

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.

Returns

The resulting ReadOnlyMemory2D<T> instance.

Exceptions

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

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

Applies to