67 #ifndef _graphicsproceduraldilatemodifier_cpp
68 #define _graphicsproceduraldilatemodifier_cpp
70 #include "Graphics/Procedural/Texture/dilatemodifier.h"
98 for(
Integer CurrIteration = 0 ; CurrIteration < static_cast<Integer>( this->
NumIterations ) ; ++CurrIteration )
100 if( CurrIteration == 0 ) {
103 pSrc = ( (CurrIteration % 2) != (this->
NumIterations % 2) ) ? &DestBuffer : &IntBuffer;
105 pDest = ( (CurrIteration % 2) == (this->
NumIterations % 2) ) ? &DestBuffer : &IntBuffer;
107 for(
Integer Y = 0 ; Y < Height ; ++Y )
109 for(
Integer X = 0 ; X < Width ; ++X )
114 for(
Integer V = -1 ; V < 2 ; ++V )
116 for(
Integer U = -1 ; U < 2 ; ++U )
118 ColourValue Pixel = pSrc->
GetPixel( ( X + Width + U ) % Width, ( Y + Height + V ) % Height );
133 {
return "DilateModifier"; }
virtual ~DilateModifier()
Class destructor.
ColourChannelType & GetPixel(const Whole X, const Whole Y, const UInt16 Component)
Gets access to the pixel at the specified position in this buffer. the X or Y location go beyond the ...
UInt8 NumIterations
The number of passes over the entire image to take when expanding the bright areas.
DilateModifier()
Blank constructor.
Whole GetWidth() const
Get the pixel width of this texture.
int Integer
A datatype used to represent any integer close to.
A modifier that will bright areas of the texture over the darker areas of the image.
uint8_t UInt8
An 8-bit unsigned integer.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
DilateModifier & SetNumIterations(const UInt8 Iterations)
Sets the number of times this filter will go over the texture, generating larger bright areas...
virtual void Modify(TextureBuffer &Buffer)
Alters the generated pixels in a TextureBuffer.
virtual String GetName() const
Gets the name of this modifier.
Real GreenChannel
Value from 0.0 to 1.0 representing the amount of green present in the colour. 1.0 if very green...
A convenience buffer that stores pixel colour values of a texture to be generated.
The bulk of the engine components go in this namspace.
Whole GetHeight() const
Get the pixel height of this texture.
Real BlueChannel
Value from 0.0 to 1.0 representing the amount of blue present in the colour. 1.0 if very blue...
void SetPixel(const Whole X, const Whole Y, const ColourValue &Colour)
Set colour of a specified pixel using a ColourValue. the X or Y location go beyond the set size of th...
Real RedChannel
Value from 0.0 to 1.0 representing the amount of red present in the colour. 1.0 if very red...
std::string String
A datatype used to a series of characters.
void SetData(const TextureBuffer &Other)
Copies image data from another buffer into this buffer.