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

Method RemovePoint

src/KeyFrame.cpp:430–446  ·  view source on GitHub ↗

Remove a point by matching a coordinate

Source from the content-addressed store, hash-verified

428
429// Remove a point by matching a coordinate
430void Keyframe::RemovePoint(Point p) {
431 // loop through points, and find a matching coordinate
432 for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) {
433 // Get each point
434 Point existing_point = Points[x];
435
436 // find a match
437 if (p.co.X == existing_point.co.X && p.co.Y == existing_point.co.Y) {
438 // Remove the matching point, and break out of loop
439 Points.erase(Points.begin() + x);
440 return;
441 }
442 }
443
444 // no matching point found
445 throw OutOfBoundsPoint("Invalid point requested", -1, Points.size());
446}
447
448// Remove a point by index
449void Keyframe::RemovePoint(int64_t index) {

Callers 1

KeyFrame.cppFile · 0.80

Calls 1

OutOfBoundsPointClass · 0.85

Tested by

no test coverage detected