67 #ifndef _graphicsproceduralrectanglemodifier_cpp
68 #define _graphicsproceduralrectanglemodifier_cpp
70 #include "Graphics/Procedural/Texture/rectanglemodifier.h"
72 #include "MathTools/mathtools.h"
81 FillColour(1.0,1.0,1.0,1.0),
103 const Integer RightMost = MathTools::Clamp( LeftMost + ( static_cast<Integer>( Width * this->
SizeXRel ) + this->
PositionYAdj ), 0, static_cast<Integer>( Buffer.
GetWidth() ) );
105 const Integer BottomMost = MathTools::Clamp( TopMost + ( static_cast<Integer>( Height * this->
SizeYRel ) + this->
SizeYAdj ), 0, static_cast<Integer>( Buffer.
GetHeight() ) );
107 for(
Integer Y = TopMost ; Y <= BottomMost ; ++Y )
109 for(
Integer X = LeftMost ; X <= RightMost ; ++X )
117 {
return "RectangleModifier"; }
129 { this->
FillColour.
SetValues(static_cast<Real>(Red) / 255.0,static_cast<Real>(Green) / 255.0,static_cast<Real>(Blue) / 255.0,static_cast<Real>(Alpha) / 255.0);
return *
this; }
187 { this->
SizeXRel = X;
return *
this; }
190 { this->
SizeYRel = Y;
return *
this; }
199 { this->
SizeXAdj = X;
return *
this; }
202 { this->
SizeYAdj = Y;
return *
this; }
RectangleModifier & SetYSizeAdj(const Integer Y)
Sets the absolute component for the vertical size.
RectangleModifier & SetPosition(const Real XPositionRel, const Real YPositionRel, const Integer XPositionAdj, const Integer YPositionAdj)
Sets the relative and offset values for the rectangle position.
virtual ~RectangleModifier()
Class destructor.
virtual void Modify(TextureBuffer &Buffer)
Alters the generated pixels in a TextureBuffer.
RectangleModifier & SetColour(const ColourValue &Colour)
Sets the colour of the rectangle to be generated.
RectangleModifier & SetSize(const Real XSizeRel, const Real YSizeRel, const Integer XSizeAdj, const Integer YSizeAdj)
Sets the relative and offset values for the rectangle size.
Whole GetWidth() const
Get the pixel width of this texture.
RectangleModifier & SetYPositionAdj(const Integer Y)
Sets the absolute component of the top edge.
Integer PositionYAdj
The top edge adjustment of the rectangle after relative coordinates are calculated.
int Integer
A datatype used to represent any integer close to.
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...
ColourValue FillColour
The colour of the rectangle to apply to the texture.
float Real
A Datatype used to represent a real floating point number.
RectangleModifier & SetXSizeRel(const Real X)
Sets the relative component of the horizontal size.
Real SizeXRel
The horizontal size of the rectangle in relative coordinates.
Real SizeYRel
The vertical size of the rectangle in relative coordinates.
Real PositionXRel
The left edge of the rectangle in relative coordinates.
Real PositionYRel
The top edge of the rectangle in relative coordinates.
RectangleModifier & SetYPositionRel(const Real Y)
Sets the relative component of the top edge.
RectangleModifier()
Blank constructor.
RectangleModifier & SetXPositionRel(const Real X)
Sets the relative component of the left edge.
Integer SizeXAdj
The horizontal size adjustment of the rectangle after relative coordinates are calculated.
RectangleModifier & SetRectangle(const Real XPosition, const Real YPosition, const Real XSize, const Real YSize)
Sets the relative position and size of this rectangle..
void SetValues(const Real Red, const Real Green, const Real Blue, const Real Alpha)
Sets each of the colour channels.
virtual String GetName() const
Gets the name of this modifier.
RectangleModifier & SetYSizeRel(const Real Y)
Sets the relative component of the vertical size.
RectangleModifier & SetXPositionAdj(const Integer X)
Sets the absolute component of the left edge.
A modifier that draws a simple coloured rectangle onto the texture.
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.
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...
RectangleModifier & SetXSizeAdj(const Integer X)
Sets the absolute component for the horizontal size.
Integer PositionXAdj
The left edge adjustment of the rectangle after relative coordinates are calculated.
std::string String
A datatype used to a series of characters.
Integer SizeYAdj
The vertical size adjustment of the rectangle after relative coordinates are calculated.