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

Function Shape17OrEmpty

jni/stasm/shape17.cpp:246–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246Shape Shape17OrEmpty( // like Shape17 but return zero point shape if can't convert
247 const Shape& shape) // in
248{
249 const int* const tab = Shape17Tab(shape);
250 if (!tab)
251 {
252 static int printed;
253 PrintOnce(printed,
254 "\nDo not know how to convert a %d point shape to a 17 point face...\n",
255 shape.rows);
256 return Shape(0, 2); // note return
257 }
258 Shape shape17(17, 2);
259 for (int i = 0; i < 17; i++)
260 {
261 int iold = tab[i];
262 CV_Assert(iold >= 0 && iold < NSIZE(shape));
263 shape17(i, IX) = shape(iold, IX);
264 shape17(i, IY) = shape(iold, IY);
265 }
266 if (shape.rows == 21) // 21 point AFLW set?
267 TweakAflw(shape17);
268 else if (shape.rows == 194) // 194 point Helen set?
269 TweakHelen(shape17);
270
271 return shape17;
272}
273
274Shape Shape17( // convert an arb face shape to a 17 point shape, err if can't
275 const Shape& shape) // in

Callers 6

EyeAngleFunction · 0.85
ConvertShapeFunction · 0.85
EyeMouthDistFunction · 0.85
InterEyeDistFunction · 0.85
Shape17Function · 0.85
TraceShapeFunction · 0.85

Calls 5

Shape17TabFunction · 0.85
PrintOnceFunction · 0.85
NSIZEFunction · 0.85
TweakAflwFunction · 0.85
TweakHelenFunction · 0.85

Tested by

no test coverage detected