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

A modifier that will alter the basic colour properties of the texture. More...

#include <coloursmodifier.h>

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

Public Member Functions

 ColoursModifier ()
 Blank constructor.
 
virtual ~ColoursModifier ()
 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...
 
ColoursModifierSetAlpha (const UInt8 Alpha)
 Sets the alpha modifier. More...
 
ColoursModifierSetBrightness (const UInt8 Brightness)
 Sets the brightness modifier. More...
 
ColoursModifierSetColourBase (const ColourValue &Colour)
 Sets the base colour to add to the result texture. More...
 
ColoursModifierSetColourBase (const Real Red, const Real Green, const Real Blue, const Real Alpha)
 Sets the base colour to add to the result texture. More...
 
ColoursModifierSetColourPercent (const ColourValue &Colour)
 Sets the amount of colour from each channel to use in the result texture. More...
 
ColoursModifierSetColourPercent (const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0)
 Sets the amount of colour from each channel to use in the result texture. More...
 
ColoursModifierSetContrast (const UInt8 Contrast)
 Sets the contrast modifier. More...
 
ColoursModifierSetSaturation (const UInt8 Saturation)
 Sets the saturation modifier. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureModifier
 TextureModifier ()
 Blank constructor.
 
virtual ~TextureModifier ()
 Class destructor.
 

Protected Attributes

UInt8 ColourAlpha
 The modifier that will adjust the alpha channel for each pixel. More...
 
ColourValue ColourBase
 The base colour to add to the result of the original colour from the image being modified determined by the ColourPercent member. More...
 
UInt8 ColourBrightness
 The modifier that will adjust the intensity for each pixel. More...
 
UInt8 ColourContrast
 The modifier that will adjust the intensity of pixels closer or further to neutral. More...
 
ColourValue ColourPercent
 The amount of colour from each channel in the texture to be modified to keep for the result. More...
 
UInt8 ColourSaturation
 The modifier that will adjust the strongest colour channel of a pixel to be more or less extreme in each pixel. More...
 

Detailed Description

A modifier that will alter the basic colour properties of the texture.

A texture or image has properties that control the colours of the image as a whole. For this modifier these properties are Brightness, Contrast, and Saturation.

Brightness is the most straightforward, and it is essentially how close to white the colour is (1.0,1.0,1.0). The term "Brightness" can usually be interchanged with "Intensity" and/or "Luminosity" when talking about pixels on a texture. Adjusting Brightness will augment all of the colour channels in a pixel. Keep in mind that there is a maximum value for a colour channel and it will clamp to that value, not wrap. So if a colour channel is at or near is maximum value then colour of the pixel could change towards white instead of simply getting brighter.
When using this modifier Brightness values below 127 will reduce the brightness of pixels, and values above it will increase brightness.

Contrast is the distance from the most intense to the least intense pixel. Increasing contrast will cause colours that are dim to become more dim and colours that are bright to become more bright. Likewise, reducing contrast will have the opposite effect and may make more of the colours less distinct. Like brightness, a colour can also be only so dim on a given colour channel and when that limit is reached it is clamped, not wrapped. So increasing the contrast by too much may make colours be pushed closer to white or black instead of a different intensity of the same colour.
When using this modifier Contrast values below 127 will reduce the contrast of pixels, and values above it will increase contrast.

Saturation has a similar concept to Contrast, but instead of operating on brightness/intesity, it operates on individual colour channels. Increasing saturation causes the dominate colour channel in a given pixel to be increased, and weaker channels either left the same or weakened depending on their individual values. As you might expect by now, reducing saturation has the opposite effect. Images with high saturation tend to look more vibrant, but also a bit less realistic.
When using this modifier Saturation values below 127 will reduce the saturation of pixels, and values above it will increase saturation.

Definition at line 96 of file coloursmodifier.h.

Member Function Documentation

String Mezzanine::Graphics::Procedural::ColoursModifier::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 142 of file coloursmodifier.cpp.

void Mezzanine::Graphics::Procedural::ColoursModifier::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 95 of file coloursmodifier.cpp.

ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetAlpha ( const UInt8  Alpha)

Sets the alpha modifier.

Parameters
AlphaThe modifier that will adjust the alpha channel for each pixel. Initial Value: 127.
Returns
Returns a reference to this.

Definition at line 190 of file coloursmodifier.cpp.

ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetBrightness ( const UInt8  Brightness)

Sets the brightness modifier.

Parameters
BrightnessThe modifier that will adjust the intensity for each pixel. Initial Value: 127.
Returns
Returns a reference to this.

Definition at line 172 of file coloursmodifier.cpp.

ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetColourBase ( const ColourValue Colour)

Sets the base colour to add to the result texture.

Parameters
ColourThe base colour to add to the result of the original colour from the image being modified determined by the ColourPercent member. Initial Value: (0.0,0.0,0.0,1.0).
Returns
Returns a reference to this.

Definition at line 148 of file coloursmodifier.cpp.

ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetColourBase ( const Real  Red,
const Real  Green,
const Real  Blue,
const Real  Alpha 
)

Sets the base colour to add to the result texture.

Parameters
RedThe amount of base red to add to the result of the original colour from the image being modified determined by the ColourPercent member. Initial Value: 0.0.
GreenThe amount of base green to add to the result of the original colour from the image being modified determined by the ColourPercent member. Initial Value: 0.0.
BlueThe amount of base blue to add to the result of the original colour from the image being modified determined by the ColourPercent member. Initial Value: 0.0.
AlphaThe amount of base alpha to add to the result of the original colour from the image being modified determined by the ColourPercent member. Initial Value: 1.0.
Returns
Returns a reference to this.

Definition at line 154 of file coloursmodifier.cpp.

ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetColourPercent ( const ColourValue Colour)

Sets the amount of colour from each channel to use in the result texture.

Parameters
ColourThe amount of colour from each channel in the texture to be modified to keep for the result. Initial Value: (1.0,1.0,1.0,1.0).
Returns
Returns a reference to this.

Definition at line 160 of file coloursmodifier.cpp.

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

Sets the amount of colour from each channel to use in the result texture.

Parameters
RedThe amount of red in the texture to be modified to keep for the result. Initial Value: 1.0.
GreenThe amount of green in the texture to be modified to keep for the result. Initial Value: 1.0.
BlueThe amount of blue in the texture to be modified to keep for the result. Initial Value: 1.0.
AlphaThe amount of alpha in the texture to be modified to keep for the result. Initial Value: 1.0.
Returns
Returns a reference to this.

Definition at line 166 of file coloursmodifier.cpp.

ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetContrast ( const UInt8  Contrast)

Sets the contrast modifier.

Parameters
ContrastThe modifier that will adjust the intensity of pixels closer or further to neutral. Initial Value: 127.
Returns
Returns a reference to this.

Definition at line 178 of file coloursmodifier.cpp.

ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetSaturation ( const UInt8  Saturation)

Sets the saturation modifier.

Parameters
SaturationThe modifier that will adjust the strongest colour channel of a pixel to be more or less extreme in each pixel. Initial Value: 127.
Returns
Returns a reference to this.

Definition at line 184 of file coloursmodifier.cpp.

Member Data Documentation

UInt8 Mezzanine::Graphics::Procedural::ColoursModifier::ColourAlpha
protected

The modifier that will adjust the alpha channel for each pixel.

Definition at line 116 of file coloursmodifier.h.

ColourValue Mezzanine::Graphics::Procedural::ColoursModifier::ColourBase
protected

The base colour to add to the result of the original colour from the image being modified determined by the ColourPercent member.

Definition at line 101 of file coloursmodifier.h.

UInt8 Mezzanine::Graphics::Procedural::ColoursModifier::ColourBrightness
protected

The modifier that will adjust the intensity for each pixel.

Definition at line 107 of file coloursmodifier.h.

UInt8 Mezzanine::Graphics::Procedural::ColoursModifier::ColourContrast
protected

The modifier that will adjust the intensity of pixels closer or further to neutral.

Definition at line 110 of file coloursmodifier.h.

ColourValue Mezzanine::Graphics::Procedural::ColoursModifier::ColourPercent
protected

The amount of colour from each channel in the texture to be modified to keep for the result.

Definition at line 104 of file coloursmodifier.h.

UInt8 Mezzanine::Graphics::Procedural::ColoursModifier::ColourSaturation
protected

The modifier that will adjust the strongest colour channel of a pixel to be more or less extreme in each pixel.

Definition at line 113 of file coloursmodifier.h.


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