vtkTextureFont.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __vtkTextureFont_h
00026 #define __vtkTextureFont_h
00027
00028
00029 #include "vtkFreetypeRasterizer.h"
00030 #include "vtkFontParameters.h"
00031
00032 #include "vtkImageData.h"
00033 #include "vtkQueryAtlasWin32Header.h"
00034
00035 #include "simpleVectors.h"
00036
00037
00038 class VTK_QUERYATLAS_EXPORT vtkTextureFont : public vtkImageData
00039 {
00040
00041 public:
00042 void PrintSelf(ostream& os, vtkIndent indent);
00043 vtkTypeRevisionMacro(vtkTextureFont,vtkImageData);
00044
00045 static vtkTextureFont *New();
00046
00047 int CreateFont();
00048 int CreateRasterizer(char *fontpath);
00049
00050
00051 Vector2D<vtkFloatingPointType> GetChararacterPosition(int c);
00052 Vector2D<vtkFloatingPointType> GetChararacterSize(int c);
00053
00054
00055 vtkGetMacro(Width, int);
00056 vtkGetMacro(Height, int);
00057
00058 vtkGetObjectMacro(FreetypeRasterizer,vtkFreetypeRasterizer);
00059 vtkGetObjectMacro(FontParameters,vtkFontParameters);
00060 vtkGetMacro(Initialized,int);
00061 vtkGetMacro(Error,int);
00062
00063
00064 protected:
00065 vtkTextureFont();
00066 ~vtkTextureFont();
00067
00068
00069 Vector2D<vtkFloatingPointType> *mCharPositions;
00070 Vector2D<vtkFloatingPointType> *mCharSizes;
00071
00072 vtkFontParameters *FontParameters;
00073 vtkFreetypeRasterizer *FreetypeRasterizer;
00074
00075
00076
00077
00078 int Width;
00079 int Height;
00080
00081 int Initialized;
00082 int Error;
00083
00084 vtkTextureFont *loadFont( char *fontname, int blur = 0);
00085 vtkTextureFont *filter_image(unsigned char *src, unsigned char *dst, int wd, int ht, int filter);
00086 void copy_array(unsigned char *dst, unsigned char *src, int size);
00087 void zero_array(unsigned char *ptr, int size);
00088 void MakeImageData(unsigned char *Alpha, unsigned char *intensity);
00089
00090
00091 void copyArrayOffset(unsigned char *dst,
00092 unsigned char *src,
00093 int w, int h, int xOff, int yOff);
00094
00095 void mattArrayOffset(unsigned char *dstAlpha, unsigned char *dstI,
00096 unsigned char *srcAlpha, unsigned char srcLevel,
00097 int w, int h, int xOff, int yOff);
00098
00099 };
00100
00101 #endif