KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIFONT::OUTLINE_DECOMPOSER Class Reference

#include <outline_decomposer.h>

Public Member Functions

 OUTLINE_DECOMPOSER (FT_Outline &aOutline)
 
bool OutlineToSegments (std::vector< CONTOUR > *aContours)
 

Private Member Functions

void newContour ()
 
void addContourPoint (const VECTOR2D &p)
 
int winding (const std::vector< VECTOR2D > &aContour) const
 

Static Private Member Functions

static unsigned int onCurve (char aTags)
 
static unsigned int thirdOrderBezierPoint (char aTags)
 
static unsigned int secondOrderBezierPoint (char aTags)
 
static unsigned int hasDropout (char aTags)
 
static unsigned int dropoutMode (char aTags)
 
static int moveTo (const FT_Vector *aEndPoint, void *aCallbackData)
 
static int lineTo (const FT_Vector *aEndPoint, void *aCallbackData)
 
static int quadraticTo (const FT_Vector *aControlPoint, const FT_Vector *aEndPoint, void *aCallbackData)
 
static int cubicTo (const FT_Vector *aFirstControlPoint, const FT_Vector *aSecondControlPoint, const FT_Vector *aEndPoint, void *aCallbackData)
 

Private Attributes

FT_Outline & m_outline
 
std::vector< CONTOUR > * m_contours
 
VECTOR2D m_lastEndPoint
 

Detailed Description

Definition at line 68 of file outline_decomposer.h.

Constructor & Destructor Documentation

◆ OUTLINE_DECOMPOSER()

OUTLINE_DECOMPOSER::OUTLINE_DECOMPOSER ( FT_Outline &  aOutline)

Definition at line 33 of file outline_decomposer.cpp.

Member Function Documentation

◆ addContourPoint()

void OUTLINE_DECOMPOSER::addContourPoint ( const VECTOR2D p)
private

Definition at line 55 of file outline_decomposer.cpp.

References m_contours.

Referenced by cubicTo(), lineTo(), and moveTo().

◆ cubicTo()

int OUTLINE_DECOMPOSER::cubicTo ( const FT_Vector *  aFirstControlPoint,
const FT_Vector *  aSecondControlPoint,
const FT_Vector *  aEndPoint,
void *  aCallbackData 
)
staticprivate

◆ dropoutMode()

static unsigned int KIFONT::OUTLINE_DECOMPOSER::dropoutMode ( char  aTags)
inlinestaticprivate

Definition at line 106 of file outline_decomposer.h.

References hasDropout().

◆ hasDropout()

static unsigned int KIFONT::OUTLINE_DECOMPOSER::hasDropout ( char  aTags)
inlinestaticprivate

Definition at line 101 of file outline_decomposer.h.

Referenced by dropoutMode().

◆ lineTo()

int OUTLINE_DECOMPOSER::lineTo ( const FT_Vector *  aEndPoint,
void *  aCallbackData 
)
staticprivate

Definition at line 76 of file outline_decomposer.cpp.

References addContourPoint(), m_lastEndPoint, and toVector2D().

Referenced by OutlineToSegments().

◆ moveTo()

int OUTLINE_DECOMPOSER::moveTo ( const FT_Vector *  aEndPoint,
void *  aCallbackData 
)
staticprivate

Definition at line 63 of file outline_decomposer.cpp.

References addContourPoint(), m_lastEndPoint, newContour(), and toVector2D().

Referenced by OutlineToSegments().

◆ newContour()

void OUTLINE_DECOMPOSER::newContour ( )
private

Definition at line 47 of file outline_decomposer.cpp.

References m_contours, KIFONT::CONTOUR::m_Orientation, and m_outline.

Referenced by moveTo().

◆ onCurve()

static unsigned int KIFONT::OUTLINE_DECOMPOSER::onCurve ( char  aTags)
inlinestaticprivate

Definition at line 86 of file outline_decomposer.h.

Referenced by secondOrderBezierPoint(), and thirdOrderBezierPoint().

◆ OutlineToSegments()

bool OUTLINE_DECOMPOSER::OutlineToSegments ( std::vector< CONTOUR > *  aContours)

◆ quadraticTo()

int OUTLINE_DECOMPOSER::quadraticTo ( const FT_Vector *  aControlPoint,
const FT_Vector *  aEndPoint,
void *  aCallbackData 
)
staticprivate

Definition at line 88 of file outline_decomposer.cpp.

References cubicTo().

Referenced by OutlineToSegments().

◆ secondOrderBezierPoint()

static unsigned int KIFONT::OUTLINE_DECOMPOSER::secondOrderBezierPoint ( char  aTags)
inlinestaticprivate

Definition at line 96 of file outline_decomposer.h.

References onCurve(), and thirdOrderBezierPoint().

◆ thirdOrderBezierPoint()

static unsigned int KIFONT::OUTLINE_DECOMPOSER::thirdOrderBezierPoint ( char  aTags)
inlinestaticprivate

Definition at line 91 of file outline_decomposer.h.

References onCurve().

Referenced by secondOrderBezierPoint().

◆ winding()

int OUTLINE_DECOMPOSER::winding ( const std::vector< VECTOR2D > &  aContour) const
private
Returns
1 if aContour is in clockwise order, -1 if it is in counterclockwise order, or 0 if the winding can't be determined.

Definition at line 151 of file outline_decomposer.cpp.

References VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by OutlineToSegments().

Member Data Documentation

◆ m_contours

std::vector<CONTOUR>* KIFONT::OUTLINE_DECOMPOSER::m_contours
private

Definition at line 124 of file outline_decomposer.h.

Referenced by addContourPoint(), newContour(), and OutlineToSegments().

◆ m_lastEndPoint

VECTOR2D KIFONT::OUTLINE_DECOMPOSER::m_lastEndPoint
private

Definition at line 126 of file outline_decomposer.h.

Referenced by cubicTo(), lineTo(), and moveTo().

◆ m_outline

FT_Outline& KIFONT::OUTLINE_DECOMPOSER::m_outline
private

Definition at line 123 of file outline_decomposer.h.

Referenced by newContour(), and OutlineToSegments().


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