Public Member Functions | Protected Member Functions | Protected Attributes

sp::video::ImageBufferContainer< T, DefVal > Class Template Reference

#include <spImageBufferContainer.hpp>

Inheritance diagram for sp::video::ImageBufferContainer< T, DefVal >:
sp::video::ImageBuffer

List of all members.

Public Member Functions

virtual ~ImageBufferContainer ()
bool setFormat (const EPixelFormats Format)
 Converts the pixel format and returns true if something has changed.
void setSize (const dim::size2di &Size)
 Resizes the image buffer.
bool setDepth (u32 Depth)
 Resizes the image buffer for the depth and returns true on success.
void invertColors ()
 Inverts all pixel colors.
void flipColors ()
 Flips all pixel colors (from RGB to BGR).
void flipImageHorizontal ()
 Flips the image on X-axis.
void flipImageVertical ()
 Flips the image on Y-axis.
void turnImage (const EImageTurnDegrees Degree)
 Turns the image in 90, 180 or 270 degrees.
void grayToAlpha ()
 Converts the gray values to alpha channel. Among others this is used for textured font.
u32 getDataTypeSize () const
 Returns the data type size (in bytes). For unsigned bytes it's 1 and for floats it's 4.
void * getBuffer ()
 Returns pointer to the image buffer stored in the RAM. This can be a UByte or Float pointer.
const void * getBuffer () const
bool appendImageBuffer (const ImageBuffer *AdditionalBuffer, bool isAppendBottom=true)
virtual void createBuffer (const void *InitBuffer=0)
virtual void deleteBuffer ()
 Deletes the image buffer.

Protected Member Functions

 ImageBufferContainer (const EImageBufferTypes Type)
 ImageBufferContainer (const EImageBufferTypes Type, const EPixelFormats Format, const dim::size2di &Size, u32 Depth=1, const void *InitBuffer=0)

Protected Attributes

T * Buffer_

template<typename T, s32 DefVal>
class sp::video::ImageBufferContainer< T, DefVal >


Constructor & Destructor Documentation

template<typename T, s32 DefVal>
virtual sp::video::ImageBufferContainer< T, DefVal >::~ImageBufferContainer (  )  [inline, virtual]
template<typename T, s32 DefVal>
sp::video::ImageBufferContainer< T, DefVal >::ImageBufferContainer ( const EImageBufferTypes  Type  )  [inline, protected]
template<typename T, s32 DefVal>
sp::video::ImageBufferContainer< T, DefVal >::ImageBufferContainer ( const EImageBufferTypes  Type,
const EPixelFormats  Format,
const dim::size2di Size,
u32  Depth = 1,
const void *  InitBuffer = 0 
) [inline, protected]

Member Function Documentation

template<typename T, s32 DefVal>
bool sp::video::ImageBufferContainer< T, DefVal >::appendImageBuffer ( const ImageBuffer AdditionalBuffer,
bool  isAppendBottom = true 
) [inline, virtual]

Appends the given image buffer to this one. The additional image buffer will be resized to fit into this image buffer.

Parameters:
[in] NewFrame Pointer to the additional image buffer object which is to be appended.
[in] isAppendBottom Specifies whether the additional image buffer is to be appended at the bottom or not. If not it will be inserted into the image buffer so that it looks like the image will be appended at the right. This is slower than appending it at the end of the buffer! By default true.
Returns:
True if succeeded. Otherwise the image buffer types are incompatible, i.e. 'Float' and 'UByte'.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
virtual void sp::video::ImageBufferContainer< T, DefVal >::createBuffer ( const void *  InitBuffer = 0  )  [inline, virtual]

Creates the buffer and deletes the old one.

Parameters:
[in] InitBuffer Pointer to the buffer which is to be compied. This must point to a memory buffer with the same size as the image buffer. Otherwise it must be a null pointer. By default null.
See also:
getBufferSize

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
virtual void sp::video::ImageBufferContainer< T, DefVal >::deleteBuffer (  )  [inline, virtual]

Deletes the image buffer.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void sp::video::ImageBufferContainer< T, DefVal >::flipColors (  )  [inline, virtual]

Flips all pixel colors (from RGB to BGR).

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void sp::video::ImageBufferContainer< T, DefVal >::flipImageHorizontal (  )  [inline, virtual]

Flips the image on X-axis.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void sp::video::ImageBufferContainer< T, DefVal >::flipImageVertical (  )  [inline, virtual]

Flips the image on Y-axis.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void* sp::video::ImageBufferContainer< T, DefVal >::getBuffer (  )  [inline, virtual]

Returns pointer to the image buffer stored in the RAM. This can be a UByte or Float pointer.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
const void* sp::video::ImageBufferContainer< T, DefVal >::getBuffer (  )  const [inline, virtual]
template<typename T, s32 DefVal>
u32 sp::video::ImageBufferContainer< T, DefVal >::getDataTypeSize (  )  const [inline, virtual]

Returns the data type size (in bytes). For unsigned bytes it's 1 and for floats it's 4.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void sp::video::ImageBufferContainer< T, DefVal >::grayToAlpha (  )  [inline, virtual]

Converts the gray values to alpha channel. Among others this is used for textured font.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void sp::video::ImageBufferContainer< T, DefVal >::invertColors (  )  [inline, virtual]

Inverts all pixel colors.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
bool sp::video::ImageBufferContainer< T, DefVal >::setDepth ( u32  Depth  )  [inline, virtual]

Resizes the image buffer for the depth and returns true on success.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
bool sp::video::ImageBufferContainer< T, DefVal >::setFormat ( const EPixelFormats  Format  )  [inline, virtual]

Converts the pixel format and returns true if something has changed.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void sp::video::ImageBufferContainer< T, DefVal >::setSize ( const dim::size2di Size  )  [inline, virtual]

Resizes the image buffer.

Implements sp::video::ImageBuffer.

template<typename T, s32 DefVal>
void sp::video::ImageBufferContainer< T, DefVal >::turnImage ( const EImageTurnDegrees  Degree  )  [inline, virtual]

Turns the image in 90, 180 or 270 degrees.

Implements sp::video::ImageBuffer.


Member Data Documentation

template<typename T, s32 DefVal>
T* sp::video::ImageBufferContainer< T, DefVal >::Buffer_ [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines