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[,])
Creates a new grid based on an existing array.
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
intThe width of the grid (number of values along the X axis).
height
intThe 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
IsInRange(float, float)
Returns true
if the specified coordinates are within the bounds of the grid.
public bool IsInRange(float x, float y)
Parameters
Returns
Load(Stream)
Loads a grid from a PNG stream.
public static ByteGrid Load(Stream stream)
Parameters
stream
Stream
Returns
SampledRead(float, float)
Performs bilinear interpolation to get values lying between discrete grid points.
public float SampledRead(float x, float y)