OmegaEngine API  1.0.3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Public Attributes | Protected Member Functions | Package 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...

Inheritance diagram for OmegaEngine.Values.Grid< T >:
OmegaEngine.Values.ByteGrid OmegaEngine.Values.ByteVector4Grid OmegaEngine.Values.NibbleGrid

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...
 

Package Attributes

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

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).
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

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 .

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.

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

Saves the grid to a PNG file.

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

Saves the grid to a PNG stream.

Member Data Documentation

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

The internal array containing the values.

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

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

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: