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

Function InterPoint

jni/stasm/convshape.cpp:19–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19static void InterPoint( // interpolate a point from two nearby oldshape points
20 Shape& shape, // io
21 const Shape& oldshape, // in
22 int i, // in: shape point
23 double ratio, // in: interpolation ratio, 0 to 1
24 int i1, // in: oldshape point 1
25 int i2) // in: oldshape point 2
26{
27 if (!PointUsed(oldshape, i1) && !PointUsed(oldshape, i2))
28 {
29 shape(i, IX) = 0;
30 shape(i, IY) = 0;
31 }
32 else if (!PointUsed(oldshape, i1))
33 {
34 shape(i, IX) = oldshape(i2, IX) + 1; // +1 is arb, to disambiguate point
35 shape(i, IY) = oldshape(i2, IY) + 1;
36 }
37 else if (!PointUsed(oldshape, i2))
38 {
39 shape(i, IX) = oldshape(i1, IX) + 1;
40 shape(i, IY) = oldshape(i1, IY) + 1;
41 }
42 else
43 {
44 CV_Assert(ratio >= 0 && ratio <= 1);
45 shape(i, IX) = ratio * oldshape(i1, IX) + (1-ratio) * oldshape(i2, IX);
46 shape(i, IY) = ratio * oldshape(i1, IY) + (1-ratio) * oldshape(i2, IY);
47 }
48}
49
50static Shape Shape77As20( // return an approximated BioID 20 point shape
51 const Shape& shape) // in: Stasm 77 point shape

Callers 2

Shape77AsXm2vts68Function · 0.85
Shape77As68Function · 0.85

Calls 1

PointUsedFunction · 0.85

Tested by

no test coverage detected