OmegaEngine API  1.0.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
OmegaEngine.Values.Grid< T > Class Template Referenceabstract

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

Public Member Functions

ClampedRead (int x, int y)
 Reads a value in the grid and automatically clamps out of bound values of x or y . More...
 
void Save ([NotNull, Localizable(false)] string path)
 Saves the grid to a PNG file. More...
 
void Save ([NotNull] Stream stream)
 Saves the grid to a PNG stream. More...
 
abstract Bitmap GenerateBitmap ()
 Generates a bitmap representation of the grid. More...
 

Public Attributes

int Width => Data.GetLength(0)
 The width of the grid (number of values along the X axis). More...
 
int Height => Data.GetLength(1)
 The height of the grid (number of values along the Y axis). More...
 

Protected Member Functions

 Grid (int width, int height)
 Creates a new empty grid. More...
 
 Grid (T[,] data)
 Creates a new grid based on an existing array. More...
 

Protected Attributes

internal readonly T [,] Data
 The internal array containing the values. More...
 

Properties

virtual T this[int x, int y] [get, set]
 

Detailed Description

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

Template Parameters
TThe type of values stored in the grid.
Type Constraints
T :struct 

Constructor & Destructor Documentation

◆ Grid() [1/2]

OmegaEngine.Values.Grid< T >.Grid ( int  width,
int  height 
)
inlineprotected

Creates a new empty grid.

Parameters
widthThe width of the grid (number of values along the X axis).
heightThe height of the grid (number of values along the Y axis).

◆ Grid() [2/2]

OmegaEngine.Values.Grid< T >.Grid ( data[,])
inlineprotected

Creates a new grid based on an existing array.

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

Member Function Documentation

◆ ClampedRead()

T OmegaEngine.Values.Grid< T >.ClampedRead ( int  x,
int  y 
)

Reads a value in the grid and automatically clamps out of bound values of x or y .

◆ GenerateBitmap()

abstract Bitmap OmegaEngine.Values.Grid< T >.GenerateBitmap ( )
pure virtual

Generates a bitmap representation of the grid.

Implemented in OmegaEngine.Values.NibbleGrid, OmegaEngine.Values.ByteGrid, and OmegaEngine.Values.ByteVector4Grid.

◆ Save() [1/2]

void OmegaEngine.Values.Grid< T >.Save ( [NotNull, Localizable(false)] string  path)
inline

Saves the grid to a PNG file.

◆ Save() [2/2]

void OmegaEngine.Values.Grid< T >.Save ( [NotNull] Stream  stream)
inline

Saves the grid to a PNG stream.

Member Data Documentation

◆ Data

internal readonly T [,] OmegaEngine.Values.Grid< T >.Data
protected

The internal array containing the values.

◆ Height

int OmegaEngine.Values.Grid< T >.Height => Data.GetLength(1)

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

◆ Width

int OmegaEngine.Values.Grid< T >.Width => Data.GetLength(0)

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


The documentation for this class was generated from the following file: