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

Function SearchBetweenPoints

src/KeyFrame.cpp:99–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98template<typename Check>
99int64_t SearchBetweenPoints(Point const & left, Point const & right, int64_t const current, Check check) {
100 int64_t start = left.co.X;
101 int64_t stop = right.co.X;
102 while (start < stop) {
103 int64_t const mid = (start + stop + 1) / 2;
104 double const value = InterpolateBetween(left, right, mid, 0.01);
105 if (check(round(value), current)) {
106 start = mid;
107 } else {
108 stop = mid - 1;
109 }
110 }
111 return start;
112}
113
114// Constructor which sets the default point & coordinate at X=1
115Keyframe::Keyframe(double value) {

Callers

nothing calls this directly

Calls 1

InterpolateBetweenFunction · 0.85

Tested by

no test coverage detected