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

A modifier that will set a pixels colour if it's intensity is outside a set threshold. More...

#include <thresholdmodifier.h>

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

Public Types

enum  ReplaceMode { RM_PixelIntensity = 1, RM_ColourChannels = 2 }
 An enum to describe with what granularity pixels will be checked and replaced. More...
 
enum  ThresholdMode { TM_Above = 1, TM_Below = 2, TM_OutsideRange = TM_Below | TM_Above }
 An enum to describe when to replace the colour of a pixel. More...
 

Public Member Functions

 ThresholdModifier ()
 Blank constructor.
 
virtual ~ThresholdModifier ()
 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...
 
ThresholdModifierSetColour (const ColourValue &Colour)
 Sets the colour to use if a pixel is outside the set threshold. More...
 
ThresholdModifierSetColour (const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0)
 Sets the colour to use if a pixel is outside the set threshold. More...
 
ThresholdModifierSetLimitRange (const Real Lower, const Real Upper)
 Sets the lower and upper limit of the threshold. More...
 
ThresholdModifierSetLowerLimit (const Real Lower)
 Sets the lower limit of the threshold. More...
 
ThresholdModifierSetReplaceMode (const ReplaceMode Mode)
 Sets the components of the pixel to be replaced. More...
 
ThresholdModifierSetThresholdMode (const ThresholdMode Mode)
 Sets which limits are to be considered for the threshold. More...
 
ThresholdModifierSetUpperLimit (const Real Upper)
 Sets the upper limit of the threshold. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureModifier
 TextureModifier ()
 Blank constructor.
 
virtual ~TextureModifier ()
 Class destructor.
 

Protected Attributes

Real LowerLimit
 The lower limit of the threshold to check for. More...
 
UInt16 Replace
 The mode that determines the granularity of checks to be performed. More...
 
UInt16 Threshold
 The mode that determines which limits are used for the allowed threshold. More...
 
ColourValue ThresholdColour
 The colour to apply if the pixel is outside the allowed threshold. More...
 
Real UpperLimit
 The upper limit of the threshold to check for. More...
 

Detailed Description

A modifier that will set a pixels colour if it's intensity is outside a set threshold.

Definition at line 82 of file thresholdmodifier.h.

Member Enumeration Documentation

An enum to describe with what granularity pixels will be checked and replaced.

Enumerator
RM_PixelIntensity 

Checks against the total intensity of the pixel and will replace the entire pixel if it is outside the set threshold.

RM_ColourChannels 

Checks each colour channel, and will replace just the colour channels that are outside the set threshold.

Definition at line 93 of file thresholdmodifier.h.

An enum to describe when to replace the colour of a pixel.

Enumerator
TM_Above 

Uses only the upper limit. Any pixel with an intensity above the set upper limit will be replaced.

TM_Below 

Uses only the lower limit. Any pixel with an intensity below the set lower limit will be replaced.

TM_OutsideRange 

Uses both the upper and lower limits. Any pixel with an intensity outside their range will be replaced.

Definition at line 86 of file thresholdmodifier.h.

Member Function Documentation

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

Gets the name of this modifier.

Returns
Returns a string containing the name of this modifier.

Implements Mezzanine::Graphics::Procedural::TextureModifier.

Definition at line 134 of file thresholdmodifier.cpp.

void Mezzanine::Graphics::Procedural::ThresholdModifier::Modify ( TextureBuffer Buffer)
virtual

Alters the generated pixels in a TextureBuffer.

Parameters
BufferThe buffer to be modified.

Implements Mezzanine::Graphics::Procedural::TextureModifier.

Definition at line 92 of file thresholdmodifier.cpp.

ThresholdModifier & Mezzanine::Graphics::Procedural::ThresholdModifier::SetColour ( const ColourValue Colour)

Sets the colour to use if a pixel is outside the set threshold.

Parameters
ColourThe colour to apply if the pixel intensity is outside the allowed threshold. Initial Value: (0.0,0.0,0.0,1.0).
Returns
Returns a reference to this.

Definition at line 140 of file thresholdmodifier.cpp.

ThresholdModifier & Mezzanine::Graphics::Procedural::ThresholdModifier::SetColour ( const Real  Red,
const Real  Green,
const Real  Blue,
const Real  Alpha = 1.0 
)

Sets the colour to use if a pixel is outside the set threshold.

Parameters
RedThe amount of Red to apply if the pixel intensity is outside the allowed threshold. Initial Value: 0.0.
GreenThe amount of Green to apply if the pixel intensity is outside the allowed threshold. Initial Value: 0.0.
BlueThe amount of Blue to apply if the pixel intensity is outside the allowed threshold. Initial Value: 0.0.
AlphaThe amount of Alpha to apply if the pixel intensity is outside the allowed threshold. Initial Value: 1.0.
Returns
Returns a reference to this.

Definition at line 143 of file thresholdmodifier.cpp.

ThresholdModifier & Mezzanine::Graphics::Procedural::ThresholdModifier::SetLimitRange ( const Real  Lower,
const Real  Upper 
)

Sets the lower and upper limit of the threshold.

Parameters
LowerThe lower limit of the threshold to check for. Initial Value: 0.0.
UpperThe upper limit of the threshold to check for. Initial Value: 1.0.
Returns
Returns a reference to this.

Definition at line 152 of file thresholdmodifier.cpp.

ThresholdModifier & Mezzanine::Graphics::Procedural::ThresholdModifier::SetLowerLimit ( const Real  Lower)

Sets the lower limit of the threshold.

Parameters
LowerThe lower limit of the threshold to check for. Initial Value: 0.0.
Returns
Returns a reference to this.

Definition at line 146 of file thresholdmodifier.cpp.

ThresholdModifier & Mezzanine::Graphics::Procedural::ThresholdModifier::SetReplaceMode ( const ReplaceMode  Mode)

Sets the components of the pixel to be replaced.

Parameters
ModeThe mode that determines the granularity of checks to be performed. Initial Value: RM_PixelIntensity.
Returns
Returns a reference to this.

Definition at line 158 of file thresholdmodifier.cpp.

ThresholdModifier & Mezzanine::Graphics::Procedural::ThresholdModifier::SetThresholdMode ( const ThresholdMode  Mode)

Sets which limits are to be considered for the threshold.

Parameters
ModeThe mode that determines which limits are used for the allowed threshold. Initial Value: TM_Below.
Returns
Returns a reference to this.

Definition at line 155 of file thresholdmodifier.cpp.

ThresholdModifier & Mezzanine::Graphics::Procedural::ThresholdModifier::SetUpperLimit ( const Real  Upper)

Sets the upper limit of the threshold.

Parameters
UpperThe upper limit of the threshold to check for. Initial Value: 1.0.
Returns
Returns a reference to this.

Definition at line 149 of file thresholdmodifier.cpp.

Member Data Documentation

Real Mezzanine::Graphics::Procedural::ThresholdModifier::LowerLimit
protected

The lower limit of the threshold to check for.

Definition at line 104 of file thresholdmodifier.h.

UInt16 Mezzanine::Graphics::Procedural::ThresholdModifier::Replace
protected

The mode that determines the granularity of checks to be performed.

Definition at line 113 of file thresholdmodifier.h.

UInt16 Mezzanine::Graphics::Procedural::ThresholdModifier::Threshold
protected

The mode that determines which limits are used for the allowed threshold.

Definition at line 110 of file thresholdmodifier.h.

ColourValue Mezzanine::Graphics::Procedural::ThresholdModifier::ThresholdColour
protected

The colour to apply if the pixel is outside the allowed threshold.

Definition at line 101 of file thresholdmodifier.h.

Real Mezzanine::Graphics::Procedural::ThresholdModifier::UpperLimit
protected

The upper limit of the threshold to check for.

Definition at line 107 of file thresholdmodifier.h.


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