MemoryExtensions.AsMemory2D Method
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
AsMemory2D<T>(Memory<T>, Int32, Int32) |
Returns a Memory2D<T> instance wrapping the underlying data for the given Memory<T> instance. |
AsMemory2D<T>(Memory<T>, Int32, Int32, Int32, Int32) |
Returns a Memory2D<T> instance wrapping the underlying data for the given Memory<T> instance. |
AsMemory2D<T>(Memory<T>, Int32, Int32)
Returns a Memory2D<T> instance wrapping the underlying data for the given Memory<T> instance.
public static Microsoft.Toolkit.HighPerformance.Memory2D<T> AsMemory2D<T> (this Memory<T> memory, int height, int width);
static member AsMemory2D : Memory<'T> * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'T>
<Extension()>
Public Function AsMemory2D(Of T) (memory As Memory(Of T), height As Integer, width As Integer) As Memory2D(Of T)
Type Parameters
- T
The type of items in the input Memory<T> instance.
Parameters
- height
- Int32
The height of the resulting 2D area.
- width
- Int32
The width of each row in the resulting 2D area.
Returns
The resulting Memory2D<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>(Memory<T>, Int32, Int32, Int32, Int32)
Returns a Memory2D<T> instance wrapping the underlying data for the given Memory<T> instance.
public static Microsoft.Toolkit.HighPerformance.Memory2D<T> AsMemory2D<T> (this Memory<T> memory, int offset, int height, int width, int pitch);
static member AsMemory2D : Memory<'T> * int * int * int * int -> Microsoft.Toolkit.HighPerformance.Memory2D<'T>
<Extension()>
Public Function AsMemory2D(Of T) (memory As Memory(Of T), offset As Integer, height As Integer, width As Integer, pitch As Integer) As Memory2D(Of T)
Type Parameters
- T
The type of items in the input Memory<T> instance.
Parameters
- 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 Memory2D<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
.