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

Function PrevAndNextLandmarks

jni/stasm/landmarks.cpp:18–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void PrevAndNextLandmarks(
19 int& prev, // out
20 int& next, // out
21 int ipoint, // in
22 const Shape& shape) // in
23{
24 const int npoints = shape.rows;
25
26 const LANDMARK_INFO* const info = LANDMARK_INFO_TAB;
27
28 CV_Assert(NELEMS(LANDMARK_INFO_TAB) == npoints);
29 CV_Assert(ipoint >= 0 && ipoint < npoints);
30
31 prev = info[ipoint].prev;
32 if (prev < 0) // not specified in table?
33 prev = (ipoint + npoints - 1) % npoints;
34
35 next = info[ipoint].next;
36 if (next < 0)
37 next = (ipoint + 1) % npoints;
38
39 CV_Assert(prev >= 0);
40 CV_Assert(next >= 0);
41 CV_Assert(prev < int(shape.rows));
42 CV_Assert(next < int(shape.rows));
43 CV_Assert(prev != next);
44 CV_Assert(PointUsed(shape, prev));
45 CV_Assert(PointUsed(shape, next));
46}
47
48static void FlipPoint(
49 Shape& shape, // io

Callers 1

WhiskerStepFunction · 0.85

Calls 2

NELEMSFunction · 0.85
PointUsedFunction · 0.85

Tested by

no test coverage detected