MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / FlipShape

Function FlipShape

jni/stasm/landmarks.cpp:69–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67// Needed so we can use right facing models for left facing faces.
68
69Shape FlipShape( // flip shape horizontally
70 const Shape& shape, // in
71 int imgwidth) // in
72{
73 const LANDMARK_INFO* info = nullptr;
74 switch (shape.rows)
75 {
76 case 77: info = LANDMARK_INFO_TAB; break;
77 default: Err("Do not know how to mirror a %d shape", shape.rows);
78 }
79 Shape outshape(shape.rows, 2);
80 for (int i = 0; i < shape.rows; i++)
81 {
82 int partner = info[i].partner;
83
84 if (partner == -1) // no partner e.g. tip of nose
85 partner = i;
86
87 FlipPoint(outshape, shape, partner, i, imgwidth);
88 }
89 return outshape;
90}
91
92} // namespace stasm

Callers 3

RoiShapeToImgFrameFunction · 0.85
FlipIfLeftFacingFunction · 0.85
PinnedStartShapeAndRoiFunction · 0.85

Calls 2

ErrFunction · 0.85
FlipPointFunction · 0.85

Tested by

no test coverage detected