Table of Contents

Class ByteGrid

Namespace
OmegaEngine.Foundation.Geometry
Assembly
OmegaEngine.Foundation.dll

A 2D grid of byte values that can be stored in grayscale PNG files.

public class ByteGrid : Grid<byte>
Inheritance
ByteGrid
Inherited Members
Extension Methods

Constructors

ByteGrid(byte[,])

A 2D grid of values that can be stored in PNG files.

public ByteGrid(byte[,] data)

Parameters

data byte[,]

Used as the internal array (no defensive copy). Do not modify once passing in!

ByteGrid(int, int)

Creates a new empty grid.

public ByteGrid(int width, int height)

Parameters

width int

The width of the grid (number of values along the X axis).

height int

The height of the grid (number of values along the Y axis).

Methods

GenerateBitmap()

Generates a bitmap representation of the grid.

public override Bitmap GenerateBitmap()

Returns

Bitmap

IsInRange(float, float)

Returns true if the specified coordinates are within the bounds of the grid.

[Pure]
public bool IsInRange(float x, float y)

Parameters

x float
y float

Returns

bool

Load(Stream)

Loads a grid from a PNG stream.

public static ByteGrid Load(Stream stream)

Parameters

stream Stream

Returns

ByteGrid

SampledRead(float, float)

Performs bilinear interpolation to get values lying between discrete grid points.

[Pure]
public float SampledRead(float x, float y)

Parameters

x float
y float

Returns

float