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
databyte[,]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
widthintThe width of the grid (number of values along the X axis).
heightintThe 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
streamStream
Returns
SampledRead(float, float)
Performs bilinear interpolation to get values lying between discrete grid points.
public float SampledRead(float x, float y)