FTBitmapGlyph.h

Go to the documentation of this file.
00001 #ifndef     __FTBitmapGlyph__
00002 #define     __FTBitmapGlyph__
00003 
00004 
00005 #include <ft2build.h>
00006 #include FT_FREETYPE_H
00007 #include FT_GLYPH_H
00008 
00009 #include "FTGL.h"
00010 #include "FTGlyph.h"
00011 
00012 
00013 /**
00014  * FTBitmapGlyph is a specialisation of FTGlyph for creating bitmaps.
00015  *
00016  * It provides the interface between Freetype glyphs and their openGL
00017  * Renderable counterparts. This is an abstract class and derived classes
00018  * must implement the <code>Render</code> function. 
00019  * 
00020  * @see FTGlyphContainer
00021  *
00022  */
00023 class FTGL_EXPORT FTBitmapGlyph : public FTGlyph
00024 {
00025     public:
00026         /**
00027          * Constructor
00028          *
00029          * @param glyph The Freetype glyph to be processed
00030          */
00031         FTBitmapGlyph( FT_GlyphSlot glyph);
00032 
00033         /**
00034          * Destructor
00035          */
00036         virtual ~FTBitmapGlyph();
00037 
00038         /**
00039          * Renders this glyph at the current pen position.
00040          *
00041          * @param pen   The current pen position.
00042          * @return      The advance distance for this glyph.
00043          */
00044         virtual const FTPoint& Render( const FTPoint& pen);
00045         
00046     private:
00047         /**
00048          * The width of the glyph 'image'
00049          */
00050         unsigned int destWidth;
00051 
00052         /**
00053          * The height of the glyph 'image'
00054          */
00055         unsigned int destHeight;
00056 
00057         /**
00058          * The pitch of the glyph 'image'
00059          */
00060         unsigned int destPitch;
00061 
00062         /**
00063          * Vector from the pen position to the topleft corner of the bitmap
00064          */
00065         FTPoint pos;
00066         
00067         /**
00068          * Pointer to the 'image' data
00069          */
00070         unsigned char* data;
00071         
00072 };
00073 
00074 
00075 #endif  //  __FTBitmapGlyph__
00076 

Generated on Tue Jul 5 14:16:15 2011 for ROOT_528-00b_version by  doxygen 1.5.1