libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OGLFT::Texture Class Referenceabstract

This is the base class of the texture style. More...

#include <moOGLFT.h>

Inheritance diagram for OGLFT::Texture:
OGLFT::Face OGLFT::GrayscaleTexture OGLFT::MonochromeTexture OGLFT::TranslucentTexture

Classes

struct  TextureInfo
 

Public Member Functions

 Texture (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Texture (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~Texture (void)
 
void setCharacterRotationX (GLfloat character_rotation_x)
 
void setCharacterRotationY (GLfloat character_rotation_y)
 
void setCharacterRotationZ (GLfloat character_rotation_z)
 
GLfloat characterRotationX (void) const
 
GLfloat characterRotationY (void) const
 
GLfloat characterRotationZ (void) const
 
double height (void) const
 
BBox measure (unsigned char c)
 
BBox measure (const char *s)
 
- Public Member Functions inherited from OGLFT::Face
 Face (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Face (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~Face (void)
 
bool isValid (void) const
 
bool addAuxiliaryFace (const char *filename)
 
bool addAuxiliaryFace (FT_Face face)
 
void setCompileMode (enum GlyphCompileMode compile_mode)
 
enum GlyphCompileMode compileMode (void) const
 
void setPointSize (float point_size)
 
float pointSize (void)
 
void setResolution (FT_UInt resolution)
 
FT_UInt resolution (void)
 
void setAdvance (bool advance)
 
bool advance (void) const
 
void setForegroundColor (GLfloat red=0.0, GLfloat green=0.0, GLfloat blue=0.0, GLfloat alpha=1.0)
 
void setForegroundColor (const GLfloat foreground_color[4])
 
GLfloat foregroundRed (void) const
 
GLfloat foregroundGreen (void) const
 
GLfloat foregroundBlue (void) const
 
GLfloat foregroundAlpha (void) const
 
void setBackgroundColor (GLfloat red=1.0, GLfloat green=1.0, GLfloat blue=1.0, GLfloat alpha=0.0)
 
void setBackgroundColor (const GLfloat background_color[4])
 
GLfloat backgroundRed (void) const
 
GLfloat backgroundGreen (void) const
 
GLfloat backgroundBlue (void) const
 
GLfloat backgroundAlpha (void) const
 
void setCharacterRotationReference (unsigned char c)
 
void setStringRotation (GLfloat string_rotation)
 
GLfloat stringRotation (void) const
 
void setHorizontalJustification (enum HorizontalJustification horizontal_justification)
 
enum HorizontalJustification horizontalJustification (void) const
 
void setVerticalJustification (enum VerticalJustification vertical_justification)
 
enum VerticalJustification verticaljustification (void) const
 
void setCharacterDisplayLists (const DisplayLists &character_display_lists)
 
DisplayListscharacterDisplayLists (void)
 
virtual BBox measureRaw (const char *s)
 
GLuint compile (const char *s)
 
GLuint compile (unsigned char c)
 
void draw (const char *s)
 
void draw (unsigned char c)
 
void draw (GLfloat x, GLfloat y, unsigned char c)
 
void draw (GLfloat x, GLfloat y, GLfloat z, unsigned char c)
 
void draw (GLfloat x, GLfloat y, const char *s)
 
void draw (GLfloat x, GLfloat y, GLfloat z, const char *s)
 
int ascender (void)
 
int descender (void)
 

Protected Types

typedef std::map< FT_UInt,
TextureInfo
GlyphTexObjs
 Type of the cache of defined glyph to texture objects mapping. More...
 
typedef
GlyphTexObjs::const_iterator 
GTOCI
 
typedef GlyphTexObjs::iterator GTOI
 
- Protected Types inherited from OGLFT::Face
typedef std::map< FT_UInt, GLuint > GlyphDLists
 Type of the cache of defined glyph to display list mapping. More...
 
typedef GlyphDLists::const_iterator GDLCI
 
typedef GlyphDLists::iterator GDLI
 

Protected Member Functions

unsigned int nearestPowerCeil (unsigned int a)
 
virtual void bindTexture (FT_Face face, FT_UInt glyph_index)=0
 

Protected Attributes

struct {
   bool   active_
 the other values.) More...
 
   GLfloat   x_
 Angle of rotation in the X direction. More...
 
   GLfloat   y_
 Angle of rotation in the Y direction. More...
 
   GLfloat   z_
 Angle of rotation in the Z direction. More...
 
character_rotation_
 Angle of rotation of characters relative to text orientation. More...
 
GlyphTexObjs glyph_texobjs_
 Cache of defined glyph texture objects. More...
 
- Protected Attributes inherited from OGLFT::Face
std::vector< FaceData > faces_
 
bool valid_
 Did a font load OK? More...
 
enum GlyphCompileMode compile_mode_
 Glyph display list creation mode. More...
 
float point_size_
 Nominal point size. More...
 
FT_UInt resolution_
 Display resolution in pixels per inch. More...
 
bool advance_
 Does rendering text affect the MODELVIEW matrix? More...
 
GLfloat foreground_color_ [4]
 
GLfloat background_color_ [4]
 Background color (what modes would use this?) More...
 
enum HorizontalJustification horizontal_justification_
 PHIGS-like horizontal positioning of text. More...
 
enum VerticalJustification vertical_justification_
 PHIGS-like vertical positioning of text. More...
 
GLfloat string_rotation_
 Rotate an entire string in the Z plane. More...
 
FT_UInt rotation_reference_glyph_
 
FT_Face rotation_reference_face_
 The rotation reference character could be in any face. More...
 
GLfloat rotation_offset_y_
 
GlyphDLists glyph_dlists_
 Cache of defined glyph display lists. More...
 
DisplayLists character_display_lists_
 

Additional Inherited Members

- Public Types inherited from OGLFT::Face
enum  HorizontalJustification { LEFT, ORIGIN, CENTER, RIGHT }
 
enum  VerticalJustification { BOTTOM, BASELINE, MIDDLE, TOP }
 
enum  GlyphCompileMode { COMPILE, IMMEDIATE }
 

Detailed Description

This is the base class of the texture style.

Definition at line 1950 of file moOGLFT.h.

Member Typedef Documentation

typedef std::map< FT_UInt, TextureInfo > OGLFT::Texture::GlyphTexObjs
protected

Type of the cache of defined glyph to texture objects mapping.

Definition at line 1988 of file moOGLFT.h.

typedef GlyphTexObjs::const_iterator OGLFT::Texture::GTOCI
protected

A convenience definition of the iterator over the glyph to texture object map.

Definition at line 1992 of file moOGLFT.h.

typedef GlyphTexObjs::iterator OGLFT::Texture::GTOI
protected

A convenience definition of the iterator over the glyph to texture object map.

Definition at line 1996 of file moOGLFT.h.

Constructor & Destructor Documentation

OGLFT::Texture::Texture ( const char *  filename,
float  point_size = 12,
FT_UInt  resolution = 100 
)
Parameters
filenamethe filename which contains the font face.
point_sizethe initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolutionthe pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

Definition at line 3210 of file moOGLFT.cpp.

OGLFT::Texture::Texture ( FT_Face  face,
float  point_size = 12,
FT_UInt  resolution = 100 
)
Parameters
faceopen FreeType FT_Face.
point_sizethe initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolutionthe pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

Definition at line 3218 of file moOGLFT.cpp.

OGLFT::Texture::~Texture ( void  )
virtual

The texture destructor doesn't really do anything.

Definition at line 3236 of file moOGLFT.cpp.

Member Function Documentation

virtual void OGLFT::Texture::bindTexture ( FT_Face  face,
FT_UInt  glyph_index 
)
protectedpure virtual

This is all that distinguishes the various texture styles. Each subclass defines this method as appropriate. Once the texture is bound, it is rendered the same in all cases.

Parameters
faceFT_Face containing the glyph to render.
glyph_indexindex of glyph in face.
GLfloat OGLFT::Texture::characterRotationX ( void  ) const
inline
Returns
the character rotation in the X direction.

Definition at line 2046 of file moOGLFT.h.

GLfloat OGLFT::Texture::characterRotationY ( void  ) const
inline
Returns
the character rotation in the Y direction.

Definition at line 2054 of file moOGLFT.h.

GLfloat OGLFT::Texture::characterRotationZ ( void  ) const
inlinevirtual
Returns
the character rotation in the Z direction.

Implements OGLFT::Face.

Definition at line 2062 of file moOGLFT.h.

double OGLFT::Texture::height ( void  ) const
virtual
Returns
the height (i.e., line spacing) at the current character size.

Implements OGLFT::Face.

Definition at line 3352 of file moOGLFT.cpp.

BBox OGLFT::Texture::measure ( unsigned char  c)
virtual

Implement measuring a character in a texture face.

Parameters
cthe (latin1) character to measure
Returns
the bounding box of c.

Implements OGLFT::Face.

Definition at line 3316 of file moOGLFT.cpp.

BBox OGLFT::Texture::measure ( const char *  s)
inlinevirtual

Measure a string of characters. Note: currently, this merely calls Face's measure routine.

Parameters
sstring of (latin1) characters to measure
Returns
the bounding box of s.

Reimplemented from OGLFT::Face.

Definition at line 2092 of file moOGLFT.h.

unsigned int OGLFT::Texture::nearestPowerCeil ( unsigned int  a)
protected

OpenGL texture maps have to be a power of 2 in width and height (including apparently 1 = 2**0 ). This function returns the next higher power of 2 of the argument. If the argument is already a power of 2, you just get that back.

Parameters
awidth or height of an image.
Returns
value of a rounded to nearest, higher power of 2.

Definition at line 3505 of file moOGLFT.cpp.

void OGLFT::Texture::setCharacterRotationX ( GLfloat  character_rotation_x)

Set the individual character rotation in the X direction.

Parameters
character_rotation_xangle in degrees of X rotation.

Definition at line 3243 of file moOGLFT.cpp.

void OGLFT::Texture::setCharacterRotationY ( GLfloat  character_rotation_y)

Set the individual character rotation in the Y direction.

Parameters
character_rotation_yangle in degrees of Y rotation.

Definition at line 3258 of file moOGLFT.cpp.

void OGLFT::Texture::setCharacterRotationZ ( GLfloat  character_rotation_z)
virtual

Set the individual character rotation in the Z direction.

Parameters
character_rotation_zangle in degrees of Z rotation.

Implements OGLFT::Face.

Definition at line 3273 of file moOGLFT.cpp.

Member Data Documentation

bool OGLFT::Texture::active_

the other values.)

Is character rotation non-zero? (faster than checking all

Definition at line 1956 of file moOGLFT.h.

struct { ... } OGLFT::Texture::character_rotation_

Angle of rotation of characters relative to text orientation.

GlyphTexObjs OGLFT::Texture::glyph_texobjs_
protected

Cache of defined glyph texture objects.

Definition at line 1999 of file moOGLFT.h.

GLfloat OGLFT::Texture::x_

Angle of rotation in the X direction.

Definition at line 1958 of file moOGLFT.h.

GLfloat OGLFT::Texture::y_

Angle of rotation in the Y direction.

Definition at line 1958 of file moOGLFT.h.

GLfloat OGLFT::Texture::z_

Angle of rotation in the Z direction.

Definition at line 1958 of file moOGLFT.h.


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