Create a texture consisting of cells aligned in a grid, or a chessboard. More...
#include <cellgenerator.h>
Public Types | |
enum | CellMode { CM_Grid, CM_Chessboard } |
An enum to describe how the cells are layed out. More... | |
enum | CellPattern { CP_Both, CP_Cross, CP_Cone } |
An enum to describe how the cells are coloured. More... | |
Public Member Functions | |
CellGenerator () | |
Class constructor. | |
virtual | ~CellGenerator () |
Class destructor. | |
virtual void | AddToTextureBuffer (TextureBuffer &Buffer) const |
Replaces and populates the pixels as configured in this generator to a TextureBuffer. More... | |
virtual String | GetName () const |
Gets the name of this generator. More... | |
CellGenerator & | SetColour (const ColourValue &Colour) |
Sets the colour of the interior of the cells. More... | |
CellGenerator & | SetColour (const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0) |
Sets the colour of the interior of the cells. More... | |
CellGenerator & | SetDensity (const Whole Density) |
Set the density of cells in texture. More... | |
CellGenerator & | SetMode (const CellMode Mode) |
Set the cell mode of texture. More... | |
CellGenerator & | SetPattern (const CellPattern Pattern) |
Set the cell pattern of texture. More... | |
CellGenerator & | SetRegularity (const UInt8 Regularity) |
Set the regularity of texture. More... | |
CellGenerator & | SetSeed (const Whole Seed) |
Sets the seed for the "random" number generator. More... | |
Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureGenerator | |
TextureGenerator () | |
Blank constructor. | |
virtual | ~TextureGenerator () |
Class destructor. | |
TextureBuffer | BuildTextureBuffer (const Whole SquareSize) const |
Creates a TextureBuffer with the pixels as configured in this generator. More... | |
TextureBuffer | BuildTextureBuffer (const Whole TexWidth, const Whole TexHeight) const |
Creates a TextureBuffer with the pixels as configured in this generator. More... | |
Image * | GenerateImage (const Whole SquareSize, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const |
Generates the Image. More... | |
Image * | GenerateImage (const Whole TexWidth, const Whole TexHeight, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const |
Generates the Image. More... | |
Texture * | GenerateTexture (const Whole SquareSize, const String &TexName, const String &TexGroup, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const |
Generates the Texture. More... | |
Texture * | GenerateTexture (const Whole TexWidth, const Whole TexHeight, const String &TexName, const String &TexGroup, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const |
Generates the Texture. More... | |
Protected Attributes | |
ColourValue | GenColour |
The colour of the interior of the cells generated. More... | |
Whole | GenDensity |
The number of oclumns and rows of cells to be generated. More... | |
CellMode | GenMode |
Describes how the cells are layed out. More... | |
CellPattern | GenPattern |
Describes how the cells are coloured. More... | |
Whole | GenRegularity |
A value between 1 and 255 that determines how uniform the cells are. More... | |
Whole | GenSeed |
The seed to be used for the random number generator. More... | |
Create a texture consisting of cells aligned in a grid, or a chessboard.
Cells can be irregular. If considered bump map, they have pyramid form.
Definition at line 82 of file cellgenerator.h.
An enum to describe how the cells are layed out.
Definition at line 86 of file cellgenerator.h.
An enum to describe how the cells are coloured.
Definition at line 92 of file cellgenerator.h.
|
virtual |
Replaces and populates the pixels as configured in this generator to a TextureBuffer.
Buffer | The buffer to place this generators pixels in. |
Implements Mezzanine::Graphics::Procedural::TextureGenerator.
Definition at line 96 of file cellgenerator.cpp.
|
virtual |
Gets the name of this generator.
Implements Mezzanine::Graphics::Procedural::TextureGenerator.
Definition at line 203 of file cellgenerator.cpp.
CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetColour | ( | const ColourValue & | Colour | ) |
Sets the colour of the interior of the cells.
Colour | The colour of the interior of the cells generated. |
Definition at line 209 of file cellgenerator.cpp.
CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetColour | ( | const Real | Red, |
const Real | Green, | ||
const Real | Blue, | ||
const Real | Alpha = 1.0 |
||
) |
Sets the colour of the interior of the cells.
Red | The Red component for the cell top colour. Range: [0.0, 1.0]. |
Green | The Green component for the cell top colour. Range: [0.0, 1.0]. |
Blue | The Blue component for the cell top colour. Range: [0.0, 1.0]. |
Alpha | The Alpha component for the cell top colour. Range: [0.0, 1.0]. |
Definition at line 215 of file cellgenerator.cpp.
CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetDensity | ( | const Whole | Density | ) |
Set the density of cells in texture.
Density | The number of oclumns and rows of cells to be generated. Initial Value: 8. |
Definition at line 233 of file cellgenerator.cpp.
CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetMode | ( | const CellMode | Mode | ) |
Set the cell mode of texture.
Mode | The mode describing how the cells will be layed out. Initial Value: CM_Grid. |
Definition at line 239 of file cellgenerator.cpp.
CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetPattern | ( | const CellPattern | Pattern | ) |
Set the cell pattern of texture.
Pattern | The pattern describing how the cells will be coloured. Initial Value: CP_Both. |
Definition at line 245 of file cellgenerator.cpp.
CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetRegularity | ( | const UInt8 | Regularity | ) |
Set the regularity of texture.
Regularity | A value between 1 and 255 that determines how uniform the cells are. Initial Value: 128. |
Definition at line 227 of file cellgenerator.cpp.
CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetSeed | ( | const Whole | Seed | ) |
Sets the seed for the "random" number generator.
Seed | The seed value for the random number generator. Initial Value: 5120. |
Definition at line 221 of file cellgenerator.cpp.
|
protected |
The colour of the interior of the cells generated.
Definition at line 101 of file cellgenerator.h.
|
protected |
The number of oclumns and rows of cells to be generated.
Definition at line 110 of file cellgenerator.h.
|
protected |
Describes how the cells are layed out.
Definition at line 113 of file cellgenerator.h.
|
protected |
Describes how the cells are coloured.
Definition at line 116 of file cellgenerator.h.
|
protected |
A value between 1 and 255 that determines how uniform the cells are.
Definition at line 107 of file cellgenerator.h.
|
protected |
The seed to be used for the random number generator.
Definition at line 104 of file cellgenerator.h.