| 211 | } |
| 212 | |
| 213 | static void TweakHelen( // hacks to more closely approximate a me17 shape from a Helen shape |
| 214 | Shape& shape17) // io |
| 215 | { |
| 216 | // pupils not available in the helen set so use mean of eye corners |
| 217 | if (PointUsed(shape17, L17_LEyeOuter) && PointUsed(shape17, L17_LEyeInner)) |
| 218 | { |
| 219 | shape17(L17_LPupil, IX) = (shape17(L17_LEyeOuter, IX) + |
| 220 | shape17(L17_LEyeInner, IX)) / 2; |
| 221 | |
| 222 | shape17(L17_LPupil, IY) = (shape17(L17_LEyeOuter, IY) + |
| 223 | shape17(L17_LEyeInner, IY)) / 2; |
| 224 | } |
| 225 | if (PointUsed(shape17, L17_REyeOuter) && PointUsed(shape17, L17_REyeInner)) |
| 226 | { |
| 227 | shape17(L17_RPupil, IX) = (shape17(L17_REyeOuter, IX) + |
| 228 | shape17(L17_REyeInner, IX)) / 2; |
| 229 | |
| 230 | shape17(L17_RPupil, IY) = (shape17(L17_REyeOuter, IY) + |
| 231 | shape17(L17_REyeInner, IY)) / 2; |
| 232 | } |
| 233 | // nose tip and nostrils not available, fake it by shifting available points up |
| 234 | if (PointUsed(shape17, L17_LPupil) && PointUsed(shape17, L17_RPupil)) |
| 235 | { |
| 236 | const double shift = .1 * PointDist(shape17, L17_LPupil, L17_RPupil); |
| 237 | if (PointUsed(shape17, L17_CNoseTip)) |
| 238 | shape17(L17_CNoseTip, IY) -= 2 * shift; |
| 239 | if (PointUsed(shape17, L17_LNostril)) |
| 240 | shape17(L17_LNostril, IY) -= shift; |
| 241 | if (PointUsed(shape17, L17_RNostril)) |
| 242 | shape17(L17_RNostril, IY) -= shift; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | Shape Shape17OrEmpty( // like Shape17 but return zero point shape if can't convert |
| 247 | const Shape& shape) // in |
no test coverage detected