67 #ifndef _graphicsproceduralalphamodifier_cpp
68 #define _graphicsproceduralalphamodifier_cpp
70 #include "Graphics/Procedural/Texture/alphamodifier.h"
79 ExtractColour(1.0,1.0,1.0,1.0)
93 for(
Whole Y = 0 ; Y < Height ; ++Y )
95 for(
Whole X = 0 ; X < Width ; ++X )
100 UInt8 Alpha = static_cast<UInt8>( ( static_cast<Whole>( Buffer.
GetAlphaByte(X,Y) ) + static_cast<Whole>(Red + Green + Blue) ) >> 1 );
107 {
return "AlphaModifier"; }
AlphaModifier()
Blank constructor.
virtual void Modify(TextureBuffer &Buffer)
Alters the generated pixels in a TextureBuffer.
virtual ~AlphaModifier()
Class destructor.
void SetPixelByte(const Whole X, const Whole Y, const ColourChannelType Red, const ColourChannelType Green, const ColourChannelType Blue, const ColourChannelType Alpha=255)
Set colour of a specified pixel using a 0-255 range. the X or Y location go beyond the set size of th...
A modifier that will replace all pixels with "White Smoke" corresponding to the intensity of the extr...
Whole GetWidth() const
Get the pixel width of this texture.
ColourChannelType GetBlueByte(const Whole X, const Whole Y) const
Gets the blue colour value of a specified pixel. the X or Y location go beyond the set size of this t...
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...
ColourChannelType GetAlphaByte(const Whole X, const Whole Y) const
Gets the alpha colour value of a specified pixel. the X or Y location go beyond the set size of this ...
float Real
A Datatype used to represent a real floating point number.
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.
AlphaModifier & SetExtractColour(const ColourValue &Extract)
Sets the amount of colour to extract for each colour channel.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
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...
Real RedChannel
Value from 0.0 to 1.0 representing the amount of red present in the colour. 1.0 if very red...
ColourChannelType GetGreenByte(const Whole X, const Whole Y) const
Gets the green colour value of a specified pixel. the X or Y location go beyond the set size of this ...
ColourValue ExtractColour
The amount from each colour channel to be extracted from the source texture.
std::string String
A datatype used to a series of characters.
ColourChannelType GetRedByte(const Whole X, const Whole Y) const
Gets the red colour value of a specified pixel. the X or Y location go beyond the set size of this te...
virtual String GetName() const
Gets the name of this modifier.