67 #ifndef _graphicsproceduralcirclemodifier_cpp
68 #define _graphicsproceduralcirclemodifier_cpp
70 #include "Graphics/Procedural/Texture/circlemodifier.h"
92 if( XPos < 0 || XPos >= static_cast<Integer>( Buffer.
GetWidth() ) ) {
95 if( YPos < 0 || YPos >= static_cast<Integer>( Buffer.
GetHeight() ) ) {
112 Integer SquareRadius = IntRadius * IntRadius;
113 for(
Integer Y = -IntRadius ; Y < IntRadius ; ++Y )
115 for(
Integer X = -IntRadius ; X < IntRadius ; ++X )
117 if( X * X + Y * Y < SquareRadius ) {
118 this->
PutPixel( XPos + X, YPos + Y, Buffer );
153 {
return "CircleModifier"; }
Integer CircleYAdj
The position on the Y axis of the circle.
Integer CircleXAdj
The position on the X axis of the circle.
CircleModifier & SetRadius(const Whole Radius)
Sets the radius of the circle.
Real CircleXRel
The position on the X axis of the circle.
CircleModifier & SetYPositionAdj(const Integer Y)
Sets the absolute component of the center position on the Y axis.
Whole GetWidth() const
Get the pixel width of this texture.
CircleModifier & SetYPositionRel(const Real Y)
Sets the relative component of the center position on the Y axis.
int Integer
A datatype used to represent any integer close to.
A modifier that draws a simple coloured circle onto the texture.
virtual void Modify(TextureBuffer &Buffer)
Alters the generated pixels in a TextureBuffer.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
virtual ~CircleModifier()
Class destructor.
CircleModifier()
Blank constructor.
CircleModifier & SetColour(const ColourValue &Colour)
Sets the colour of the circle.
virtual String GetName() const
Gets the name of this modifier.
Real CircleYRel
The position on the Y axis of the circle.
float Real
A Datatype used to represent a real floating point number.
CircleModifier & SetXPositionAdj(const Integer X)
Sets the absolute component of the center position on the X axis.
void PutPixel(const Integer XPos, const Integer YPos, TextureBuffer &Buffer)
Convenience method for placing a pixel for the circle.
void SetValues(const Real Red, const Real Green, const Real Blue, const Real Alpha)
Sets each of the colour channels.
Whole CircleRadius
The radius of the circle.
A convenience buffer that stores pixel colour values of a texture to be generated.
CircleModifier & SetXPositionRel(const Real X)
Sets the relative component of the center position on the X axis.
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.
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...
CircleModifier & SetPosition(const Real XRel, const Real YRel, const Integer XAdj, const Integer YAdj)
Sets the relative and offset values for the rectangle position.
std::string String
A datatype used to a series of characters.
ColourValue CircleColour
The colour of the circle to be drawn.