A modifier that will generate random coloured lines on a texture. More...
#include <crackmodifier.h>
Public Types | |
enum | LengthMode { LM_Constant = 1, LM_Random = 2, LM_NormalBased = 3 } |
An enum used to set how the length of each generated crack is to be determined. More... | |
enum | QualityMode { QM_LowQuality = 1, QM_Blend = 2, QM_SubPixel = 3 } |
An enum used to set the quality. More... | |
Public Member Functions | |
CrackModifier () | |
Blank constructor. | |
virtual | ~CrackModifier () |
Class destructor. | |
virtual String | GetName () const |
Gets the name of this modifier. More... | |
virtual void | Modify (TextureBuffer &Buffer) |
Alters the generated pixels in a TextureBuffer. More... | |
CrackModifier & | SetColour (const ColourValue &Colour) |
Sets the colour of the generated cracks. More... | |
CrackModifier & | SetColour (const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0) |
Sets the colour of the generated cracks. More... | |
CrackModifier & | SetCrackCount (const Whole Count) |
Sets how many cracks to create. More... | |
CrackModifier & | SetCrackLength (const UInt8 Length) |
Sets the length of each crack that is created. May not be used verbatim. More... | |
CrackModifier & | SetCrackLengthMode (const LengthMode Length) |
Sets any additional configuration for the length of the cracks. More... | |
CrackModifier & | SetCrackQualityMode (const QualityMode Quality) |
Sets any additional configuration for the colour/sampling of the crack colour. More... | |
CrackModifier & | SetCrackVariation (const UInt8 Variation) |
Sets the amount of wobble or stutter to the cracks that are created. More... | |
CrackModifier & | SetGeneratorSeed (const Whole Seed) |
Sets the seed for the random number generator used to determine crack starting positions. More... | |
CrackModifier & | SetNormalsTexture (TextureBuffer *Normals) |
Sets the normals texture to use for generating cracks. More... | |
Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureModifier | |
TextureModifier () | |
Blank constructor. | |
virtual | ~TextureModifier () |
Class destructor. | |
Protected Attributes | |
ColourValue | CrackColour |
The base colour to give to the pixels forming the cracks. More... | |
Whole | CrackCount |
The number of cracks to generate. More... | |
UInt8 | CrackLength |
The pixel length of the cracks to be generated. More... | |
LengthMode | CrackLengthMode |
The mode in which the final length of each crack is determined. See LengthMode enum for more details. More... | |
QualityMode | CrackQualityMode |
The mode in which the colours at or near the crack are to be determined. See QualityMode enum for more details. More... | |
UInt8 | CrackVariation |
Determines the amount of "stutter" to the cracks normal curve (or non-curve depending on the parameter image). More... | |
Whole | GeneratorSeed |
The seed for the random number generator used to place the cracks. More... | |
TextureBuffer * | NormalsTexture |
The parameter image to pull normals the cracks are to move along from. Alpha channel and colours may also be used. More... | |
A modifier that will generate random coloured lines on a texture.
Crack starting points are generated randomly, and can be configured to have varying or non-varying lengths. Cracks will bend based on normals generated from the parameter image. Normals are calculated from the red and green channels exclusively. Values on the Blue channel have no effect.
Additionally the Alpha channel in the parameter image can be used to filter which pixels are allowed to generate lines. This is done internally by comparing the Alpha channel value to the normal length.
Definition at line 86 of file crackmodifier.h.
An enum used to set how the length of each generated crack is to be determined.
Definition at line 90 of file crackmodifier.h.
An enum used to set the quality.
Definition at line 97 of file crackmodifier.h.
|
virtual |
Gets the name of this modifier.
Implements Mezzanine::Graphics::Procedural::TextureModifier.
Definition at line 217 of file crackmodifier.cpp.
|
virtual |
Alters the generated pixels in a TextureBuffer.
Buffer | The buffer to be modified. |
Implements Mezzanine::Graphics::Procedural::TextureModifier.
Definition at line 97 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetColour | ( | const ColourValue & | Colour | ) |
Sets the colour of the generated cracks.
Colour | The base colour to give to the pixels forming the cracks. Initial Value: (1.0,1.0,1.0,1.0). |
Definition at line 229 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetColour | ( | const Real | Red, |
const Real | Green, | ||
const Real | Blue, | ||
const Real | Alpha = 1.0 |
||
) |
Sets the colour of the generated cracks.
Red | The amount of red to give to the pixels forming the cracks. Initial Value: 1.0. |
Green | The amount of green to give to the pixels forming the cracks. Initial Value: 1.0. |
Blue | The amount of blue to give to the pixels forming the cracks. Initial Value: 1.0. |
Alpha | The amount of alpha to give to the pixels forming the cracks. Initial Value: 1.0. |
Definition at line 235 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetCrackCount | ( | const Whole | Count | ) |
Sets how many cracks to create.
Count | The number of cracks to generate. Initial Value: 100. |
Definition at line 241 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetCrackLength | ( | const UInt8 | Length | ) |
Sets the length of each crack that is created. May not be used verbatim.
Length | The pixel length of the cracks to be generated. Initial Value: 255. |
Definition at line 259 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetCrackLengthMode | ( | const LengthMode | Length | ) |
Sets any additional configuration for the length of the cracks.
Length | The mode in which the final length of each crack is determined. See LengthMode enum for more details. Initial Value: LM_Constant. |
Definition at line 247 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetCrackQualityMode | ( | const QualityMode | Quality | ) |
Sets any additional configuration for the colour/sampling of the crack colour.
Quality | The mode in which the colours at or near the crack are to be determined. See QualityMode enum for more details. Initial Value: QM_LowQuality. |
Definition at line 253 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetCrackVariation | ( | const UInt8 | Variation | ) |
Sets the amount of wobble or stutter to the cracks that are created.
Variation | Determines the amount of "stutter" to the cracks normal curve (or non-curve depending on the parameter image). Initial Value: 64. |
Definition at line 265 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetGeneratorSeed | ( | const Whole | Seed | ) |
Sets the seed for the random number generator used to determine crack starting positions.
Seed | The seed to be used for the randomly generatated positions to place the cracks. Initial Value: 5120. |
Definition at line 271 of file crackmodifier.cpp.
CrackModifier & Mezzanine::Graphics::Procedural::CrackModifier::SetNormalsTexture | ( | TextureBuffer * | Normals | ) |
Sets the normals texture to use for generating cracks.
Normals | A pointer to the Texture to use for reading normals that cracks will be generated along. Initial Value: NULL. |
Definition at line 223 of file crackmodifier.cpp.
|
protected |
The base colour to give to the pixels forming the cracks.
Definition at line 106 of file crackmodifier.h.
|
protected |
The number of cracks to generate.
Definition at line 112 of file crackmodifier.h.
|
protected |
The pixel length of the cracks to be generated.
Definition at line 124 of file crackmodifier.h.
|
protected |
The mode in which the final length of each crack is determined. See LengthMode enum for more details.
Definition at line 118 of file crackmodifier.h.
|
protected |
The mode in which the colours at or near the crack are to be determined. See QualityMode enum for more details.
Definition at line 121 of file crackmodifier.h.
|
protected |
Determines the amount of "stutter" to the cracks normal curve (or non-curve depending on the parameter image).
Definition at line 127 of file crackmodifier.h.
|
protected |
The seed for the random number generator used to place the cracks.
Definition at line 115 of file crackmodifier.h.
|
protected |
The parameter image to pull normals the cracks are to move along from. Alpha channel and colours may also be used.
Definition at line 109 of file crackmodifier.h.