Table of Contents

Interface IMemoryGroup<T>

Namespace
SixLabors.ImageSharp.Memory
Assembly
SixLabors.ImageSharp.dll

Represents discontiguous group of multiple uniformly-sized memory segments. The last segment can be smaller than the preceding ones.

public interface IMemoryGroup<T> : IReadOnlyList<Memory<T>>, IReadOnlyCollection<Memory<T>>, IEnumerable<Memory<T>>, IEnumerable where T : struct

Type Parameters

T

The element type.

Inherited Members

Properties

BufferLength

Gets the number of elements per contiguous sub-buffer preceding the last buffer. The last buffer is allowed to be smaller.

int BufferLength { get; }

Property Value

int

IsValid

Gets a value indicating whether the group has been invalidated.

bool IsValid { get; }

Property Value

bool

Remarks

Invalidation usually occurs when an image processor capable to alter the image dimensions replaces the image buffers internally.

TotalLength

Gets the aggregate number of elements in the group.

long TotalLength { get; }

Property Value

long

Methods

GetEnumerator()

Returns a value-type implementing an allocation-free enumerator of the memory groups in the current instance. The return type shouldn't be used directly: just use a foreach block on the IMemoryGroup<T> instance in use and the C# compiler will automatically invoke this method behind the scenes. This method takes precedence over the GetEnumerator() implementation, which is still available when casting to one of the underlying interfaces.

MemoryGroupEnumerator<T> GetEnumerator()

Returns

MemoryGroupEnumerator<T>

A new MemoryGroupEnumerator<T> instance mapping the current Memory<T> values in use.