Hash :
bb798851
Author :
Date :
2001-08-01T22:56:04
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
#ifndef __FTVectoriser__
#define __FTVectoriser__
#include <vector>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include "FTGlyph.h"
class FTContour
{
public:
// methods
FTContour();
~FTContour();
void AddPoint( int x, int y);
int size() const { return pointList.size();}
// attributes
// typedef pair<int, int> ftPoint;
struct ftPoint
{
float x, y, z;
ftPoint()
: x(0), y(0), z(0){}
ftPoint( float X, float Y, float Z)
: x(X), y(Y), z(Z){}
};
vector< ftPoint> pointList;
float ctrlPtArray[4][2];
private:
// methods
// attributes
};
//FIXME get rid of this
#define MAX_DEG 4
class FTVectoriser
{
public:
// methods
FTVectoriser( FT_Glyph glyph);
virtual ~FTVectoriser();
bool Ingest();
void Output( float* d);
int points();
int contours() const { return contourList.size();}
int contourSize( int c) const { return contourList[c]->size();}
// attributes
private:
// methods
int Conic( int index, int first, int last);
int Cubic( int index, int first, int last);
void deCasteljau( GLfloat t, int n);
void evaluateCurve( int n);
// attributes
vector< FTContour*> contourList;
float ctrlPtArray[4][2];
FTContour* contour;
FT_Outline ftOutline;
float bValues[MAX_DEG][MAX_DEG][2]; //3D array storing values
//of de Casteljau algorithm.
};
#endif // __FTVectoriser__