Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Texture Class Reference

This class represents a texture loaded into video memory. More...

#include <texture.h>

+ Collaboration diagram for Mezzanine::Graphics::Texture:

Public Member Functions

 Texture (Ogre::TexturePtr InternalTexture)
 Class Constructor.
 
 ~Texture ()
 Class Destructor.
 
Ogre::TexturePtr _GetInternalTexture () const
 Gets the internal Texture pointer. More...
 
Whole _ReadFromBuffer (UInt8 *DestBuffer, const Whole BufferSize)
 Reads from the internal buffer and populates the provided buffer with the texture data.

Exceptions
Ifthe size of the provided buffer is smaller than this texture, a PARAMETERS_EXCEPTION will be thrown.
More...
 
void _WriteToBuffer (UInt8 *SrcBuffer, const Whole BufferSize, const Graphics::PixelFormat SrcFormat)
 Writes to the textures internal buffer.

Exceptions
Ifthe size of this texture is smaller than the buffer being written, a PARAMETERS_EXCEPTION will be thrown.
More...
 
Graphics::PixelFormat GetFormat () const
 Gets the pixel format of this Texture. More...
 
const StringGetGroup () const
 Gets the resource group this Texture belongs to. More...
 
const StringGetName () const
 Gets the Name of this Texture. More...
 
Whole GetNumMipMaps () const
 Gets the number of MipMaps that exist for this Texture. More...
 
UInt32 GetOriginalDepth () const
 Gets the depth of the source Texture in pixels. More...
 
UInt32 GetOriginalHeight () const
 Gets the height of the source Texture in pixels. More...
 
UInt32 GetOriginalWidth () const
 Gets the width of the source Texture in pixels. More...
 
Whole GetSize () const
 Gets the size of this Texture. More...
 

Protected Attributes

InternalTextureDataITD
 A pointer to the internal implementation of the Texture. More...
 

Detailed Description

This class represents a texture loaded into video memory.

Definition at line 63 of file texture.h.

Member Function Documentation

Ogre::TexturePtr Mezzanine::Graphics::Texture::_GetInternalTexture ( ) const

Gets the internal Texture pointer.

Returns
Returns a shared pointer pointing to the internal Texture.

Definition at line 161 of file texture.cpp.

Whole Mezzanine::Graphics::Texture::_ReadFromBuffer ( UInt8 DestBuffer,
const Whole  BufferSize 
)

Reads from the internal buffer and populates the provided buffer with the texture data.

Exceptions
Ifthe size of the provided buffer is smaller than this texture, a PARAMETERS_EXCEPTION will be thrown.

Parameters
DestBufferThe buffer to be written to.
BufferSizeThe size of the buffer provided.
Returns
Returns the number of bytes read from the texture. Usually this will be the size of the texture itself.

Definition at line 115 of file texture.cpp.

void Mezzanine::Graphics::Texture::_WriteToBuffer ( UInt8 SrcBuffer,
const Whole  BufferSize,
const Graphics::PixelFormat  SrcFormat 
)

Writes to the textures internal buffer.

Exceptions
Ifthe size of this texture is smaller than the buffer being written, a PARAMETERS_EXCEPTION will be thrown.

Parameters
SrcBufferThe buffer containing the pixel data to be written.
BufferSizeThe size of the buffer being written.
SrcFormatThe pixel format of the texture in the source buffer. Pixel format will automatically be converted to the set format of this texture.

Definition at line 138 of file texture.cpp.

Graphics::PixelFormat Mezzanine::Graphics::Texture::GetFormat ( ) const

Gets the pixel format of this Texture.

Returns
Returns a PixelFormat enum value representing how the bits of this Texture are layed out.

Definition at line 94 of file texture.cpp.

const String & Mezzanine::Graphics::Texture::GetGroup ( ) const

Gets the resource group this Texture belongs to.

Returns
Returns a const string reference containing the group this Texture belongs to.

Definition at line 109 of file texture.cpp.

const String & Mezzanine::Graphics::Texture::GetName ( ) const

Gets the Name of this Texture.

Note
If this Texture originated from a file, usually the name of the Texture will be the file name.
Returns
Returns a const string reference containing the name of this Texture.

Definition at line 106 of file texture.cpp.

Whole Mezzanine::Graphics::Texture::GetNumMipMaps ( ) const

Gets the number of MipMaps that exist for this Texture.

Returns
Returns the number of MipMaps this Texture has.

Definition at line 97 of file texture.cpp.

UInt32 Mezzanine::Graphics::Texture::GetOriginalDepth ( ) const

Gets the depth of the source Texture in pixels.

Remarks
The actual size of the Texture in hardware is subject to change based on a number of configurations in the rendersystem. This method ignores those settings and reports only the original unaltered size.
Returns
Returns a UInt32 representing the size of this Texture on the Z axis.

Definition at line 91 of file texture.cpp.

UInt32 Mezzanine::Graphics::Texture::GetOriginalHeight ( ) const

Gets the height of the source Texture in pixels.

Remarks
The actual size of the Texture in hardware is subject to change based on a number of configurations in the rendersystem. This method ignores those settings and reports only the original unaltered size.
Returns
Returns a UInt32 representing the size of this Texture on the Y axis.

Definition at line 88 of file texture.cpp.

UInt32 Mezzanine::Graphics::Texture::GetOriginalWidth ( ) const

Gets the width of the source Texture in pixels.

Remarks
The actual size of the Texture in hardware is subject to change based on a number of configurations in the rendersystem. This method ignores those settings and reports only the original unaltered size.
Returns
Returns a UInt32 representing the size of this Texture on the X axis.

Definition at line 85 of file texture.cpp.

Whole Mezzanine::Graphics::Texture::GetSize ( ) const

Gets the size of this Texture.

Returns
Returns a Whole representing the total size of this Texture in bytes.

Definition at line 100 of file texture.cpp.

Member Data Documentation

InternalTextureData* Mezzanine::Graphics::Texture::ITD
protected

A pointer to the internal implementation of the Texture.

Definition at line 68 of file texture.h.


The documentation for this class was generated from the following files: