A modifier that will alter the basic colour properties of the texture. More...
#include <coloursmodifier.h>
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... | |
ColoursModifier & | SetAlpha (const UInt8 Alpha) |
Sets the alpha modifier. More... | |
ColoursModifier & | SetBrightness (const UInt8 Brightness) |
Sets the brightness modifier. More... | |
ColoursModifier & | SetColourBase (const ColourValue &Colour) |
Sets the base colour to add to the result texture. More... | |
ColoursModifier & | SetColourBase (const Real Red, const Real Green, const Real Blue, const Real Alpha) |
Sets the base colour to add to the result texture. More... | |
ColoursModifier & | SetColourPercent (const ColourValue &Colour) |
Sets the amount of colour from each channel to use in the result texture. More... | |
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. More... | |
ColoursModifier & | SetContrast (const UInt8 Contrast) |
Sets the contrast modifier. More... | |
ColoursModifier & | SetSaturation (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... | |
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.
|
virtual |
Gets the name of this modifier.
Implements Mezzanine::Graphics::Procedural::TextureModifier.
Definition at line 142 of file coloursmodifier.cpp.
|
virtual |
Alters the generated pixels in a TextureBuffer.
Buffer | The 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.
Alpha | The modifier that will adjust the alpha channel for each pixel. Initial Value: 127. |
Definition at line 190 of file coloursmodifier.cpp.
ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetBrightness | ( | const UInt8 | Brightness | ) |
Sets the brightness modifier.
Brightness | The modifier that will adjust the intensity for each pixel. Initial Value: 127. |
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.
Colour | The 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). |
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.
Red | The 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. |
Green | The 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. |
Blue | The 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. |
Alpha | The 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. |
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.
Colour | The 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). |
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.
Red | The amount of red in the texture to be modified to keep for the result. Initial Value: 1.0. |
Green | The amount of green in the texture to be modified to keep for the result. Initial Value: 1.0. |
Blue | The amount of blue in the texture to be modified to keep for the result. Initial Value: 1.0. |
Alpha | The amount of alpha in the texture to be modified to keep for the result. Initial Value: 1.0. |
Definition at line 166 of file coloursmodifier.cpp.
ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetContrast | ( | const UInt8 | Contrast | ) |
Sets the contrast modifier.
Contrast | The modifier that will adjust the intensity of pixels closer or further to neutral. Initial Value: 127. |
Definition at line 178 of file coloursmodifier.cpp.
ColoursModifier & Mezzanine::Graphics::Procedural::ColoursModifier::SetSaturation | ( | const UInt8 | Saturation | ) |
Sets the saturation modifier.
Saturation | The modifier that will adjust the strongest colour channel of a pixel to be more or less extreme in each pixel. Initial Value: 127. |
Definition at line 184 of file coloursmodifier.cpp.
|
protected |
The modifier that will adjust the alpha channel for each pixel.
Definition at line 116 of file coloursmodifier.h.
|
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.
|
protected |
The modifier that will adjust the intensity for each pixel.
Definition at line 107 of file coloursmodifier.h.
|
protected |
The modifier that will adjust the intensity of pixels closer or further to neutral.
Definition at line 110 of file coloursmodifier.h.
|
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.
|
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.