ReadOnlyMemory2D<T> Struct

Definition

A readonly version of Memory2D<T>.

public readonly struct ReadOnlyMemory2D<T> : IEquatable<Microsoft.Toolkit.HighPerformance.ReadOnlyMemory2D<T>>
type ReadOnlyMemory2D<'T> = struct
Public Structure ReadOnlyMemory2D(Of T)
Implements IEquatable(Of ReadOnlyMemory2D(Of T))

Type Parameters

T

The type of items in the current ReadOnlyMemory2D<T> instance.

Inheritance
ReadOnlyMemory2D<T>
Implements

Constructors

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

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

ReadOnlyMemory2D<T>(MemoryManager<T>, 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>(String, 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[,,], Int32)

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

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

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

ReadOnlyMemory2D<T>(T[,])

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)

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

Properties

Empty

Gets an empty ReadOnlyMemory2D<T> instance.

Height

Gets the height of the underlying 2D memory area.

IsEmpty

Gets a value indicating whether the current ReadOnlyMemory2D<T> instance is empty.

Item[Range, Range]

Slices the current instance with the specified parameters.

Length

Gets the length of the current ReadOnlyMemory2D<T> instance.

Span

Gets a ReadOnlySpan2D<T> instance from the current memory.

Width

Gets the width of the underlying 2D memory area.

Methods

CopyTo(Memory<T>)

Copies the contents of this ReadOnlyMemory2D<T> into a destination Memory<T> instance.

CopyTo(Memory2D<T>)

Copies the contents of this ReadOnlyMemory2D<T> into a destination Memory2D<T> instance. For this API to succeed, the target Memory2D<T> has to have the same shape as the current one.

DangerousCreate(Object, T, Int32, Int32, Int32)

Creates a new ReadOnlyMemory2D<T> instance from an arbitrary object.

Equals(Object)

Indicates whether this instance and a specified object are equal.

Equals(ReadOnlyMemory2D<T>)
GetHashCode()

Returns the hash code for this instance.

Pin()

Creates a handle for the memory. The GC will not move the memory until the returned MemoryHandle is disposed, enabling taking and using the memory's address.

Slice(Int32, Int32, Int32, Int32)

Slices the current instance with the specified parameters.

ToArray()

Copies the contents of the current ReadOnlyMemory2D<T> instance into a new 2D array.

ToString()

Returns the fully qualified type name of this instance.

TryCopyTo(Memory<T>)

Attempts to copy the current ReadOnlyMemory2D<T> instance to a destination Memory<T>.

TryCopyTo(Memory2D<T>)

Attempts to copy the current ReadOnlyMemory2D<T> instance to a destination Memory2D<T>. For this API to succeed, the target Memory2D<T> has to have the same shape as the current one.

TryGetMemory(ReadOnlyMemory<T>)

Tries to get a ReadOnlyMemory<T> instance, if the underlying buffer is contiguous and small enough.

Operators

Implicit(Memory2D<T> to ReadOnlyMemory2D<T>)
Implicit(T[,] to ReadOnlyMemory2D<T>)

Applies to