PixelRowSource<TPixel> Struct

  • Obsolete: Types with embedded references are not supported in this version of your compiler.

Read-only access to the rows of a frame as they were before a neighborhood operation, valid only during IPixelNeighborhoodOperation<TPixel>.Invoke.

[Obsolete("Types with embedded references are not supported in this version of your compiler.", true)]
public readonly ref struct PixelRowSource<TPixel> where TPixel : unmanaged

Type parameters

TPixel
The pixel type of the rows.

Remarks

The rows are a copy of the frame, so they never show the rows the operation already wrote. Each row contains exactly PixelRowSource<TPixel>.Width pixels; consecutive rows are not guaranteed to be adjacent in memory. A default instance has no rows.

Properties

NameDescription
HeightGets the number of rows.
WidthGets the number of pixels per row.

Gets the number of rows.

public int Height { get; }

Property value

int

Gets the number of pixels per row.

public int Width { get; }

Property value

int

Methods

NameDescription
GetRow(int)Gets a row.
GetRowClamped(int)Gets a row, the nearest one when the index is outside the frame (the edge rows are repeated).

Gets a row.

public ReadOnlySpan<TPixel> GetRow(int y)

Parameters

y int
The row index, from 0 to Height - 1.

Returns

ReadOnlySpan<TPixel> A span of exactly PixelRowSource<TPixel>.Width pixels, valid until the operation returns.

Exceptions

ArgumentOutOfRangeException
y is out of range.
InvalidOperationException
The operation that received the source has returned.

GetRowClamped(int)

PixelRowSource{TPixel}.cs

Gets a row, the nearest one when the index is outside the frame (the edge rows are repeated).

public ReadOnlySpan<TPixel> GetRowClamped(int y)

Parameters

y int
The row index, which may be negative or past the last row.

Returns

ReadOnlySpan<TPixel> A span of exactly PixelRowSource<TPixel>.Width pixels, valid until the operation returns.

Exceptions

InvalidOperationException
The operation that received the source has returned.