MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / InterpolateBetween

Function InterpolateBetween

src/KeyFrame.cpp:80–95  ·  view source on GitHub ↗

Interpolate two points using the right Point's interpolation method

Source from the content-addressed store, hash-verified

78 }
79 // Interpolate two points using the right Point's interpolation method
80 double InterpolateBetween(Point const & left, Point const & right, double target, double allowed_error) {
81 // check if target is outside of the extremities poits
82 // This can occur when moving fast the play head
83 if(left.co.X > target){
84 return left.co.Y;
85 }
86 if(target > right.co.X){
87 return right.co.Y;
88 }
89 switch (right.interpolation) {
90 case CONSTANT: return left.co.Y;
91 case LINEAR: return InterpolateLinearCurve(left, right, target);
92 case BEZIER: return InterpolateBezierCurve(left, right, target, allowed_error);
93 default: return InterpolateLinearCurve(left, right, target);
94 }
95 }
96}
97
98template<typename Check>

Callers 3

SearchBetweenPointsFunction · 0.85
GetValueMethod · 0.85
InterpolateBoxesMethod · 0.85

Calls 2

InterpolateLinearCurveFunction · 0.85
InterpolateBezierCurveFunction · 0.85

Tested by

no test coverage detected