MCPcopy Create free account
hub / github.com/MyGUI/mygui / readControlPoints

Function readControlPoints

MyGUIEngine/src/msdfgen/core/shape-description.cpp:71–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70template <typename T, int (*readChar)(T *), int (*readCoord)(T *, Point2 &)>
71static int readControlPoints(T *input, Point2 *output) {
72 int result = readCoord(input, output[0]);
73 if (result == 2) {
74 switch (readChar(input)) {
75 case ')':
76 return 1;
77 case ';':
78 break;
79 default:
80 return -1;
81 }
82 result = readCoord(input, output[1]);
83 if (result == 2 && readChar(input) == ')')
84 return 2;
85 } else if (result != 1 && readChar(input) == ')')
86 return 0;
87 return -1;
88}
89
90template <typename T, int (*readChar)(T *), int (*readCoord)(T *, Point2 &)>
91static bool readContour(T *input, Contour &output, const Point2 *first, int terminator, bool &colorsSpecified) {

Callers

nothing calls this directly

Calls 1

readCoordFunction · 0.85

Tested by

no test coverage detected