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 : struct
Type Parameters
Name | Description |
---|---|
T | The element type. |
Constructors
| Improve this Doc 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
| Improve this Doc View SourceBuffer
Gets the Buffer2D<T> being pointed by this instance.
Declaration
public readonly Buffer2D<T> Buffer { get; }
Property Value
Type | Description |
---|---|
Buffer2D<T> |
Height
Gets the height
Declaration
public readonly int Height { get; }
Property Value
Type | Description |
---|---|
Int32 |
Rectangle
Gets the rectangle specifying the boundaries of the area in Buffer.
Declaration
public readonly Rectangle Rectangle { get; }
Property Value
Type | Description |
---|---|
Rectangle |
Stride
Gets the pixel stride which is equal to the width of Buffer.
Declaration
public readonly int Stride { get; }
Property Value
Type | Description |
---|---|
Int32 |
Width
Gets the width
Declaration
public readonly int Width { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceDangerousGetRowSpan(Int32)
Gets a span to row 'y' inside this area.
Declaration
public readonly Span<T> DangerousGetRowSpan(int y)
Parameters
Type | Name | Description |
---|---|---|
Int32 | y | The row index |
Returns
Type | Description |
---|---|
Span<T> | The span |
GetSubRegion(Rectangle)
Returns a subregion as Buffer2DRegion<T>. (Similar to Slice(Int32, Int32).)
Declaration
public readonly 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(Int32, Int32, Int32, Int32)
Returns a subregion as Buffer2DRegion<T>. (Similar to Slice(Int32, Int32).)
Declaration
public readonly Buffer2DRegion<T> GetSubRegion(int x, int y, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | The x index at the subregion origin. |
Int32 | y | The y index at the subregion origin. |
Int32 | width | The desired width of the subregion. |
Int32 | height | The desired height of the subregion. |
Returns
Type | Description |
---|---|
Buffer2DRegion<T> | The subregion |