A convenience buffer that stores pixel colour values of a texture to be generated. More...
#include <texturebuffer.h>
Public Types | |
typedef UInt8 | ColourChannelType |
Convenience typedef for the datatype containing the value for each colour channel. | |
Public Member Functions | |||||
TextureBuffer (const Whole SquareSize) | |||||
Square size constructor. More... | |||||
TextureBuffer (const Whole TexWidth, const Whole TexHeight) | |||||
Size dimensions constructor. More... | |||||
TextureBuffer (const TextureBuffer &Other) | |||||
Copy constructor. More... | |||||
~TextureBuffer () | |||||
Class destructor. | |||||
Image * | GenerateImage (const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const | ||||
Creates an Image from this buffer. More... | |||||
Texture * | GenerateTexture (const String &TexName, const String &TexGroup, const Graphics::PixelFormat Format=Graphics::PF_R8G8B8A8) const | ||||
Creates a Texture from this buffer. More... | |||||
ColourChannelType | GetAlphaByte (const Whole X, const Whole Y) const | ||||
Gets the alpha colour value of a specified pixel.
| |||||
Real | GetAlphaReal (const Whole X, const Whole Y) const | ||||
Gets the alpha colour value of a specified pixel.
| |||||
ColourChannelType | GetBlueByte (const Whole X, const Whole Y) const | ||||
Gets the blue colour value of a specified pixel.
| |||||
Real | GetBlueReal (const Whole X, const Whole Y) const | ||||
Gets the blue colour value of a specified pixel.
| |||||
Whole | GetByteSize () const | ||||
Gets the size of the internal buffer in bytes. More... | |||||
ColourChannelType | GetGreenByte (const Whole X, const Whole Y) const | ||||
Gets the green colour value of a specified pixel.
| |||||
Real | GetGreenReal (const Whole X, const Whole Y) const | ||||
Gets the green colour value of a specified pixel.
| |||||
Whole | GetHeight () const | ||||
Get the pixel height of this texture. More... | |||||
ColourValue | GetPixel (const Whole X, const Whole Y) const | ||||
Get the colour of a pixel at the specified point.
| |||||
Whole | GetPixelCount () const | ||||
Gets the number of pixels in this texture. More... | |||||
ColourChannelType | GetRedByte (const Whole X, const Whole Y) const | ||||
Gets the red colour value of a specified pixel.
| |||||
Real | GetRedReal (const Whole X, const Whole Y) const | ||||
Gets the red colour value of a specified pixel.
| |||||
Whole | GetSubChannelCount () const | ||||
Gets the number of colour channels among all the pixels in this texture. More... | |||||
Whole | GetWidth () const | ||||
Get the pixel width of this texture. More... | |||||
void | SetAlphaByte (const Whole X, const Whole Y, const ColourChannelType Alpha) | ||||
Sets the alpha colour value of a specified pixel.
| |||||
void | SetAlphaReal (const Whole X, const Whole Y, const Real Alpha) | ||||
Sets the alpha colour value of a specified pixel.
| |||||
void | SetBlueByte (const Whole X, const Whole Y, const ColourChannelType Blue) | ||||
Sets the blue colour value of a specified pixel.
| |||||
void | SetBlueReal (const Whole X, const Whole Y, const Real Blue) | ||||
Sets the blue colour value of a specified pixel.
| |||||
void | SetData (const TextureBuffer &Other) | ||||
Copies image data from another buffer into this buffer. More... | |||||
void | SetGreenByte (const Whole X, const Whole Y, const ColourChannelType Green) | ||||
Sets the green colour value of a specified pixel.
| |||||
void | SetGreenReal (const Whole X, const Whole Y, const Real Green) | ||||
Sets the green colour value of a specified pixel.
| |||||
void | SetPixel (const Whole X, const Whole Y, const ColourValue &Colour) | ||||
Set colour of a specified pixel using a ColourValue.
| |||||
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.
| |||||
void | SetPixelReal (const Whole X, const Whole Y, const Real Red, const Real Green, const Real Blue, const Real Alpha=1.0) | ||||
Set colour of a specified pixel using a 0.0-1.0 range.
| |||||
void | SetRedByte (const Whole X, const Whole Y, const ColourChannelType Red) | ||||
Sets the red colour value of a specified pixel.
| |||||
void | SetRedReal (const Whole X, const Whole Y, const Real Red) | ||||
Sets the red colour value of a specified pixel.
| |||||
Protected Member Functions | |||
ColourChannelType & | GetPixel (const Whole X, const Whole Y, const UInt16 Component) | ||
Gets access to the pixel at the specified position in this buffer.
| |||
const ColourChannelType & | GetPixel (const Whole X, const Whole Y, const UInt16 Component) const | ||
Gets access to the pixel at the specified position in this buffer.
| |||
Protected Attributes | |
Whole | Height |
The size of the texture to be generated on the Y axis. More... | |
ColourChannelType * | Pixels |
A pointer to the buffer storing all the pixels of this texture buffer. More... | |
Whole | Width |
The size of the texture to be generated on the X axis. More... | |
A convenience buffer that stores pixel colour values of a texture to be generated.
Definition at line 86 of file texturebuffer.h.
Mezzanine::Graphics::Procedural::TextureBuffer::TextureBuffer | ( | const Whole | SquareSize | ) |
Square size constructor.
SquareSize | The width and height of the texture to create. This value will be clamped to be at least 8. |
Definition at line 94 of file texturebuffer.cpp.
Mezzanine::Graphics::Procedural::TextureBuffer::TextureBuffer | ( | const Whole | TexWidth, |
const Whole | TexHeight | ||
) |
Size dimensions constructor.
TexWidth | The pixel width of the texture to create. This value will be clamped to be at least 8. |
TexHeight | The pixel height of the texture to create. This value will be clamped to be at least 8. |
Definition at line 109 of file texturebuffer.cpp.
Mezzanine::Graphics::Procedural::TextureBuffer::TextureBuffer | ( | const TextureBuffer & | Other | ) |
Copy constructor.
Other | The other TextureBuffer to be copied. |
Definition at line 124 of file texturebuffer.cpp.
Image * Mezzanine::Graphics::Procedural::TextureBuffer::GenerateImage | ( | const Graphics::PixelFormat | Format = Graphics::PF_R8G8B8A8 | ) | const |
Creates an Image from this buffer.
Format | The pixel format for the generated Image. Defaults to: Graphics::PF_R8G8B8A8 (Ideal for PNG). |
Definition at line 186 of file texturebuffer.cpp.
Texture * Mezzanine::Graphics::Procedural::TextureBuffer::GenerateTexture | ( | const String & | TexName, |
const String & | TexGroup, | ||
const Graphics::PixelFormat | Format = Graphics::PF_R8G8B8A8 |
||
) | const |
Creates a Texture from this buffer.
TexName | The name of the Texture to be generated. |
TexGroup | The name of the resource group to create the Texture in. |
Format | The pixel format for the generated Texture. Defaults to: Graphics::PF_R8G8B8A8 (Ideal for PNG). |
Definition at line 194 of file texturebuffer.cpp.
TextureBuffer::ColourChannelType Mezzanine::Graphics::Procedural::TextureBuffer::GetAlphaByte | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the alpha colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 286 of file texturebuffer.cpp.
Real Mezzanine::Graphics::Procedural::TextureBuffer::GetAlphaReal | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the alpha colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 289 of file texturebuffer.cpp.
TextureBuffer::ColourChannelType Mezzanine::Graphics::Procedural::TextureBuffer::GetBlueByte | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the blue colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 270 of file texturebuffer.cpp.
Real Mezzanine::Graphics::Procedural::TextureBuffer::GetBlueReal | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the blue colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 273 of file texturebuffer.cpp.
Whole Mezzanine::Graphics::Procedural::TextureBuffer::GetByteSize | ( | ) | const |
Gets the size of the internal buffer in bytes.
Definition at line 183 of file texturebuffer.cpp.
TextureBuffer::ColourChannelType Mezzanine::Graphics::Procedural::TextureBuffer::GetGreenByte | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the green colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 254 of file texturebuffer.cpp.
Real Mezzanine::Graphics::Procedural::TextureBuffer::GetGreenReal | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the green colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 257 of file texturebuffer.cpp.
Whole Mezzanine::Graphics::Procedural::TextureBuffer::GetHeight | ( | ) | const |
Get the pixel height of this texture.
Definition at line 174 of file texturebuffer.cpp.
|
protected |
Gets access to the pixel at the specified position in this buffer.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of the pixel to access. |
Y | The Y position of the pixel to access. |
Component | The colour component to access. |
Definition at line 133 of file texturebuffer.cpp.
|
protected |
Gets access to the pixel at the specified position in this buffer.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of the pixel to access. |
Y | The Y position of the pixel to access. |
Component | The colour component to access. |
Definition at line 142 of file texturebuffer.cpp.
ColourValue Mezzanine::Graphics::Procedural::TextureBuffer::GetPixel | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Get the colour of a pixel at the specified point.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 225 of file texturebuffer.cpp.
Whole Mezzanine::Graphics::Procedural::TextureBuffer::GetPixelCount | ( | ) | const |
Gets the number of pixels in this texture.
Definition at line 177 of file texturebuffer.cpp.
TextureBuffer::ColourChannelType Mezzanine::Graphics::Procedural::TextureBuffer::GetRedByte | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the red colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 238 of file texturebuffer.cpp.
Real Mezzanine::Graphics::Procedural::TextureBuffer::GetRedReal | ( | const Whole | X, |
const Whole | Y | ||
) | const |
Gets the red colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to retrieve. |
Y | The Y position of pixel to retrieve. |
Definition at line 241 of file texturebuffer.cpp.
Whole Mezzanine::Graphics::Procedural::TextureBuffer::GetSubChannelCount | ( | ) | const |
Gets the number of colour channels among all the pixels in this texture.
Definition at line 180 of file texturebuffer.cpp.
Whole Mezzanine::Graphics::Procedural::TextureBuffer::GetWidth | ( | ) | const |
Get the pixel width of this texture.
Definition at line 171 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetAlphaByte | ( | const Whole | X, |
const Whole | Y, | ||
const ColourChannelType | Alpha | ||
) |
Sets the alpha colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Alpha | The amount of alpha colour to be applied to the specified pixel. Range: [0, 255]. |
Definition at line 276 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetAlphaReal | ( | const Whole | X, |
const Whole | Y, | ||
const Real | Alpha | ||
) |
Sets the alpha colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
If | any of the colour values passed in are outside of the range of 0.0-1.0, then a PARAMETERS_RANGE_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Alpha | The amount of alpha colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Definition at line 279 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetBlueByte | ( | const Whole | X, |
const Whole | Y, | ||
const ColourChannelType | Blue | ||
) |
Sets the blue colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Blue | The amount of blue colour to be applied to the specified pixel. Range: [0, 255]. |
Definition at line 260 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetBlueReal | ( | const Whole | X, |
const Whole | Y, | ||
const Real | Blue | ||
) |
Sets the blue colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
If | any of the colour values passed in are outside of the range of 0.0-1.0, then a PARAMETERS_RANGE_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Blue | The amount of blue colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Definition at line 263 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetData | ( | const TextureBuffer & | Other | ) |
Copies image data from another buffer into this buffer.
Other | The other TextureBuffer that will having it's contents copied to this. |
Definition at line 154 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetGreenByte | ( | const Whole | X, |
const Whole | Y, | ||
const ColourChannelType | Green | ||
) |
Sets the green colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Green | The amount of green colour to be applied to the specified pixel. Range: [0, 255]. |
Definition at line 244 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetGreenReal | ( | const Whole | X, |
const Whole | Y, | ||
const Real | Green | ||
) |
Sets the green colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
If | any of the colour values passed in are outside of the range of 0.0-1.0, then a PARAMETERS_RANGE_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Green | The amount of green colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Definition at line 247 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetPixel | ( | const Whole | X, |
const Whole | Y, | ||
const ColourValue & | Colour | ||
) |
Set colour of a specified pixel using a ColourValue.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Colour | The colour to be applied to the specified pixel. |
Definition at line 204 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::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.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Red | The amount of Red colour to be applied to the specified pixel. Range: [0, 255]. |
Green | The amount of Green colour to be applied to the specified pixel. Range: [0, 255]. |
Blue | The amount of Blue colour to be applied to the specified pixel. Range: [0, 255]. |
Alpha | The amount of Alpha colour to be applied to the specified pixel. Range: [0, 255]. |
Definition at line 209 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetPixelReal | ( | const Whole | X, |
const Whole | Y, | ||
const Real | Red, | ||
const Real | Green, | ||
const Real | Blue, | ||
const Real | Alpha = 1.0 |
||
) |
Set colour of a specified pixel using a 0.0-1.0 range.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
If | any of the colour values passed in are outside of the range of 0.0-1.0, then a PARAMETERS_RANGE_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Red | The amount of Red colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Green | The amount of Green colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Blue | The amount of Blue colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Alpha | The amount of Alpha colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Definition at line 217 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetRedByte | ( | const Whole | X, |
const Whole | Y, | ||
const ColourChannelType | Red | ||
) |
Sets the red colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Red | The amount of red colour to be applied to the specified pixel. Range: [0, 255]. |
Definition at line 228 of file texturebuffer.cpp.
void Mezzanine::Graphics::Procedural::TextureBuffer::SetRedReal | ( | const Whole | X, |
const Whole | Y, | ||
const Real | Red | ||
) |
Sets the red colour value of a specified pixel.
If | the X or Y location go beyond the set size of this texture buffer, then a MM_OUT_OF_BOUNDS_EXCEPTION will be thrown. |
If | any of the colour values passed in are outside of the range of 0.0-1.0, then a PARAMETERS_RANGE_EXCEPTION will be thrown. |
X | The X position of pixel to change the colour of. |
Y | The Y position of pixel to change the colour of. |
Red | The amount of red colour to be applied to the specified pixel. Range: [0.0, 1.0]. |
Definition at line 231 of file texturebuffer.cpp.
|
protected |
The size of the texture to be generated on the Y axis.
Definition at line 100 of file texturebuffer.h.
|
protected |
A pointer to the buffer storing all the pixels of this texture buffer.
Definition at line 94 of file texturebuffer.h.
|
protected |
The size of the texture to be generated on the X axis.
Definition at line 97 of file texturebuffer.h.