vtkTextureFont.h

Go to the documentation of this file.
00001 /*=auto=========================================================================
00002 
00003   Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
00004 
00005   See Doc/copyright/copyright.txt
00006   or http://www.slicer.org/copyright/copyright.txt for details.
00007 
00008   Program:   3D Slicer
00009   Module:    $RCSfile: vtkTextureFont.h,v $
00010   Date:      $Date: 2006/05/26 19:59:44 $
00011   Version:   $Revision: 1.4 $
00012 
00013 =========================================================================auto=*/
00014 /*===========================================================
00015 
00016 Authors: Michael McKenna, David Small, Steve Pieper.
00017     Small Design Firm, Inc.,
00018     in association with Isomics, Inc.,
00019     and Partners Health Care.  MA, USA.
00020     June, 2004
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 //BTX
00051     Vector2D<vtkFloatingPointType> GetChararacterPosition(int c);
00052     Vector2D<vtkFloatingPointType> GetChararacterSize(int c);
00053 //ETX
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 //BTX
00069     Vector2D<vtkFloatingPointType> *mCharPositions;
00070     Vector2D<vtkFloatingPointType> *mCharSizes;
00071 //ETX
00072     vtkFontParameters *FontParameters;
00073     vtkFreetypeRasterizer *FreetypeRasterizer;
00074 
00075 //    char *FontFileName;
00076 //    char *FontDirectory;
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 //BTX
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 //ETX
00099 };
00100 
00101 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1