version 3.3

VRS::TEXT::FontTexture Class Reference

A Texture for a FontDefinition, containing helper methods for drawing glyphs. More...

#include <vrs/text/fonttexture.h>

Inheritance diagram for VRS::TEXT::FontTexture:

VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 FontTexture (unsigned int textureSize, SO< FontDefinition > fontDefinition, bool colored=false)
 Constructor.
virtual ~FontTexture ()
 Destructor.
unsigned int getTextureSize () const
 Return the texture size.
SO< FontDefinitiongetFontDefinition () const
 Returns the FontDefinition.
TextureGLgetTexture ()
 Returns the VRS Texture.
MemoryImagegetImage () const
 Returns the Image.
bool hasEnoughFreeSpace (SO< Image > img) const
 Checks if the image would fit on this texture.
bool hasEnoughFreeSpace (const FT_Bitmap &bitmap) const
 Checks if the bitmap would fit on this texture.
bool hasEnoughFreeSpace (int width, int height) const
 Checks if there is enough space to fit a quad with the given bounds.
void addGlyphToTexture (const FT_Bitmap &bitmap, unsigned int *uv=NULL)
 Renders a bitmap font on the next free place.
void addImageToTexture (SO< Image > img, unsigned int *uv=NULL)
 Renders an image on the next free place.
void writeToPng (const std::string &filename)
 Saves this texture as a png.
 VRS_TYPEINFO (FontTexture, SharedObj)


Detailed Description

A Texture for a FontDefinition, containing helper methods for drawing glyphs.

Constructor & Destructor Documentation

VRS::TEXT::FontTexture::FontTexture ( unsigned int  textureSize,
SO< FontDefinition fontDefinition,
bool  colored = false 
)

Constructor.

Parameters:
texturesize 
fontDefinition The Font to which this texture belongs
colored Use RGBA instead of just an Alpha Channel

virtual VRS::TEXT::FontTexture::~FontTexture (  )  [virtual]

Destructor.


Member Function Documentation

unsigned int VRS::TEXT::FontTexture::getTextureSize (  )  const [inline]

Return the texture size.

SO<FontDefinition> VRS::TEXT::FontTexture::getFontDefinition (  )  const [inline]

Returns the FontDefinition.

TextureGL* VRS::TEXT::FontTexture::getTexture (  ) 

Returns the VRS Texture.

MemoryImage* VRS::TEXT::FontTexture::getImage (  )  const [inline]

Returns the Image.

bool VRS::TEXT::FontTexture::hasEnoughFreeSpace ( SO< Image img  )  const

Checks if the image would fit on this texture.

bool VRS::TEXT::FontTexture::hasEnoughFreeSpace ( const FT_Bitmap bitmap  )  const

Checks if the bitmap would fit on this texture.

bool VRS::TEXT::FontTexture::hasEnoughFreeSpace ( int  width,
int  height 
) const

Checks if there is enough space to fit a quad with the given bounds.

void VRS::TEXT::FontTexture::addGlyphToTexture ( const FT_Bitmap bitmap,
unsigned int *  uv = NULL 
)

Renders a bitmap font on the next free place.

Parameters:
bitmap The BitmapFont to draw
uv A unsigned int[2] for xpos, ypos if NULL ignored

void VRS::TEXT::FontTexture::addImageToTexture ( SO< Image img,
unsigned int *  uv = NULL 
)

Renders an image on the next free place.

Parameters:
img The Image to draw
uv A unsigned int[2] for xpos, ypos if NULL ignored

void VRS::TEXT::FontTexture::writeToPng ( const std::string &  filename  ) 

Saves this texture as a png.

VRS::TEXT::FontTexture::VRS_TYPEINFO ( FontTexture  ,
SharedObj   
)


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

Generated on Wed May 23 06:00:35 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact