| 16 | } |
| 17 | |
| 18 | void 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 | |
| 48 | static void FlipPoint( |
| 49 | Shape& shape, // io |
no test coverage detected