Interface IMemoryGroup<T>
Represents discontiguous group of multiple uniformly-sized memory segments. The last segment can be smaller than the preceding ones.
Namespace: SixLabors.ImageSharp.Memory
Assembly: SixLabors.ImageSharp.dll
Syntax
public interface IMemoryGroup<T> : IReadOnlyList<Memory<T>>, IReadOnlyCollection<Memory<T>>, IEnumerable<Memory<T>>, IEnumerable where T : struct
Type Parameters
Name | Description |
---|---|
T | The element type. |
Properties
| Improve this Doc View SourceBufferLength
Gets the number of elements per contiguous sub-buffer preceding the last buffer. The last buffer is allowed to be smaller.
Declaration
int BufferLength { get; }
Property Value
Type | Description |
---|---|
Int32 |
IsValid
Gets a value indicating whether the group has been invalidated.
Declaration
bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
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.
Declaration
long TotalLength { get; }
Property Value
Type | Description |
---|---|
Int64 |
Methods
| Improve this Doc View SourceGetEnumerator()
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 langword_csharp_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.
Declaration
MemoryGroupEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
SixLabors.ImageSharp.Memory.MemoryGroupEnumerator<T> | A new SixLabors.ImageSharp.Memory.MemoryGroupEnumerator<T> instance mapping the current Memory<T> values in use. |