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

Method ScalePoints

src/KeyFrame.cpp:516–527  ·  view source on GitHub ↗

Scale all points by a percentage (good for evenly lengthening or shortening an openshot::Keyframe) 1.0 = same size, 1.05 = 5% increase, etc...

Source from the content-addressed store, hash-verified

514// Scale all points by a percentage (good for evenly lengthening or shortening an openshot::Keyframe)
515// 1.0 = same size, 1.05 = 5% increase, etc...
516void Keyframe::ScalePoints(double scale)
517{
518 // TODO: What if scale is small so that two points land on the
519 // same X coordinate?
520 // TODO: What if scale < 0?
521
522 // Loop through each point (skipping the 1st point)
523 for (std::vector<Point>::size_type point_index = 1; point_index < Points.size(); point_index++) {
524 // Scale X value
525 Points[point_index].co.X = round(Points[point_index].co.X * scale);
526 }
527}
528
529// Flip all the points in this openshot::Keyframe (useful for reversing an effect or transition, etc...)
530void Keyframe::FlipPoints() {

Callers 1

KeyFrame.cppFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected