Table of Contents

Delegate RowAction<TPixel>

Namespace
Egami
Assembly
Egami.dll

Processes one row of pixels.

public delegate void RowAction<TPixel>(Span<TPixel> row, int y) where TPixel : unmanaged, IPixelType<TPixel>

Parameters

row Span<TPixel>

The row's pixels. Valid only during the call.

y int

The row index.

Type Parameters

TPixel

The pixel type.

Examples

using Raster<Rgba8> image = Raster.Create<Rgba8>(256, 64);

// A horizontal gradient; rows run in parallel, each row is a Span over the pixels.
image.ForEachRow((row, y) =>
{
    for (int x = 0; x < row.Length; x++)
    {
        row[x] = new Rgba8((byte)x, (byte)(y * 4), 128, 255);
    }
});