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)
 
void OutlineToSegments (CONTOURS *aContours)
 

Private Member Functions

void contourToSegmentsAndArcs (CONTOUR &aResult, unsigned int aContourIndex) const
 
void newContour ()
 
void addContourPoint (const VECTOR2D &p)
 
int approximateContour (const GLYPH_POINTS &aPoints, const std::vector< bool > &aPointOnCurve, GLYPH_POINTS &aResult) const
 
bool approximateBezierCurve (GLYPH_POINTS &result, const GLYPH_POINTS &bezier) const
 
bool approximateQuadraticBezierCurve (GLYPH_POINTS &result, const GLYPH_POINTS &bezier) const
 
bool approximateCubicBezierCurve (GLYPH_POINTS &result, const GLYPH_POINTS &bezier) const
 
int winding (const GLYPH_POINTS &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
 
CONTOURSm_contours
 
VECTOR2D m_lastEndPoint
 

Detailed Description

Definition at line 59 of file outline_decomposer.h.

Constructor & Destructor Documentation

◆ OUTLINE_DECOMPOSER()

OUTLINE_DECOMPOSER::OUTLINE_DECOMPOSER ( FT_Outline &  aOutline)

Definition at line 32 of file outline_decomposer.cpp.

Member Function Documentation

◆ addContourPoint()

void OUTLINE_DECOMPOSER::addContourPoint ( const VECTOR2D p)
private

Definition at line 54 of file outline_decomposer.cpp.

References m_contours.

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

◆ approximateBezierCurve()

bool OUTLINE_DECOMPOSER::approximateBezierCurve ( GLYPH_POINTS result,
const GLYPH_POINTS bezier 
) const
private

Definition at line 190 of file outline_decomposer.cpp.

References approximateCubicBezierCurve(), and approximateQuadraticBezierCurve().

Referenced by cubicTo().

◆ approximateContour()

int KIFONT::OUTLINE_DECOMPOSER::approximateContour ( const GLYPH_POINTS aPoints,
const std::vector< bool > &  aPointOnCurve,
GLYPH_POINTS aResult 
) const
private

◆ approximateCubicBezierCurve()

bool OUTLINE_DECOMPOSER::approximateCubicBezierCurve ( GLYPH_POINTS result,
const GLYPH_POINTS bezier 
) const
private

◆ approximateQuadraticBezierCurve()

bool OUTLINE_DECOMPOSER::approximateQuadraticBezierCurve ( GLYPH_POINTS result,
const GLYPH_POINTS bezier 
) const
private

Definition at line 149 of file outline_decomposer.cpp.

References approximateCubicBezierCurve().

Referenced by approximateBezierCurve().

◆ contourToSegmentsAndArcs()

void KIFONT::OUTLINE_DECOMPOSER::contourToSegmentsAndArcs ( CONTOUR aResult,
unsigned int  aContourIndex 
) const
private

◆ 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 107 of file outline_decomposer.h.

References hasDropout().

◆ hasDropout()

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

Definition at line 102 of file outline_decomposer.h.

Referenced by dropoutMode().

◆ lineTo()

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

Definition at line 75 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 62 of file outline_decomposer.cpp.

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

Referenced by OutlineToSegments().

◆ newContour()

void OUTLINE_DECOMPOSER::newContour ( )
private

Definition at line 46 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 87 of file outline_decomposer.h.

Referenced by secondOrderBezierPoint(), and thirdOrderBezierPoint().

◆ OutlineToSegments()

void OUTLINE_DECOMPOSER::OutlineToSegments ( CONTOURS aContours)

◆ quadraticTo()

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

Definition at line 87 of file outline_decomposer.cpp.

References cubicTo().

Referenced by OutlineToSegments().

◆ secondOrderBezierPoint()

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

Definition at line 97 of file outline_decomposer.h.

References onCurve(), and thirdOrderBezierPoint().

◆ thirdOrderBezierPoint()

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

Definition at line 92 of file outline_decomposer.h.

References onCurve().

Referenced by secondOrderBezierPoint().

◆ winding()

int OUTLINE_DECOMPOSER::winding ( const GLYPH_POINTS 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 208 of file outline_decomposer.cpp.

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

Referenced by OutlineToSegments().

Member Data Documentation

◆ m_contours

CONTOURS* KIFONT::OUTLINE_DECOMPOSER::m_contours
private

Definition at line 125 of file outline_decomposer.h.

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

◆ m_lastEndPoint

VECTOR2D KIFONT::OUTLINE_DECOMPOSER::m_lastEndPoint
private

Definition at line 127 of file outline_decomposer.h.

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

◆ m_outline

FT_Outline& KIFONT::OUTLINE_DECOMPOSER::m_outline
private

Definition at line 124 of file outline_decomposer.h.

Referenced by newContour(), and OutlineToSegments().


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