Class Buffer2D<T>
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Memory
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class Buffer2D<T> : IDisposable where T : struct
Type Parameters
Name | Description |
---|---|
T | The value type. |
Remarks
Before RC1, this class might be target of API changes, use it on your own risk!
Properties
| Improve this Doc View SourceHeight
Gets the height.
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
Int32 |
Item[Int32, Int32]
Gets a reference to the element at the specified position.
Declaration
public ref T this[int x, int y] { get; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | The x coordinate (row) |
Int32 | y | The y coordinate (position at row) |
Property Value
Type | Description |
---|---|
T | A reference to the element. |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When index is out of range of the buffer. |
MemoryGroup
Gets the backing IMemoryGroup<T>.
Declaration
public IMemoryGroup<T> MemoryGroup { get; }
Property Value
Type | Description |
---|---|
IMemoryGroup<T> | The MemoryGroup. |
Width
Gets the width.
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceDangerousGetRowSpan(Int32)
Gets a Span<T> to the row 'y' beginning from the pixel at the first pixel on that row.
Declaration
public Span<T> DangerousGetRowSpan(int y)
Parameters
Type | Name | Description |
---|---|---|
Int32 | y | The row index. |
Returns
Type | Description |
---|---|
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
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when row index is out of range. |
Dispose()
Disposes the Buffer2D<T> instance
Declaration
public void Dispose()