Table of Contents

Class Buffer2D<T>

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

Represents a buffer of value type objects interpreted as a 2D region of Width x Height elements.

public sealed class Buffer2D<T> : IDisposable where T : struct

Type Parameters

T

The value type.

Inheritance
Buffer2D<T>
Implements
Inherited Members
Extension Methods

Properties

Height

Gets the height.

public int Height { get; }

Property Value

int

this[int, int]

Gets a reference to the element at the specified position.

public ref T this[int x, int y] { get; }

Parameters

x int

The x coordinate (row)

y int

The y coordinate (position at row)

Property Value

T

A reference to the element.

Exceptions

IndexOutOfRangeException

When index is out of range of the buffer.

MemoryGroup

Gets the backing IMemoryGroup<T>.

public IMemoryGroup<T> MemoryGroup { get; }

Property Value

IMemoryGroup<T>

The MemoryGroup.

Width

Gets the width.

public int Width { get; }

Property Value

int

Methods

DangerousGetRowSpan(int)

Gets a Span<T> to the row 'y' beginning from the pixel at the first pixel on that row.

public Span<T> DangerousGetRowSpan(int y)

Parameters

y int

The row index.

Returns

Span<T>

The Span<T> of the pixels in the row.

Remarks

This method does not validate the y argument for performance reason, ArgumentOutOfRangeException is being propagated from lower levels.

Exceptions

ArgumentOutOfRangeException

Thrown when row index is out of range.

Dispose()

Disposes the Buffer2D<T> instance

public void Dispose()