Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Procedural::CellGenerator Class Reference

Create a texture consisting of cells aligned in a grid, or a chessboard. More...

#include <cellgenerator.h>

+ Inheritance diagram for Mezzanine::Graphics::Procedural::CellGenerator:
+ Collaboration diagram for Mezzanine::Graphics::Procedural::CellGenerator:

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...
 
CellGeneratorSetColour (const ColourValue &Colour)
 Sets the colour of the interior of the cells. More...
 
CellGeneratorSetColour (const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0)
 Sets the colour of the interior of the cells. More...
 
CellGeneratorSetDensity (const Whole Density)
 Set the density of cells in texture. More...
 
CellGeneratorSetMode (const CellMode Mode)
 Set the cell mode of texture. More...
 
CellGeneratorSetPattern (const CellPattern Pattern)
 Set the cell pattern of texture. More...
 
CellGeneratorSetRegularity (const UInt8 Regularity)
 Set the regularity of texture. More...
 
CellGeneratorSetSeed (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...
 
ImageGenerateImage (const Whole SquareSize, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const
 Generates the Image. More...
 
ImageGenerateImage (const Whole TexWidth, const Whole TexHeight, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const
 Generates the Image. More...
 
TextureGenerateTexture (const Whole SquareSize, const String &TexName, const String &TexGroup, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const
 Generates the Texture. More...
 
TextureGenerateTexture (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...
 

Detailed Description

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.

Member Enumeration Documentation

An enum to describe how the cells are layed out.

Enumerator
CM_Grid 

Cells are layed out in a normal grid pattern with their centers coloured in according to the set CellPattern.

CM_Chessboard 

Cells are layed out in a normal grid pattern, but will alternate the cell colour and background colour with each successive cell.

Definition at line 86 of file cellgenerator.h.

An enum to describe how the cells are coloured.

Enumerator
CP_Both 

Combines CP_Cross and CP_Cone.

CP_Cross 

Colours in the centers of each cell such that there is a cross connecting each of the four corners with increasing colour intensity towards the middle.

CP_Cone 

Colours in the centers of each cell such that there is a circle in the middle with increasing colour intensity towards the middle.

Definition at line 92 of file cellgenerator.h.

Member Function Documentation

void Mezzanine::Graphics::Procedural::CellGenerator::AddToTextureBuffer ( TextureBuffer Buffer) const
virtual

Replaces and populates the pixels as configured in this generator to a TextureBuffer.

Parameters
BufferThe buffer to place this generators pixels in.

Implements Mezzanine::Graphics::Procedural::TextureGenerator.

Definition at line 96 of file cellgenerator.cpp.

String Mezzanine::Graphics::Procedural::CellGenerator::GetName ( ) const
virtual

Gets the name of this generator.

Returns
Returns a String containing 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.

Parameters
ColourThe colour of the interior of the cells generated.
Returns
Returns a reference to this.

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.

Parameters
RedThe Red component for the cell top colour. Range: [0.0, 1.0].
GreenThe Green component for the cell top colour. Range: [0.0, 1.0].
BlueThe Blue component for the cell top colour. Range: [0.0, 1.0].
AlphaThe Alpha component for the cell top colour. Range: [0.0, 1.0].
Returns
Returns a reference to this.

Definition at line 215 of file cellgenerator.cpp.

CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetDensity ( const Whole  Density)

Set the density of cells in texture.

Remarks
This number needs to be > 0.
Parameters
DensityThe number of oclumns and rows of cells to be generated. Initial Value: 8.
Returns
Returns a reference to this.

Definition at line 233 of file cellgenerator.cpp.

CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetMode ( const CellMode  Mode)

Set the cell mode of texture.

Parameters
ModeThe mode describing how the cells will be layed out. Initial Value: CM_Grid.
Returns
Returns a reference to this.

Definition at line 239 of file cellgenerator.cpp.

CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetPattern ( const CellPattern  Pattern)

Set the cell pattern of texture.

Parameters
PatternThe pattern describing how the cells will be coloured. Initial Value: CP_Both.
Returns
Returns a reference to this.

Definition at line 245 of file cellgenerator.cpp.

CellGenerator & Mezzanine::Graphics::Procedural::CellGenerator::SetRegularity ( const UInt8  Regularity)

Set the regularity of texture.

Remarks
The maximum value of 255 creates identical cells. The minimum 0 creates random forms for each cells.
Parameters
RegularityA value between 1 and 255 that determines how uniform the cells are. Initial Value: 128.
Returns
Returns a reference to this.

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.

Parameters
SeedThe seed value for the random number generator. Initial Value: 5120.
Returns
Returns a reference to this.

Definition at line 221 of file cellgenerator.cpp.

Member Data Documentation

ColourValue Mezzanine::Graphics::Procedural::CellGenerator::GenColour
protected

The colour of the interior of the cells generated.

Definition at line 101 of file cellgenerator.h.

Whole Mezzanine::Graphics::Procedural::CellGenerator::GenDensity
protected

The number of oclumns and rows of cells to be generated.

Definition at line 110 of file cellgenerator.h.

CellMode Mezzanine::Graphics::Procedural::CellGenerator::GenMode
protected

Describes how the cells are layed out.

Definition at line 113 of file cellgenerator.h.

CellPattern Mezzanine::Graphics::Procedural::CellGenerator::GenPattern
protected

Describes how the cells are coloured.

Definition at line 116 of file cellgenerator.h.

Whole Mezzanine::Graphics::Procedural::CellGenerator::GenRegularity
protected

A value between 1 and 255 that determines how uniform the cells are.

Definition at line 107 of file cellgenerator.h.

Whole Mezzanine::Graphics::Procedural::CellGenerator::GenSeed
protected

The seed to be used for the random number generator.

Definition at line 104 of file cellgenerator.h.


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