A modifier that will attempt to combine the content of multiple textures. More...
#include <combinemodifier.h>
Public Types | |
typedef std::vector< CombineLayer > | CombineLayerContainer |
Basic container type for CombineLayer storage by this class. | |
typedef CombineLayerContainer::iterator | CombineLayerIterator |
Iterator type for CombineLayer instances stored by this class. | |
enum | CombineMode { CM_Add_Clamp = 1, CM_Add_Wrap = 2, CM_Sub_Clamp = 3, CM_Sub_Wrap = 4, CM_Multiply = 5, CM_Multiply_Double = 6, CM_Blend = 7, CM_Alpha = 8, CM_Layer = 9 } |
An enum used to describe how a texture is to be combined with the other textures in the queue. More... | |
typedef CombineLayerContainer::const_iterator | ConstCombineLayerIterator |
Const Iterator type for CombineLayer instances stored by this class. | |
Public Member Functions | |
CombineModifier () | |
Blank constructor. | |
virtual | ~CombineModifier () |
Class destructor. | |
CombineModifier & | AddTexture (TextureBuffer *Layer, const CombineMode Mode) |
Adds a texture to the end of the sequence to be processed. More... | |
virtual String | GetName () const |
Gets the name of this modifier. More... | |
virtual void | Modify (TextureBuffer &Buffer) |
Alters the generated pixels in a TextureBuffer. More... | |
CombineModifier & | RemoveAllTextures () |
Removes all textures from all layers. More... | |
CombineModifier & | SetFilterColour (const ColourValue &Colour) |
Sets which colour channels to filter (and by how much) from each layer texture. More... | |
CombineModifier & | SetFilterColour (const Real Red, const Real Green, const Real Blue, const Real Alpha) |
Sets which colour channels to filter (and by how much) from each layer texture. More... | |
Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureModifier | |
TextureModifier () | |
Blank constructor. | |
virtual | ~TextureModifier () |
Class destructor. | |
Protected Member Functions | |
void | ProcessLayer (const CombineLayer &Layer, TextureBuffer &Buffer) |
Processes a single layer to combine it with the target image. More... | |
Protected Attributes | |
ColourValue | CombineFilterColour |
The amount of colour from each layer that is to be used when combining textures. More... | |
CombineLayerContainer | CombineLayers |
A container of all the layers to be applied to the target texture in sequence. More... | |
A modifier that will attempt to combine the content of multiple textures.
To use this modifier, textures should be added in sequence based on the order in which you want to apply the textures to the target texture. Added textures are not combined directly, rather the first texture is applied to the target texture and the second texture is applied to the result of that operation and so forth, from the first texture specified to the last.
Definition at line 96 of file combinemodifier.h.
An enum used to describe how a texture is to be combined with the other textures in the queue.
Unless explicitly stated, modes in this enum do not operate on the Alpha Channel.
Definition at line 101 of file combinemodifier.h.
CombineModifier & Mezzanine::Graphics::Procedural::CombineModifier::AddTexture | ( | TextureBuffer * | Layer, |
const CombineMode | Mode | ||
) |
Adds a texture to the end of the sequence to be processed.
Layer | A pointer to the texture being added. |
Mode | The combine operation to be performed between the specified texture in the first argument and the target texture being processed by the modifier. |
Definition at line 269 of file combinemodifier.cpp.
|
virtual |
Gets the name of this modifier.
Implements Mezzanine::Graphics::Procedural::TextureModifier.
Definition at line 263 of file combinemodifier.cpp.
|
virtual |
Alters the generated pixels in a TextureBuffer.
Buffer | The buffer to be modified. |
Implements Mezzanine::Graphics::Procedural::TextureModifier.
Definition at line 254 of file combinemodifier.cpp.
|
protected |
Processes a single layer to combine it with the target image.
Layer | The texture being combined with the result image. |
Buffer | The buffer being drawn to/combined with. |
Definition at line 85 of file combinemodifier.cpp.
CombineModifier & Mezzanine::Graphics::Procedural::CombineModifier::RemoveAllTextures | ( | ) |
Removes all textures from all layers.
Definition at line 280 of file combinemodifier.cpp.
CombineModifier & Mezzanine::Graphics::Procedural::CombineModifier::SetFilterColour | ( | const ColourValue & | Colour | ) |
Sets which colour channels to filter (and by how much) from each layer texture.
Colour | The amount of colour from the layer texture to keep when combining. Initial Value: (1.0,1.0,1.0,1.0). |
Definition at line 286 of file combinemodifier.cpp.
CombineModifier & Mezzanine::Graphics::Procedural::CombineModifier::SetFilterColour | ( | const Real | Red, |
const Real | Green, | ||
const Real | Blue, | ||
const Real | Alpha | ||
) |
Sets which colour channels to filter (and by how much) from each layer texture.
Red | The amount of red colour from the layer texture to keep when combining. Initial Value: 1.0. |
Green | The amount of green colour from the layer texture to keep when combining. Initial Value: 1.0. |
Blue | The amount of blue colour from the layer texture to keep when combining. Initial Value: 1.0. |
Alpha | The amount of alpha colour from the layer texture to keep when combining. Initial Value: 1.0. |
Definition at line 292 of file combinemodifier.cpp.
|
protected |
The amount of colour from each layer that is to be used when combining textures.
Definition at line 125 of file combinemodifier.h.
|
protected |
A container of all the layers to be applied to the target texture in sequence.
Definition at line 128 of file combinemodifier.h.