67 #ifndef _graphicsprocedurallookupmodifier_cpp
68 #define _graphicsprocedurallookupmodifier_cpp
70 #include "Graphics/Procedural/Texture/lookupmodifier.h"
72 #include "MathTools/mathtools.h"
98 if( LookupWidth != TargetWidth && LookupHeight != TargetHeight ) {
104 for(
Whole Y = 0 ; Y < LookupHeight ; ++Y )
106 for(
Whole X = 0 ; X < LookupWidth ; ++X )
111 U = MathTools::Clamp( U,
Whole(0), TargetWidth - 1 );
112 V = MathTools::Clamp( V,
Whole(0), TargetHeight - 1 );
122 {
return "LookupModifier"; }
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 ...
LookupModifier & SetLookupTexture(TextureBuffer *Lookup)
Sets the texture that will be used to retrieve pixel coordinates.
Whole GetWidth() const
Get the pixel width of this texture.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
LookupModifier()
Blank constructor.
TextureBuffer * LookupTexture
A pointer to the image to use for pixel lookups.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
A modifier that uses an image to lookup and copy pixels of another image.
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...
virtual ~LookupModifier()
Class destructor.
Thrown when the available information should have worked but failed for unknown reasons.
virtual String GetName() const
Gets the name of this modifier.
A convenience buffer that stores pixel colour values of a texture to be generated.
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...
Real RedChannel
Value from 0.0 to 1.0 representing the amount of red present in the colour. 1.0 if very red...
virtual void Modify(TextureBuffer &Buffer)
Alters the generated pixels in a TextureBuffer.
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.