67 #ifndef _graphicsproceduralalphamaskmodifier_cpp
68 #define _graphicsproceduralalphamaskmodifier_cpp
70 #include "Graphics/Procedural/Texture/alphamaskmodifier.h"
99 if( MaskWidth != TargetWidth && MaskHeight != TargetHeight ) {
103 for(
Whole Y = 0 ; Y < TargetHeight ; ++Y )
105 for(
Whole X = 0 ; X < TargetWidth ; ++X )
117 Real Correctness = 0;
120 Correctness = Colour1.
X * Colour2.
X + Colour1.
Y * Colour2.
Y + Colour1.
Z * Colour2.
Z;
138 {
return "AlphaMaskModifier"; }
147 { this->
ColourMask = UseColour;
return *
this; }
virtual String GetName() const
Gets the name of this modifier.
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 ...
bool Boole
Generally acts a single bit, true or false.
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...
Real X
Coordinate on the X vector.
Real Z
Coordinate on the Z vector.
AlphaMaskModifier()
Blank constructor.
Whole GetWidth() const
Get the pixel width of this texture.
Real GetAlphaReal(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 ...
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
AlphaMaskModifier & SetMaskTexture(TextureBuffer *Mask)
Sets the texture that will be used as the mask.
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...
This implements the exception hiearchy for Mezzanine.
virtual void Modify(TextureBuffer &Buffer)
Alters the generated pixels in a TextureBuffer.
Boole ColourMask
Whether or not to use normalized colours from the mask for calculating the alpha channel, instead of the intensity.
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.
virtual ~AlphaMaskModifier()
Class destructor.
A modifier that will use a mask image to set the alpha channels of a source image.
Real GreenChannel
Value from 0.0 to 1.0 representing the amount of green present in the colour. 1.0 if very green...
Real AlphaChannel
Value from 0.0 to 1.0 representing the transparency of the colours. 1.0 is opaque and 0...
Vector3 & Normalize()
This will change this point into it's own normal relative to the origin.
Real Y
Coordinate on the Y vector.
void SetAlphaReal(const Whole X, const Whole Y, const Real Alpha)
Sets the alpha colour value of a specified pixel. the X or Y location go beyond the set size of this ...
AlphaMaskModifier & SetColourMask(const Boole UseColour)
Sets whether or not the colour of the mask will be used instead of the intensity. ...
Thrown when the available information should have worked but failed for unknown reasons.
A convenience buffer that stores pixel colour values of a texture to be generated.
This is used to represent a point in space, or a vector through space.
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...
Boole IsZeroLength() const
Checks to see if the length of this vector is zero.
Real RedChannel
Value from 0.0 to 1.0 representing the amount of red present in the colour. 1.0 if very red...
void SetAlphaByte(const Whole X, const Whole Y, const ColourChannelType Alpha)
Sets the alpha colour value of a specified pixel. the X or Y location go beyond the set size of this ...
std::string String
A datatype used to a series of characters.
TextureBuffer * MaskTexture
A pointer to the texture to use as the Alpha Mask.