Struct Buffer2DRegion<T>
Represents a rectangular region inside a 2D memory buffer (Buffer2D<T>).
Inherited Members
Namespace: SixLabors.ImageSharp.Memory
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct Buffer2DRegion<T> where T : unmanaged
Type Parameters
| Name | Description |
|---|---|
| T | The element type. |
Constructors
| Edit this page View SourceBuffer2DRegion(Buffer2D<T>)
Initializes a new instance of the Buffer2DRegion<T> struct.
Declaration
public Buffer2DRegion(Buffer2D<T> buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Buffer2D<T> | buffer | The Buffer2D<T>. |
Buffer2DRegion(Buffer2D<T>, Rectangle)
Initializes a new instance of the Buffer2DRegion<T> struct.
Declaration
public Buffer2DRegion(Buffer2D<T> buffer, Rectangle rectangle)
Parameters
| Type | Name | Description |
|---|---|---|
| Buffer2D<T> | buffer | The Buffer2D<T>. |
| Rectangle | rectangle | The Rectangle defining a rectangular area within the buffer. |
Properties
| Edit this page View SourceBuffer
Gets the Buffer2D<T> being pointed by this instance.
Declaration
public Buffer2D<T> Buffer { get; }
Property Value
| Type | Description |
|---|---|
| Buffer2D<T> |
Height
Gets the height
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| int |
Rectangle
Gets the rectangle specifying the boundaries of the area in Buffer.
Declaration
public Rectangle Rectangle { get; }
Property Value
| Type | Description |
|---|---|
| Rectangle |
Stride
Gets the pixel stride which is equal to the width of Buffer.
Declaration
public int Stride { get; }
Property Value
| Type | Description |
|---|---|
| int |
Width
Gets the width
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceDangerousGetRowSpan(int)
Gets a span to row 'y' inside this area.
Declaration
public Span<T> DangerousGetRowSpan(int y)
Parameters
| Type | Name | Description |
|---|---|---|
| int | y | The row index |
Returns
| Type | Description |
|---|---|
| Span<T> | The span |
GetSubRegion(Rectangle)
Returns a subregion as Buffer2DRegion<T>. (Similar to Slice(int, int).)
Declaration
public Buffer2DRegion<T> GetSubRegion(Rectangle rectangle)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | rectangle | The Rectangle specifying the boundaries of the subregion |
Returns
| Type | Description |
|---|---|
| Buffer2DRegion<T> | The subregion |
GetSubRegion(int, int, int, int)
Returns a subregion as Buffer2DRegion<T>. (Similar to Slice(int, int).)
Declaration
public Buffer2DRegion<T> GetSubRegion(int x, int y, int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| int | x | The x index at the subregion origin. |
| int | y | The y index at the subregion origin. |
| int | width | The desired width of the subregion. |
| int | height | The desired height of the subregion. |
Returns
| Type | Description |
|---|---|
| Buffer2DRegion<T> | The subregion |