Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ReadOnlyMemory2D<T> Struct
Definition
- Namespace:
- Microsoft.Toolkit.HighPerformance
- Assembly:
- Microsoft.Toolkit.HighPerformance.dll
- Package:
- Microsoft.Toolkit.HighPerformance v7.0.2
- Package:
- Microsoft.Toolkit.HighPerformance v7.1.2
- Source:
- ReadOnlyMemory2D%7BT%7D.cs
- Source:
- ReadOnlyMemory2D%7BT%7D.cs
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.
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
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>) |
