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

Method FindIndex

src/KeyFrame.cpp:166–181  ·  view source on GitHub ↗

Get the index of a point by matching a coordinate

Source from the content-addressed store, hash-verified

164
165// Get the index of a point by matching a coordinate
166int64_t Keyframe::FindIndex(Point p) const {
167 // loop through points, and find a matching coordinate
168 for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) {
169 // Get each point
170 Point existing_point = Points[x];
171
172 // find a match
173 if (p.co.X == existing_point.co.X && p.co.Y == existing_point.co.Y) {
174 // Remove the matching point, and break out of loop
175 return x;
176 }
177 }
178
179 // no matching point found
180 throw OutOfBoundsPoint("Invalid point requested", -1, Points.size());
181}
182
183// Determine if point already exists
184bool Keyframe::Contains(Point p) const {

Callers

nothing calls this directly

Calls 1

OutOfBoundsPointClass · 0.85

Tested by

no test coverage detected